Compare commits
No commits in common. "2bbf7655c93a348c9042adbacc30c4643c8c29d9" and "6115ca4be240d25335f6f638a37dde37ac21362b" have entirely different histories.
2bbf7655c9
...
6115ca4be2
7 changed files with 75 additions and 23 deletions
|
|
@ -112,10 +112,18 @@
|
||||||
dest: '{{ xdg_config_dir }}/nvim/after/ftplugin/yaml.lua',
|
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/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',
|
src: 'templates/nvim/lua/lsp.lua.j2',
|
||||||
dest: '{{ xdg_config_dir }}/nvim/lua/lsp.lua',
|
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',
|
src: 'templates/nvim/lua/options.lua.j2',
|
||||||
dest: '{{ xdg_config_dir }}/nvim/lua/options.lua',
|
dest: '{{ xdg_config_dir }}/nvim/lua/options.lua',
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
require('options')
|
require('options')
|
||||||
require('lsp')
|
require('lsp')
|
||||||
|
require('nvim-cmp')
|
||||||
|
require('auto-commands')
|
||||||
require('tree-sitter')
|
require('tree-sitter')
|
||||||
require('lua-line')
|
require('lua-line')
|
||||||
require('git-signs')
|
require('git-signs')
|
||||||
|
|
|
||||||
6
templates/nvim/lua/auto-commands.lua.j2
Normal file
6
templates/nvim/lua/auto-commands.lua.j2
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
-- {{ ansible_managed }}
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd('Filetype', {
|
||||||
|
pattern = 'TelescopeResults',
|
||||||
|
command = [[:setlocal nofoldenable]],
|
||||||
|
})
|
||||||
|
|
@ -68,6 +68,22 @@ 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({
|
nvim_lsp.pyright.setup({
|
||||||
settings = {
|
settings = {
|
||||||
pyright = {
|
pyright = {
|
||||||
|
|
@ -104,25 +120,12 @@ cmp.setup({
|
||||||
|
|
||||||
formatting = {
|
formatting = {
|
||||||
format = function(entry, vim_item)
|
format = function(entry, vim_item)
|
||||||
if entry.source.name == 'nvim_lsp' then
|
|
||||||
vim_item.menu = string.format('[%s]', entry.source.source.client.name)
|
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
|
return vim_item
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
mapping = cmp.mapping.preset.insert({
|
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)
|
['<Tab>'] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_next_item()
|
cmp.select_next_item()
|
||||||
|
|
@ -149,10 +152,3 @@ cmp.setup({
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.diagnostic.config({
|
|
||||||
float = {
|
|
||||||
source = 'always',
|
|
||||||
border = border
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
|
||||||
35
templates/nvim/lua/nvim-cmp.lua.j2
Normal file
35
templates/nvim/lua/nvim-cmp.lua.j2
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
-- {{ 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' },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -51,9 +51,13 @@ vim.o.cursorline = true
|
||||||
-- theme related
|
-- theme related
|
||||||
vim.o.termguicolors = true
|
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
|
-- use a dedicated file explorer
|
||||||
vim.g.loaded_netrw = 1
|
vim.g.loaded_netrw = 1
|
||||||
vim.g.loaded_netrwPlugin = 1
|
vim.g.loaded_netrwPlugin = 1
|
||||||
|
|
||||||
-- python interpreter
|
-- python interpreter
|
||||||
vim.g.python3_host_prog = '/usr/bin/python3'
|
vim.g.python3_host_prog = './env/bin/python'
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ packages:
|
||||||
- git
|
- git
|
||||||
- vim
|
- vim
|
||||||
- neovim
|
- neovim
|
||||||
- python-pynvim
|
|
||||||
- wl-clipboard
|
- wl-clipboard
|
||||||
- npm
|
- npm
|
||||||
- docker
|
- docker
|
||||||
|
|
@ -38,6 +37,8 @@ aur_build_dir: '/usr/local/src'
|
||||||
python_build_dir: '/usr/local/src'
|
python_build_dir: '/usr/local/src'
|
||||||
python_install_dir: '/opt'
|
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:
|
language_servers:
|
||||||
- {
|
- {
|
||||||
package: ansible-language-server,
|
package: ansible-language-server,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue