vim: add zls, do keybind cleanup
This commit is contained in:
parent
7a54d9fa15
commit
eb43190b7c
@ -1,22 +1,30 @@
|
|||||||
-- Basic settings
|
-- Basic settings
|
||||||
vim.g.loaded_matchparen = true
|
vim.g.loaded_matchparen = true
|
||||||
vim.g.netrw_liststyle = 3
|
vim.g.netrw_liststyle = 3
|
||||||
vim.go.background = 'dark'
|
|
||||||
vim.go.belloff = 'all'
|
|
||||||
vim.go.breakindent = true
|
|
||||||
vim.go.hlsearch = false
|
|
||||||
vim.go.laststatus = 0
|
|
||||||
vim.go.lazyredraw = true
|
|
||||||
vim.go.showcmd = true
|
|
||||||
vim.go.synmaxcol = 800
|
|
||||||
vim.go.syntax = 'on'
|
|
||||||
vim.go.termguicolors = true
|
|
||||||
vim.go.titleold = vim.fn.getcwd()
|
|
||||||
vim.go.title = true
|
|
||||||
vim.go.wildmenu = true
|
|
||||||
vim.go.wrap = true
|
|
||||||
vim.wo.number = true
|
vim.wo.number = true
|
||||||
|
|
||||||
|
local glob_opts = {
|
||||||
|
background = 'dark',
|
||||||
|
belloff = 'all',
|
||||||
|
breakindent = true,
|
||||||
|
hlsearch = false,
|
||||||
|
laststatus = 0,
|
||||||
|
lazyredraw = true,
|
||||||
|
showcmd = true,
|
||||||
|
synmaxcol = 800,
|
||||||
|
syntax = 'on',
|
||||||
|
termguicolors = true,
|
||||||
|
titleold = vim.fn.getcwd(),
|
||||||
|
title = true,
|
||||||
|
wildmenu = true,
|
||||||
|
wrap = true,
|
||||||
|
}
|
||||||
|
|
||||||
|
for option, value in pairs(glob_opts) do
|
||||||
|
vim.go[option] = value
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
vim.cmd([[colorscheme gruvbox]])
|
vim.cmd([[colorscheme gruvbox]])
|
||||||
|
|
||||||
require 'nvim-treesitter.configs'.setup {
|
require 'nvim-treesitter.configs'.setup {
|
||||||
@ -99,26 +107,18 @@ vim.api.nvim_create_autocmd('LspAttach', {
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.diagnostic.config({
|
vim.diagnostic.config({ virtual_text = false}) -- Turn off inline diagnostics
|
||||||
virtual_text = false, -- Turn off inline diagnostics
|
|
||||||
})
|
|
||||||
-- Show all diagnostics on current line in floating window
|
-- Show all diagnostics on current line in floating window
|
||||||
vim.api.nvim_set_keymap(
|
vim.api.nvim_set_keymap( 'n', '<Leader>d', ':lua vim.diagnostic.open_float()<CR>', opts)
|
||||||
'n', '<Leader>d', ':lua vim.diagnostic.open_float()<CR>',
|
|
||||||
{ noremap = true, silent = true }
|
|
||||||
)
|
|
||||||
-- Go to next diagnostic (if there are multiple on the same line, only shows
|
-- Go to next diagnostic (if there are multiple on the same line, only shows
|
||||||
-- one at a time in the floating window)
|
-- one at a time in the floating window)
|
||||||
vim.api.nvim_set_keymap(
|
vim.api.nvim_set_keymap( 'n', '<Leader>n', ':lua vim.diagnostic.goto_next()<CR>', opts)
|
||||||
'n', '<Leader>n', ':lua vim.diagnostic.goto_next()<CR>',
|
|
||||||
{ noremap = true, silent = true }
|
|
||||||
)
|
|
||||||
-- Go to prev diagnostic (if there are multiple on the same line, only shows
|
-- Go to prev diagnostic (if there are multiple on the same line, only shows
|
||||||
-- one at a time in the floating window)
|
-- one at a time in the floating window)
|
||||||
vim.api.nvim_set_keymap(
|
vim.api.nvim_set_keymap( 'n', '<Leader>p', ':lua vim.diagnostic.goto_prev()<CR>', opts)
|
||||||
'n', '<Leader>p', ':lua vim.diagnostic.goto_prev()<CR>',
|
|
||||||
{ noremap = true, silent = true }
|
|
||||||
)
|
|
||||||
|
|
||||||
-- Use a loop to conveniently call 'setup' on multiple servers and
|
-- Use a loop to conveniently call 'setup' on multiple servers and
|
||||||
-- map buffer local keybindings when the language server attaches
|
-- map buffer local keybindings when the language server attaches
|
||||||
@ -184,7 +184,7 @@ cmp.setup({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
local servers = { 'pyright', 'rust_analyzer', 'ccls', 'nixd', 'texlab' }
|
local servers = { 'pyright', 'rust_analyzer', 'ccls', 'nixd', 'texlab', 'zls' }
|
||||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
for _, lsp in pairs(servers) do
|
for _, lsp in pairs(servers) do
|
||||||
require('lspconfig')[lsp].setup {
|
require('lspconfig')[lsp].setup {
|
||||||
|
Loading…
Reference in New Issue
Block a user