Update neovim setup

Switch from pyright to python-lsp-server
This commit is contained in:
Sonny Bakker 2023-08-04 10:29:11 +02:00
parent 9891f205f4
commit b0cdf7b854
6 changed files with 47 additions and 38 deletions

View file

@ -23,7 +23,9 @@ end
--enable some language servers with the additional completion capabilities
--offered by nvim-cmp
local servers = { 'ansiblels', 'yamlls', 'cssls', 'jsonls', 'tsserver', }
local servers = {
'ansiblels', 'yamlls', 'cssls', 'jsonls', 'tsserver', 'bashls', 'lua_ls'
}
--add additional capabilities supported by nvim-cmp
local capabilities = vim.lsp.protocol.make_client_capabilities()
@ -40,9 +42,19 @@ end
local util = require('lspconfig/util')
nvim_lsp.pyright.setup({
nvim_lsp.pylsp.setup({
on_attach = on_attach,
capabilities = capabilities,
cmd = { 'pylsp', '--verbose' },
settings = {
pylsp = {
plugins = {
ruff = {
enabled = true
}
}
}
},
root_dir = function(fname)
return util.root_pattern('.git', 'setup.cfg', 'requirements')(fname) or
util.path.dirname(fname)

View file

@ -1,58 +1,62 @@
-- {{ ansible_managed }} {{ ansible_date_time.time }} {{ ansible_date_time.date }}
--fix different locale settings when ssh'ing
-- fix different locale settings when ssh'ing
vim.o.encoding = 'utf-8'
vim.o.syntax = 'on'
--display all matching files when we tab complete
-- display all matching files when we tab complete
vim.o.wildmenu = true
--replace vertical split pipe character with space
-- replace vertical split pipe character with space
vim.o.fillchars = 'vert:|,fold: '
--Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
--delays and poor user experience.
-- Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
-- delays and poor user experience.
vim.o.updatetime = 300
vim.o.splitright = true
vim.o.splitbelow = true
--switch buffers without writing to file
vim.o.hidden = true
-- switch buffers without writing to file
vim.o.hidden = true
--fold indents
vim.o.foldmethod = 'indent'
-- folding
vim.o.foldmethod = 'expr'
vim.o.foldexpr = 'nvim_treesitter#foldexpr()'
--don't open folds when jumping over one with (, {, [[ or [{
-- don't open folds when jumping over one with (, {, [[ or [{
vim.opt.foldopen = vim.opt.foldopen - { 'block' }
--search down into subfolders
--provides tab-completion for all file-related tasks
-- search down into subfolders
-- provides tab-completion for all file-related tasks
vim.opt.path = vim.opt.path + { '**' }
--line numbers
-- line numbers
vim.o.number = true
--higlhight search
-- higlhight search
vim.o.hls = true
--search as characters are entered
-- search as characters are entered
vim.o.incsearch = true
--line for linewrapping
-- line for linewrapping
vim.o.colorcolumn = '80'
--wrap text instead of being on one line
-- wrap text instead of being on one line
vim.o.lbr = true
--default Colors for CursorLine
-- default Colors for CursorLine
vim.o.cursorline = true
-- theme related
vim.o.termguicolors = true
vim.o.background = 'light'
--enable statusbar
-- enable statusbar
vim.o.laststatus = 2
vim.o.statusline = ' %F %m%r%w %= %{hostname()} %{strlen(&ft)?&ft:"none"} %{(&bomb?",BOM":"")} %{&ff} %l/%L %c %P'
-- python interpreter
vim.g.python3_host_prog = './env/bin/python'

View file

@ -8,7 +8,7 @@ local tree_sitter_config = require('nvim-treesitter.configs')
tree_sitter_config.setup {
ensure_installed = {
'lua', 'yaml', 'bash', 'python', 'javascript', 'css', 'scss', 'html',
'json', 'dockerfile', 'markdown',
'htmldjango', 'json', 'dockerfile', 'markdown',
},
auto_install = true,
highlight = {