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',
|
||||
}
|
||||
- { 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',
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
require('options')
|
||||
require('lsp')
|
||||
require('nvim-cmp')
|
||||
require('auto-commands')
|
||||
require('tree-sitter')
|
||||
require('lua-line')
|
||||
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({
|
||||
settings = {
|
||||
pyright = {
|
||||
|
|
@ -104,25 +120,12 @@ cmp.setup({
|
|||
|
||||
formatting = {
|
||||
format = function(entry, vim_item)
|
||||
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
|
||||
|
||||
vim_item.menu = string.format('[%s]', entry.source.source.client.name)
|
||||
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()
|
||||
|
|
@ -149,10 +152,3 @@ cmp.setup({
|
|||
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
|
||||
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 = '/usr/bin/python3'
|
||||
vim.g.python3_host_prog = './env/bin/python'
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ packages:
|
|||
- git
|
||||
- vim
|
||||
- neovim
|
||||
- python-pynvim
|
||||
- wl-clipboard
|
||||
- npm
|
||||
- docker
|
||||
|
|
@ -38,6 +37,8 @@ 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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue