initial commit
This commit is contained in:
commit
23d4795228
99 changed files with 6691 additions and 0 deletions
9
config/nvim/lua/lsp/bashls.lua
Normal file
9
config/nvim/lua/lsp/bashls.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
return {
|
||||
on_attach = function(_, bufnr)
|
||||
require('config.lsp').on_attach(_, bufnr)
|
||||
local bufname = vim.api.nvim_buf_get_name(bufnr)
|
||||
if string.match(bufname, '%.env') then
|
||||
vim.diagnostic.enable(false, { bufnr = bufnr })
|
||||
end
|
||||
end,
|
||||
}
|
||||
39
config/nvim/lua/lsp/clangd.lua
Normal file
39
config/nvim/lua/lsp/clangd.lua
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
local config = require('config.projects')
|
||||
|
||||
local clangd_settings = {
|
||||
filetypes = { 'c', 'cpp', 'objc', 'objcpp', 'cuda' },
|
||||
cmd = {
|
||||
'clangd',
|
||||
'--clang-tidy',
|
||||
'-j=4',
|
||||
'--background-index',
|
||||
'--completion-style=bundled',
|
||||
'--header-insertion=iwyu',
|
||||
'--header-insertion-decorators=false',
|
||||
},
|
||||
capabilities = {
|
||||
textDocument = {
|
||||
completion = {
|
||||
editsNearCursor = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
local project_settings = (config.lsp and config.lsp.clangd)
|
||||
and config.lsp.clangd
|
||||
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
callback = function(args)
|
||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
if client and client.name == 'clangd' then
|
||||
bmap(
|
||||
{ 'n', 'gh', vim.cmd.ClangdSwitchSourceHeader },
|
||||
{ buffer = args.buf }
|
||||
)
|
||||
end
|
||||
end,
|
||||
group = vim.api.nvim_creat_augroup('AClangdKeymap', { clear = true }),
|
||||
})
|
||||
|
||||
return vim.tbl_extend('force', clangd_settings, project_settings or {})
|
||||
18
config/nvim/lua/lsp/cssls.lua
Normal file
18
config/nvim/lua/lsp/cssls.lua
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
return {
|
||||
cmd = { 'vscode-css-language-server', '--stdio' },
|
||||
filetypes = { 'css', 'scss', 'less' },
|
||||
settings = {
|
||||
css = {
|
||||
lint = {
|
||||
unknownAtRules = 'ignore',
|
||||
},
|
||||
},
|
||||
},
|
||||
capabilities = {
|
||||
textDocument = {
|
||||
completion = {
|
||||
completionItem = { snippetSupport = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
30
config/nvim/lua/lsp/emmet_language_server.lua
Normal file
30
config/nvim/lua/lsp/emmet_language_server.lua
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
return {
|
||||
cmd = { 'emmet-language-server', '--stdio' },
|
||||
filetypes = {
|
||||
'astro',
|
||||
'css',
|
||||
'eruby',
|
||||
'html',
|
||||
'htmlangular',
|
||||
'htmldjango',
|
||||
'javascriptreact',
|
||||
'less',
|
||||
'pug',
|
||||
'sass',
|
||||
'scss',
|
||||
'svelte',
|
||||
'templ',
|
||||
'typescriptreact',
|
||||
'vue',
|
||||
},
|
||||
init_options = {
|
||||
showSuggestionsAsSnippets = true,
|
||||
},
|
||||
capabilities = {
|
||||
textDocument = {
|
||||
completion = {
|
||||
completionItem = { snippetSupport = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
5
config/nvim/lua/lsp/eslint.lua
Normal file
5
config/nvim/lua/lsp/eslint.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
settings = {
|
||||
format = false,
|
||||
},
|
||||
}
|
||||
9
config/nvim/lua/lsp/html.lua
Normal file
9
config/nvim/lua/lsp/html.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
return {
|
||||
capabilities = {
|
||||
textDocument = {
|
||||
completion = {
|
||||
completionItem = { snippetSupport = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
15
config/nvim/lua/lsp/jsonls.lua
Normal file
15
config/nvim/lua/lsp/jsonls.lua
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
return {
|
||||
capabilities = {
|
||||
textDocument = {
|
||||
completion = {
|
||||
completionItem = { snippetSupport = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
settings = {
|
||||
json = {
|
||||
schemas = require('schemastore').json.schemas(),
|
||||
validate = { enable = true },
|
||||
},
|
||||
},
|
||||
}
|
||||
19
config/nvim/lua/lsp/lua_ls.lua
Normal file
19
config/nvim/lua/lsp/lua_ls.lua
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
return {
|
||||
settings = {
|
||||
Lua = {
|
||||
codeLens = { enable = true },
|
||||
completion = { keywordSnippet = 'Disable' },
|
||||
diagnostics = { globals = { 'vim' } },
|
||||
hint = {
|
||||
enable = true,
|
||||
arrayIndex = 'Disable',
|
||||
semicolon = 'Disable',
|
||||
},
|
||||
runtime = { version = 'LuaJIT' },
|
||||
telemetry = { enable = false },
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
5
config/nvim/lua/lsp/mdx_analyzer.lua
Normal file
5
config/nvim/lua/lsp/mdx_analyzer.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
cmd = { 'mdx-language-server', '--stdio' },
|
||||
filetypes = { 'mdx' },
|
||||
root_markers = { 'package.json' },
|
||||
}
|
||||
11
config/nvim/lua/lsp/pytest_lsp.lua
Normal file
11
config/nvim/lua/lsp/pytest_lsp.lua
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
return {
|
||||
cmd = { 'pytest-language-server' },
|
||||
filetypes = { 'python' },
|
||||
root_markers = {
|
||||
'pyproject.toml',
|
||||
'setup.py',
|
||||
'setup.cfg',
|
||||
'pytest.ini',
|
||||
'.git',
|
||||
},
|
||||
}
|
||||
28
config/nvim/lua/lsp/rust-analyzer.lua
Normal file
28
config/nvim/lua/lsp/rust-analyzer.lua
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
return {
|
||||
standalone = false,
|
||||
capabilities = { general = { positionEncodings = { 'utf-16' } } },
|
||||
settings = {
|
||||
['rust-analyzer'] = {
|
||||
checkOnSave = {
|
||||
overrideCommand = {
|
||||
'cargo',
|
||||
'clippy',
|
||||
'--message-format=json',
|
||||
'--',
|
||||
'-W',
|
||||
'clippy::expect_used',
|
||||
'-W',
|
||||
'clippy::pedantic',
|
||||
'-W',
|
||||
'clippy::unwrap_used',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
on_attach = function(...)
|
||||
require('config.lsp').on_attach(...)
|
||||
bmap({ 'n', '\\Rc', '<cmd>RustLsp codeAction<cr>' })
|
||||
bmap({ 'n', '\\Rm', '<cmd>RustLsp expandMacro<cr>' })
|
||||
bmap({ 'n', '\\Ro', '<cmd>RustLsp openCargo<cr>' })
|
||||
end,
|
||||
}
|
||||
14
config/nvim/lua/lsp/tailwindcss.lua
Normal file
14
config/nvim/lua/lsp/tailwindcss.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
return {
|
||||
filetypes = {
|
||||
'javascript',
|
||||
'javascriptreact',
|
||||
'typescript',
|
||||
'typescriptreact',
|
||||
},
|
||||
root_markers = {
|
||||
'tailwind.config.js',
|
||||
'tailwind.config.ts',
|
||||
'postcss.config.js',
|
||||
'postcss.config.ts',
|
||||
},
|
||||
}
|
||||
12
config/nvim/lua/lsp/tinymist.lua
Normal file
12
config/nvim/lua/lsp/tinymist.lua
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
return {
|
||||
filetypes = { 'typst' },
|
||||
settings = {
|
||||
formatterMode = 'typstyle',
|
||||
semanticTokens = 'disable',
|
||||
lint = {
|
||||
enabled = true,
|
||||
when = 'onType',
|
||||
-- when = 'onSave'
|
||||
},
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue