Compare commits

...

7 commits

7 changed files with 23 additions and 75 deletions

View file

@ -112,18 +112,10 @@
dest: '{{ xdg_config_dir }}/nvim/after/ftplugin/yaml.lua',
}
- { src: 'templates/nvim/init.lua.j2', dest: '{{ xdg_config_dir }}/nvim/init.lua' }
- {
src: 'templates/nvim/lua/auto-commands.lua.j2',
dest: '{{ xdg_config_dir }}/nvim/lua/auto-commands.lua',
}
- {
src: 'templates/nvim/lua/lsp.lua.j2',
dest: '{{ xdg_config_dir }}/nvim/lua/lsp.lua',
}
- {
src: 'templates/nvim/lua/nvim-cmp.lua.j2',
dest: '{{ xdg_config_dir }}/nvim/lua/nvim-cmp.lua',
}
- {
src: 'templates/nvim/lua/options.lua.j2',
dest: '{{ xdg_config_dir }}/nvim/lua/options.lua',

View file

@ -2,8 +2,6 @@
require('options')
require('lsp')
require('nvim-cmp')
require('auto-commands')
require('tree-sitter')
require('lua-line')
require('git-signs')

View file

@ -1,6 +0,0 @@
-- {{ ansible_managed }}
vim.api.nvim_create_autocmd('Filetype', {
pattern = 'TelescopeResults',
command = [[:setlocal nofoldenable]],
})

View file

@ -68,22 +68,6 @@ nvim_lsp.ruff.setup({
})
nvim_lsp.pylsp.setup({
on_attach = on_attach,
capabilities = capabilities,
cmd = { 'pylsp', '--verbose' },
settings = {
pylsp = {
plugins = {
ruff = {
enabled = false -- now through ruff lsp
}
}
}
},
root_dir = python_root_dir
})
nvim_lsp.pyright.setup({
settings = {
pyright = {
@ -120,12 +104,25 @@ cmp.setup({
formatting = {
format = function(entry, vim_item)
vim_item.menu = string.format('[%s]', entry.source.source.client.name)
if entry.source.name == 'nvim_lsp' then
vim_item.menu = string.format('[%s]', entry.source.source.client.name)
else
vim_item.menu = string.format('[%s]', entry.source.name)
end
return vim_item
end,
},
mapping = cmp.mapping.preset.insert({
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.close(),
['<CR>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = true,
},
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
@ -152,3 +149,10 @@ cmp.setup({
end,
},
})
vim.diagnostic.config({
float = {
source = 'always',
border = border
},
})

View file

@ -1,35 +0,0 @@
-- {{ ansible_managed }}
local cmp = require('cmp')
cmp.setup {
mapping = {
['<C-p>'] = cmp.mapping.select_prev_item(),
['<C-n>'] = cmp.mapping.select_next_item(),
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.close(),
['<CR>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = true,
},
['<Tab>'] = function(fallback)
if cmp.visible() then
cmp.select_next_item()
else
fallback()
end
end,
['<S-Tab>'] = function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end,
},
sources = {
{ name = 'nvim_lsp' },
},
}

View file

@ -51,13 +51,9 @@ vim.o.cursorline = true
-- theme related
vim.o.termguicolors = true
-- 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'
-- use a dedicated file explorer
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- python interpreter
vim.g.python3_host_prog = './env/bin/python'
vim.g.python3_host_prog = '/usr/bin/python3'

View file

@ -6,6 +6,7 @@ packages:
- git
- vim
- neovim
- python-pynvim
- wl-clipboard
- npm
- docker
@ -37,8 +38,6 @@ aur_build_dir: '/usr/local/src'
python_build_dir: '/usr/local/src'
python_install_dir: '/opt'
# Note that the "python-lsp-server" and "neovim" python
# packages should be installed to the corresponding virtualenv as well.
language_servers:
- {
package: ansible-language-server,