From b69a7f828213068f1de18158a369ad41d38ae1ca Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Mon, 22 Nov 2021 13:02:12 +0100 Subject: remove navigator --- nvim/init.vim | 4 ---- nvim/lua/feline_style.lua | 34 +++++++++++++++++----------------- nvim/lua/lsp_conf.lua | 37 +++++++++++++++++-------------------- 3 files changed, 34 insertions(+), 41 deletions(-) diff --git a/nvim/init.vim b/nvim/init.vim index d2ce209..67764bc 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -38,7 +38,6 @@ if has('nvim') Plug 'folke/lsp-colors.nvim' Plug 'ray-x/guihua.lua', {'do': 'cd lua/fzy && make' } - Plug 'ray-x/navigator.lua' endif @@ -127,9 +126,6 @@ if has('nvim') lua require('nvim-treesitter.configs').setup({ highlight = { enable = true, }, }) lua require("lsp-colors").setup() - - lua require('navigator').setup() - else colorscheme miramare endif diff --git a/nvim/lua/feline_style.lua b/nvim/lua/feline_style.lua index 5159759..9dba06a 100644 --- a/nvim/lua/feline_style.lua +++ b/nvim/lua/feline_style.lua @@ -93,14 +93,14 @@ local comps = { type = { provider = 'file_type' }, - os = { - provider = file_osinfo, - left_sep = ' ', - hl = { - fg = colors.violet, - style = 'bold' - } - }, + -- os = { + -- provider = file_osinfo, + -- left_sep = ' ', + -- hl = { + -- fg = colors.violet, + -- style = 'bold' + -- } + -- }, position = { provider = 'position', left_sep = ' ', @@ -119,19 +119,19 @@ local comps = { }, line_percentage = { provider = 'line_percentage', - left_sep = ' ', - hl = { - style = 'bold' - } - }, - scroll_bar = { - provider = 'scroll_bar', - left_sep = ' ', + left_sep = ' ', hl = { - fg = colors.blue, style = 'bold' } }, + -- scroll_bar = { + -- provider = 'scroll_bar', + -- left_sep = ' ', + -- hl = { + -- fg = colors.blue, + -- style = 'bold' + -- } + -- }, diagnos = { err = { -- provider = 'diagnostic_errors', diff --git a/nvim/lua/lsp_conf.lua b/nvim/lua/lsp_conf.lua index ba574d6..1609eac 100644 --- a/nvim/lua/lsp_conf.lua +++ b/nvim/lua/lsp_conf.lua @@ -14,23 +14,9 @@ end local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end local opts = { noremap=true, silent=true } -local on_attach = function(client, bufnr) - local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end - local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end - - -- Mappings. - local opts = { noremap=true, silent=true } - - -- See `:help vim.lsp.*` for documentation on any of the below functions - buf_set_keymap('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) - buf_set_keymap('n', 'gd', 'lua vim.lsp.buf.definition()', opts) - buf_set_keymap('n', 'K', 'lua vim.lsp.buf.hover()', opts) - buf_set_keymap('n', 'gr', 'lua vim.lsp.buf.references()', opts) - buf_set_keymap('n', 'e', 'lua vim.lsp.diagnostic.show_line_diagnostics()', opts) -end - null_ls.config({ debug = false, + save_after_format = false, sources = { -- Python null_ls.builtins.formatting.black, @@ -53,7 +39,19 @@ local servers = { 'pyright', 'rust_analyzer', 'tsserver', 'clangd' } for _, lsp in ipairs(servers) do nvim_lsp[lsp].setup { capabilities = coq.lsp_ensure_capabilities(), - on_attach = on_attach, + on_attach = function(client, bufnr) + client.resolved_capabilities.document_formatting = false + + -- Mappings. + local opts = { noremap=true, silent=true } + + -- See `:help vim.lsp.*` for documentation on any of the below functions + buf_set_keymap('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) + buf_set_keymap('n', 'gd', 'lua vim.lsp.buf.definition()', opts) + buf_set_keymap('n', 'K', 'lua vim.lsp.buf.hover()', opts) + buf_set_keymap('n', 'gr', 'lua vim.lsp.buf.references()', opts) + buf_set_keymap('n', 'e', 'lua vim.lsp.diagnostic.show_line_diagnostics()', opts) + end, flags = { debounce_text_changes = 150, } @@ -61,11 +59,9 @@ for _, lsp in ipairs(servers) do end nvim_lsp["null-ls"].setup({ - on_attach = function(client, bufnr) - -- Format on save. + on_attach = function(client) if client.resolved_capabilities.document_formatting then - buf_set_keymap('n', 'fs', 'lua vim.lsp.buf.formatting_sync()', opts) - vim.cmd 'autocmd BufWritePre lua vim.lsp.buf.formatting_seq_sync()' + vim.cmd "autocmd BufWritePre lua vim.lsp.buf.formatting_seq_sync()" end end }) @@ -75,3 +71,4 @@ trouble.setup({ auto_close = true, auto_open = true }) + -- cgit v1.2.3-18-g5258