mirror of
https://github.com/pnx/dotfiles
synced 2026-06-17 11:30:02 +02:00
new nvim config
This commit is contained in:
parent
f087422bbf
commit
7d14948480
66 changed files with 1771 additions and 1719 deletions
16
nvim/lua/user/plugins/lang/bash.lua
Normal file
16
nvim/lua/user/plugins/lang/bash.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = { "bash" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
bashls = {}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
8
nvim/lua/user/plugins/lang/blade.lua
Normal file
8
nvim/lua/user/plugins/lang/blade.lua
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = { "blade" }
|
||||
}
|
||||
},
|
||||
}
|
||||
16
nvim/lua/user/plugins/lang/clangd.lua
Normal file
16
nvim/lua/user/plugins/lang/clangd.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = { "c", "cpp" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
clangd = {}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
16
nvim/lua/user/plugins/lang/css.lua
Normal file
16
nvim/lua/user/plugins/lang/css.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = { "css", "scss" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
tailwindcss = {},
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
43
nvim/lua/user/plugins/lang/go.lua
Normal file
43
nvim/lua/user/plugins/lang/go.lua
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
local lspservers = {
|
||||
gopls = {
|
||||
settings = {
|
||||
gopls = {
|
||||
analyses = {
|
||||
unusedvariable = true,
|
||||
unusedwrite = true,
|
||||
useany = true,
|
||||
},
|
||||
gofumpt = true,
|
||||
},
|
||||
},
|
||||
on_save = function()
|
||||
local params = vim.lsp.util.make_range_params()
|
||||
params.context = { only = { "source.organizeImports" } }
|
||||
local result = vim.lsp.buf_request_sync(0, "textDocument/codeAction", params, 1000)
|
||||
for cid, res in pairs(result or {}) do
|
||||
for _, r in pairs(res.result or {}) do
|
||||
if r.edit then
|
||||
local enc = (vim.lsp.get_client_by_id(cid) or {}).offset_encoding or "utf-16"
|
||||
vim.lsp.util.apply_workspace_edit(r.edit, enc)
|
||||
end
|
||||
end
|
||||
end
|
||||
vim.lsp.buf.format({ async = false })
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = { "go", "gomod", "gowork", "gosum" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = lspservers
|
||||
},
|
||||
}
|
||||
}
|
||||
8
nvim/lua/user/plugins/lang/html.lua
Normal file
8
nvim/lua/user/plugins/lang/html.lua
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = { "html" }
|
||||
}
|
||||
}
|
||||
}
|
||||
33
nvim/lua/user/plugins/lang/lua.lua
Normal file
33
nvim/lua/user/plugins/lang/lua.lua
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
local lspservers = {
|
||||
lua_ls = {
|
||||
cmd = { "/opt/luals/bin/lua-language-server", "--logpath=~/.local/luals/logs" },
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
version = "LuaJIT",
|
||||
},
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
library = {
|
||||
vim.env.VIMRUNTIME,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = { "lua" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = lspservers
|
||||
}
|
||||
}
|
||||
}
|
||||
25
nvim/lua/user/plugins/lang/php.lua
Normal file
25
nvim/lua/user/plugins/lang/php.lua
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
local lspservers = {
|
||||
phpactor = {
|
||||
settings = {
|
||||
init_options = {
|
||||
["language_server_phpstan.enabled"] = true,
|
||||
["language_server_psalm.enabled"] = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = { "php", "phpdoc" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = lspservers
|
||||
},
|
||||
}
|
||||
}
|
||||
37
nvim/lua/user/plugins/lang/rust.lua
Normal file
37
nvim/lua/user/plugins/lang/rust.lua
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
local lspservers = {
|
||||
rust_analyzer = {
|
||||
-- settings = {
|
||||
-- ["rust-analyzer"] = {
|
||||
-- imports = {
|
||||
-- granularity = {
|
||||
-- group = "module",
|
||||
-- },
|
||||
-- prefix = "self",
|
||||
-- },
|
||||
-- cargo = {
|
||||
-- buildScripts = {
|
||||
-- enable = true,
|
||||
-- },
|
||||
-- },
|
||||
-- procMacro = {
|
||||
-- enable = true
|
||||
-- },
|
||||
-- }
|
||||
-- }
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = { "rust", "toml" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = lspservers
|
||||
},
|
||||
}
|
||||
}
|
||||
24
nvim/lua/user/plugins/lang/typescript.lua
Normal file
24
nvim/lua/user/plugins/lang/typescript.lua
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
local lspservers = {
|
||||
tsserver = {
|
||||
settings = {
|
||||
-- tsserver_plugins = {
|
||||
-- "@vue/typescript-plugin",
|
||||
-- },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = { "typescript" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = lspservers
|
||||
},
|
||||
}
|
||||
}
|
||||
36
nvim/lua/user/plugins/lang/vue.lua
Normal file
36
nvim/lua/user/plugins/lang/vue.lua
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
local lspservers = {
|
||||
volar = {
|
||||
init_options = {
|
||||
vue = {
|
||||
hybridMode = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
tsserver = {
|
||||
settings = {
|
||||
tsserver_plugins = {
|
||||
"@vue/typescript-plugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
-- Vue needs typescript
|
||||
{ import = "user.plugins.lang.typescript" },
|
||||
-- And most likely css/scss aswell.
|
||||
{ import = "user.plugins.lang.css" },
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = { "vue" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = lspservers
|
||||
},
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue