diff options
author | Santo Cariotti <santo@dcariotti.me> | 2021-11-22 13:02:12 +0100 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2021-11-22 13:02:12 +0100 |
commit | b69a7f828213068f1de18158a369ad41d38ae1ca (patch) | |
tree | 13525e178bfb0dad5623d9efc78c51912933cb44 /nvim/lua | |
parent | ec53f123399c933f02c9d2a477e15915b7025d62 (diff) |
remove navigator
Diffstat (limited to 'nvim/lua')
-rw-r--r-- | nvim/lua/feline_style.lua | 34 | ||||
-rw-r--r-- | nvim/lua/lsp_conf.lua | 37 |
2 files changed, 34 insertions, 37 deletions
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', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts) - buf_set_keymap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts) - buf_set_keymap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts) - buf_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts) - buf_set_keymap('n', '<space>e', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', 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', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts) + buf_set_keymap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts) + buf_set_keymap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts) + buf_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts) + buf_set_keymap('n', '<space>e', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', 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', '<leader>fs', '<cmd>lua vim.lsp.buf.formatting_sync()<cr>', opts) - vim.cmd 'autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_seq_sync()' + vim.cmd "autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_seq_sync()" end end }) @@ -75,3 +71,4 @@ trouble.setup({ auto_close = true, auto_open = true }) + |