diff options
-rw-r--r-- | dotfiles/.config/nvim/init.vim | 10 | ||||
-rw-r--r-- | dotfiles/.config/nvim/lua.lua | 49 |
2 files changed, 46 insertions, 13 deletions
diff --git a/dotfiles/.config/nvim/init.vim b/dotfiles/.config/nvim/init.vim index 95d7a63..d9820bc 100644 --- a/dotfiles/.config/nvim/init.vim +++ b/dotfiles/.config/nvim/init.vim @@ -28,6 +28,8 @@ call plug#begin('~/.local/share/nvim/site/plugged') Plug 'tpope/vim-fugitive' Plug 'mmarchini/bpftrace.vim' Plug 'junkblocker/git-time-lapse' + Plug 'tikhomirov/vim-glsl' + Plug 'aklt/plantuml-syntax' if has('nvim-0.6') Plug 'neovim/nvim-lspconfig' Plug 'ojroques/nvim-lspfuzzy' @@ -70,6 +72,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 @@ -276,9 +279,6 @@ call plug#end() " Treesitter if has('nvim-0.9') - " XXX: neovim's built-in C et al treesitter parsers are better, although - " not ideal either. - lua require('nvim-treesitter.configs').setup{ ensure_installed = { "go", "rust", "python", "lua", "comment" }, highlight = { enable = true, disable = { "c", "cpp", "vim", "make" } }} set foldmethod=expr set foldexpr=nvim_treesitter#foldexpr() endif @@ -295,11 +295,13 @@ 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, meson setlocal noet ci pi sts=0 ts=4 sw=4 tw=80 + 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 text,tex,markdown,html,rst setlocal spell spelllang=en_us,es,ru tw=80 | \ let b:SuperTabContextDefaultCompletionType = "<c-p>" + " Having this on is a retarded default + let g:zig_fmt_autosave = 0 " C indentation rules set cino=:0l1 diff --git a/dotfiles/.config/nvim/lua.lua b/dotfiles/.config/nvim/lua.lua index 8514d19..5473841 100644 --- a/dotfiles/.config/nvim/lua.lua +++ b/dotfiles/.config/nvim/lua.lua @@ -2,13 +2,31 @@ 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{} +local on_attach = function(client, _) + client.request = require('lspfuzzy').wrap_request(client.request) +end +vim.lsp.config('*', {on_attach = on_attach}) + +lspconfig.clangd.setup{ + filetypes = { "c", "cpp", "objc", "objcpp", "ch" }, + on_attach = on_attach, +} +lspconfig.gopls.setup{on_attach = on_attach} +lspconfig.pylsp.setup{on_attach = on_attach} +lspconfig.rust_analyzer.setup{on_attach = on_attach} +lspconfig.quick_lint_js.setup{on_attach = on_attach} +lspconfig.zls.setup{on_attach = on_attach} require('lspfuzzy').setup{} +if vim.fn.has('nvim-0.9') then + -- XXX: neovim's built-in C et al treesitter parsers are better, although + -- not ideal either. + require('nvim-treesitter.configs').setup{ + ensure_installed = { "go", "proto", "rust", "python", "lua", "comment", "zig" }, + highlight = { enable = true, disable = { "c", "cpp", "vim", "make" } }, + } +end + local lsp_icons = { Class = " ", Color = " ", @@ -43,7 +61,20 @@ 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' }) +if vim.fn.has('nvim-0.11') then + vim.diagnostic.config({ + signs = { + text = { + [vim.diagnostic.severity.ERROR] = '', + [vim.diagnostic.severity.WARN] = '', + [vim.diagnostic.severity.INFO] = '', + [vim.diagnostic.severity.HINT] = '', + }, + } + }) +else + 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' }) +end |