aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.config/nvim
diff options
context:
space:
mode:
Diffstat (limited to 'dotfiles/.config/nvim')
-rw-r--r--dotfiles/.config/nvim/init.vim18
-rw-r--r--dotfiles/.config/nvim/lua.lua49
2 files changed, 54 insertions, 13 deletions
diff --git a/dotfiles/.config/nvim/init.vim b/dotfiles/.config/nvim/init.vim
index 1e78846..4d1b95c 100644
--- a/dotfiles/.config/nvim/init.vim
+++ b/dotfiles/.config/nvim/init.vim
@@ -70,6 +70,7 @@ call plug#end()
set background=light
endfunction
map <F10> :call ChangeBG()<CR>
+ autocmd Signal SIGUSR1 call ChangeBG()
let g:markdown_fenced_languages = ['c', 'go', 'sh', 'bash=sh', 'python', 'html', 'css', 'javascript']
" Set screen title
@@ -256,14 +257,10 @@ call plug#end()
" LSP
if has('nvim-0.6')
set omnifunc=v:lua.vim.lsp.omnifunc
- lua require('lspconfig').clangd.setup{filetypes = { "c", "cpp", "objc", "objcpp", "ch" }}
- lua require('lspconfig').gopls.setup{}
- lua require('lspconfig').pylsp.setup{}
- lua require('lspconfig').rls.setup{}
- lua require('lspconfig').quick_lint_js.setup{}
- lua require('lspfuzzy').setup{}
+ source ~/.config/nvim/lua.lua
endif
+
" LSP keybinds
nmap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>
nmap <silent> gD <cmd>lua vim.lsp.buf.declaration()<CR>
@@ -299,15 +296,10 @@ call plug#end()
" MFing neovim overrding my omnifunc with whatever ccomplete is
autocmd FileType c,ch,header,cpp setlocal omnifunc=v:lua.vim.lsp.omnifunc fdm=syntax
" No, Rust, spaces is not superior to tabs, 100 lines is too much
- autocmd FileType rust setlocal noet ci pi sts=0 ts=4 sw=4 tw=80
- autocmd FileType meson setlocal noet ci pi sts=0 ts=4 sw=4 tw=80
- autocmd FileType tex setlocal spell spelllang=en_us,es,ru tw=80 |
- \ let b:SuperTabContextDefaultCompletionType = "<c-p>"
- autocmd FileType text setlocal spell spelllang=en_us,es,ru tw=80 |
- \ let b:SuperTabContextDefaultCompletionType = "<c-p>"
+ autocmd FileType rust, meson setlocal noet ci pi sts=0 ts=4 sw=4 tw=80
autocmd FileType mail setlocal spell spelllang=en_us,es,ru tw=72 |
\ let b:SuperTabContextDefaultCompletionType = "<c-p>"
- autocmd FileType markdown setlocal spell spelllang=en_us,es,ru tw=80 |
+ autocmd FileType text,tex,markdown,html,rst setlocal spell spelllang=en_us,es,ru tw=80 |
\ let b:SuperTabContextDefaultCompletionType = "<c-p>"
" C indentation rules
diff --git a/dotfiles/.config/nvim/lua.lua b/dotfiles/.config/nvim/lua.lua
new file mode 100644
index 0000000..8514d19
--- /dev/null
+++ b/dotfiles/.config/nvim/lua.lua
@@ -0,0 +1,49 @@
+-- LSP configuration
+
+local lspconfig = require('lspconfig')
+
+lspconfig.clangd.setup{filetypes = { "c", "cpp", "objc", "objcpp", "ch" }}
+lspconfig.gopls.setup{}
+lspconfig.pylsp.setup{}
+lspconfig.rls.setup{}
+lspconfig.quick_lint_js.setup{}
+require('lspfuzzy').setup{}
+
+local lsp_icons = {
+ Class = " ",
+ Color = " ",
+ Constant = " ",
+ Constructor = " ",
+ Enum = " ",
+ EnumMember = " ",
+ Field = "󰄶 ",
+ File = " ",
+ Folder = " ",
+ Function = "ƒ ",
+ Interface = "󰜰",
+ Keyword = "󰌆 ",
+ Method = "∫ ",
+ Module = "󰏗 ",
+ Property = " ",
+ Snippet = "󰘍 ",
+ Struct = " ",
+ Text = " ",
+ Unit = " ",
+ Value = "󰎠 ",
+ Variable = " ",
+}
+
+
+function lsp_icons_setup()
+ local kinds = vim.lsp.protocol.CompletionItemKind
+ for i, kind in ipairs(kinds) do
+ kinds[i] = lsp_icons[kind] or kind
+ end
+end
+
+lsp_icons_setup()
+
+vim.fn.sign_define('DiagnosticSignError', { text = '', texthl = 'DiagnosticSignError' })
+vim.fn.sign_define('DiagnosticSignWarn', { text = '', texthl = 'DiagnosticSignWarn' })
+vim.fn.sign_define('DiagnosticSignInfo', { text = '', texthl = 'DiagnosticSignInfo' })
+vim.fn.sign_define('DiagnosticSignHint', { text = '', texthl = 'DiagnosticSignHint' })