Refactor: Update neovim configuration
This commit refactors the neovim configuration to include several updates: - Added LSP support for Zig (`zls`). - Added `analyzer` and `zls` to `ale` linters. - Added `zigfmt` to `ale` fixers. - Added `towolf/vim-helm` as a plugin. - Added configuration for `lualine` to display Treesitter status. - Included SSH config from `conf.d/*.conf`. - Updated keymaps for LSP formatting. - Modified tabwidth and shiftwidth for rust files.
This commit is contained in:
parent
c93c4e25d7
commit
1dd35ed47a
@ -11,7 +11,6 @@ cmd "set tabstop=2"
|
|||||||
cmd "set shiftwidth=2"
|
cmd "set shiftwidth=2"
|
||||||
cmd "set expandtab"
|
cmd "set expandtab"
|
||||||
cmd "set nofoldenable"
|
cmd "set nofoldenable"
|
||||||
cmd "set pastetoggle=<F2>"
|
|
||||||
|
|
||||||
-- always show status
|
-- always show status
|
||||||
cmd "set laststatus=2"
|
cmd "set laststatus=2"
|
||||||
@ -65,3 +64,10 @@ vim.diagnostic.get(0, { severity = {
|
|||||||
} })
|
} })
|
||||||
vim.diagnostic.config({virtual_text = false, signs = true})
|
vim.diagnostic.config({virtual_text = false, signs = true})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
pattern = "rust",
|
||||||
|
callback = function()
|
||||||
|
vim.opt_local.shiftwidth = 4
|
||||||
|
vim.opt_local.tabstop = 4
|
||||||
|
end
|
||||||
|
})
|
||||||
|
@ -13,11 +13,13 @@ return {
|
|||||||
go = {'gopls'},
|
go = {'gopls'},
|
||||||
rust = {'analyzer'},
|
rust = {'analyzer'},
|
||||||
sh = {'shellcheck'},
|
sh = {'shellcheck'},
|
||||||
|
zig = {'zls'},
|
||||||
}
|
}
|
||||||
|
|
||||||
g.ale_fixers = {
|
g.ale_fixers = {
|
||||||
javascript = {'{{ if .nvim.js_fixer }}{{ .nvim.js_fixer }}{{ else }}eslint{{ end }}'},
|
javascript = {'{{ if .nvim.js_fixer }}{{ .nvim.js_fixer }}{{ else }}eslint{{ end }}'},
|
||||||
typescript = {'{{ if .nvim.js_fixer }}{{ .nvim.js_fixer }}{{ else }}eslint{{ end }}'},
|
typescript = {'{{ if .nvim.js_fixer }}{{ .nvim.js_fixer }}{{ else }}eslint{{ end }}'},
|
||||||
|
zig = {'zigfmt'},
|
||||||
}
|
}
|
||||||
|
|
||||||
g.ale_linters_explicit = 1
|
g.ale_linters_explicit = 1
|
||||||
|
@ -122,6 +122,7 @@ return {
|
|||||||
|
|
||||||
-- temp plugins
|
-- temp plugins
|
||||||
"elkowar/yuck.vim",
|
"elkowar/yuck.vim",
|
||||||
|
"towolf/vim-helm",
|
||||||
|
|
||||||
"evanleck/vim-svelte",
|
"evanleck/vim-svelte",
|
||||||
"AndrewRadev/linediff.vim",
|
"AndrewRadev/linediff.vim",
|
||||||
@ -141,5 +142,6 @@ return {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
}
|
},
|
||||||
|
require('plugins.vim-ai'),
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ return {
|
|||||||
buf_set_keymap('n', '<leader>d[', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
|
buf_set_keymap('n', '<leader>d[', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
|
||||||
buf_set_keymap('n', '<leader>d]', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
|
buf_set_keymap('n', '<leader>d]', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
|
||||||
-- buf_set_keymap('n', '<space>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
|
-- buf_set_keymap('n', '<space>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
|
||||||
-- buf_set_keymap('n', '<space>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
|
buf_set_keymap('n', '<leader>gf', '<cmd>lua vim.lsp.buf.format()<CR>', opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
local nvlsp = require('lspconfig')
|
local nvlsp = require('lspconfig')
|
||||||
@ -68,6 +68,10 @@ return {
|
|||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
}
|
}
|
||||||
|
nvlsp['zls'].setup{
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
}
|
||||||
|
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,12 @@ return {
|
|||||||
path = 1,
|
path = 1,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
lualine_x = {'encoding', 'fileformat', 'filetype'},
|
lualine_x = {
|
||||||
|
function()
|
||||||
|
return require('nvim-treesitter').statusline({
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
'encoding', 'fileformat', 'filetype'},
|
||||||
lualine_y = {'progress'},
|
lualine_y = {'progress'},
|
||||||
lualine_z = {'location'}
|
lualine_z = {'location'}
|
||||||
},
|
},
|
||||||
|
@ -3,19 +3,4 @@ Host *
|
|||||||
UserKnownHostsFile /dev/null
|
UserKnownHostsFile /dev/null
|
||||||
ForwardAgent yes
|
ForwardAgent yes
|
||||||
|
|
||||||
Host git.lawsnote.com
|
Include conf.d/*.conf
|
||||||
Port 2222
|
|
||||||
User git
|
|
||||||
HostName git.lawsnote.com
|
|
||||||
|
|
||||||
Host dev
|
|
||||||
User jay
|
|
||||||
HostName 192.168.200.15
|
|
||||||
|
|
||||||
Host vpn
|
|
||||||
User root
|
|
||||||
HostName 192.168.201.254
|
|
||||||
|
|
||||||
Host lndev
|
|
||||||
User jay
|
|
||||||
HostName 192.168.88.12
|
|
||||||
|
Loading…
Reference in New Issue
Block a user