update: neovim lsp
This commit is contained in:
parent
e63917ca85
commit
43e394c86a
14 changed files with 244 additions and 128 deletions
|
|
@ -36,7 +36,7 @@ require("lazy").setup({
|
|||
{ import = "lazyvim.plugins.extras.lang.markdown" },
|
||||
{ import = "lazyvim.plugins.extras.lang.nushell" },
|
||||
{ import = "lazyvim.plugins.extras.lang.omnisharp" },
|
||||
{ import = "lazyvim.plugins.extras.lang.python" },
|
||||
-- { import = "lazyvim.plugins.extras.lang.python" },
|
||||
{ import = "lazyvim.plugins.extras.lang.rust" },
|
||||
{ import = "lazyvim.plugins.extras.lang.tailwind" },
|
||||
{ import = "lazyvim.plugins.extras.lang.toml" },
|
||||
|
|
|
|||
|
|
@ -1,8 +1,37 @@
|
|||
local util = require("lspconfig.util")
|
||||
require("lspconfig").lua_ls.setup({
|
||||
on_init = function(client)
|
||||
local path = client.workspace_folders[1].name
|
||||
if vim.loop.fs_stat(path .. "/.luarc.json") or vim.loop.fs_stat(path .. "/.luarc.jsonc") then
|
||||
return
|
||||
end
|
||||
|
||||
client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using
|
||||
-- (most likely LuaJIT in the case of Neovim)
|
||||
version = "LuaJIT",
|
||||
},
|
||||
-- Make the server aware of Neovim runtime files
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
library = {
|
||||
vim.env.VIMRUNTIME,
|
||||
-- Depending on the usage, you might want to add additional paths here.
|
||||
"${3rd}/luv/library",
|
||||
-- "${3rd}/busted/library",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
settings = {
|
||||
Lua = {},
|
||||
},
|
||||
})
|
||||
|
||||
return {
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
event = "LazyFile",
|
||||
opts = {
|
||||
servers = {
|
||||
-- biome = {
|
||||
|
|
@ -14,7 +43,35 @@ return {
|
|||
-- or util.find_git_ancestor(fname)
|
||||
-- end,
|
||||
-- },
|
||||
nil_ls = false,
|
||||
nixd = {
|
||||
cmd = { "nixd" },
|
||||
settings = {
|
||||
nixd = {
|
||||
nixpkgs = {
|
||||
expr = "import <nixpkgs> { }",
|
||||
},
|
||||
formatting = {
|
||||
command = { "nixfmt" },
|
||||
},
|
||||
options = {
|
||||
nixos = {
|
||||
expr = '(builtins.getFlake ("git+file://" + toString ./.)).nixosConfigurations.k-on.options',
|
||||
},
|
||||
home_manager = {
|
||||
expr = '(builtins.getFlake ("git+file://" + toString ./.)).homeConfigurations."ruixi@k-on".options',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
nginx_language_server = {
|
||||
cmd = { "nginx-language-server" },
|
||||
filetypes = { "nginx" },
|
||||
rootPatterns = { "nginx.conf", ".git" },
|
||||
},
|
||||
},
|
||||
},
|
||||
setup = {},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
11
home/config/nvim/lua/plugins/markdown-preview.lua
Normal file
11
home/config/nvim/lua/plugins/markdown-preview.lua
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
return {
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
||||
build = "cd app && yarn install",
|
||||
init = function()
|
||||
vim.g.mkdp_filetypes = { "markdown" }
|
||||
end,
|
||||
ft = { "markdown" },
|
||||
},
|
||||
}
|
||||
5
home/config/nvim/lua/plugins/mason.lua
Normal file
5
home/config/nvim/lua/plugins/mason.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
-- Mason is not usable on NixOS
|
||||
return {
|
||||
{ "williamboman/mason-lspconfig.nvim", enabled = false },
|
||||
{ "williamboman/mason.nvim", enabled = false },
|
||||
}
|
||||
7
home/config/nvim/lua/plugins/suda.lua
Normal file
7
home/config/nvim/lua/plugins/suda.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
{
|
||||
"lambdalisue/vim-suda",
|
||||
cmd = "SudaWrite",
|
||||
keys = { { "<leader>bs", "<cmd>SudaWrite<cr>", desc = "Save Buffer as Root" } },
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue