feat(lua):introduce yank highlight autocmd and improve secure_env + LSP configs
This commit is contained in:
2 files changed
+309
-286
No files matched your search
+137
-137
@@ -2,152 +2,152 @@
|
||||
-- LSP
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "PackerComplete", -- Fallback or custom event if needed, but let's use a more standard one
|
||||
callback = function()
|
||||
-- This is where we would put it if we had a specific event.
|
||||
-- Since we're using VimEnter, let's use that instead.
|
||||
end,
|
||||
vim.api.nvim_create_autocmd('User', {
|
||||
pattern = 'PackerComplete', -- Fallback or custom event if needed, but let's use a more standard one
|
||||
callback = function()
|
||||
-- This is where we would put it if we had a specific event.
|
||||
-- Since we're using VimEnter, let's use that instead.
|
||||
end,
|
||||
})
|
||||
|
||||
-- Let's use a simple function and schedule it to run after plugins
|
||||
vim.schedule(function()
|
||||
vim.lsp.config("*", {
|
||||
capabilities = require("blink.cmp").get_lsp_capabilities(),
|
||||
})
|
||||
vim.lsp.config('*', {
|
||||
capabilities = require('blink.cmp').get_lsp_capabilities(),
|
||||
})
|
||||
|
||||
-- ts_ls
|
||||
vim.lsp.config("ts_ls", {
|
||||
settings = {
|
||||
typescript = {
|
||||
inlayHints = {
|
||||
includeInlayParameterNameHints = "all",
|
||||
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
|
||||
includeInlayFunctionParameterTypeHints = true,
|
||||
includeInlayVariableTypeHints = true,
|
||||
includeInlayPropertyDeclarationTypeHints = true,
|
||||
includeInlayFunctionLikeReturnTypeHints = true,
|
||||
includeInlayEnumMemberValueHints = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.lsp.enable("ts_ls")
|
||||
-- ts_ls
|
||||
vim.lsp.config('ts_ls', {
|
||||
settings = {
|
||||
typescript = {
|
||||
inlayHints = {
|
||||
includeInlayParameterNameHints = 'all',
|
||||
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
|
||||
includeInlayFunctionParameterTypeHints = true,
|
||||
includeInlayVariableTypeHints = true,
|
||||
includeInlayPropertyDeclarationTypeHints = true,
|
||||
includeInlayFunctionLikeReturnTypeHints = true,
|
||||
includeInlayEnumMemberValueHints = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.lsp.enable('ts_ls')
|
||||
|
||||
vim.lsp.enable("html")
|
||||
vim.lsp.enable("cssls")
|
||||
vim.lsp.config("tailwindcss", {
|
||||
filetypes = {
|
||||
"astro",
|
||||
"blade",
|
||||
"edge",
|
||||
"ejs",
|
||||
"erb",
|
||||
"gohtml",
|
||||
"gohtmltmpl",
|
||||
"handlebars",
|
||||
"hbs",
|
||||
"html",
|
||||
"jade",
|
||||
"leaf",
|
||||
"liquid",
|
||||
"markdown",
|
||||
"mdx",
|
||||
"mustache",
|
||||
"nunjucks",
|
||||
"php",
|
||||
"razor",
|
||||
"slim",
|
||||
"twig",
|
||||
"css",
|
||||
"less",
|
||||
"postcss",
|
||||
"sass",
|
||||
"scss",
|
||||
"stylus",
|
||||
"sugarss",
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"rescript",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
"vue",
|
||||
"svelte",
|
||||
"templ",
|
||||
},
|
||||
})
|
||||
vim.lsp.enable("tailwindcss")
|
||||
vim.lsp.enable('html')
|
||||
vim.lsp.enable('cssls')
|
||||
vim.lsp.config('tailwindcss', {
|
||||
filetypes = {
|
||||
'astro',
|
||||
'blade',
|
||||
'edge',
|
||||
'ejs',
|
||||
'erb',
|
||||
'gohtml',
|
||||
'gohtmltmpl',
|
||||
'handlebars',
|
||||
'hbs',
|
||||
'html',
|
||||
'jade',
|
||||
'leaf',
|
||||
'liquid',
|
||||
'markdown',
|
||||
'mdx',
|
||||
'mustache',
|
||||
'nunjucks',
|
||||
'php',
|
||||
'razor',
|
||||
'slim',
|
||||
'twig',
|
||||
'css',
|
||||
'less',
|
||||
'postcss',
|
||||
'sass',
|
||||
'scss',
|
||||
'stylus',
|
||||
'sugarss',
|
||||
'javascript',
|
||||
'javascriptreact',
|
||||
'rescript',
|
||||
'typescript',
|
||||
'typescriptreact',
|
||||
'vue',
|
||||
'svelte',
|
||||
'templ',
|
||||
},
|
||||
})
|
||||
vim.lsp.enable('tailwindcss')
|
||||
|
||||
-- rust
|
||||
vim.lsp.config("rust_analyzer", {
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
experimental = { enable = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.lsp.enable("rust_analyzer")
|
||||
-- rust
|
||||
vim.lsp.config('rust_analyzer', {
|
||||
settings = {
|
||||
['rust-analyzer'] = {
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
experimental = { enable = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.lsp.enable('rust_analyzer')
|
||||
|
||||
-- lua
|
||||
vim.lsp.config("lua_ls", {
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
disable = {
|
||||
"missing-fields",
|
||||
"undefined-global",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.lsp.enable("lua_ls")
|
||||
-- lua
|
||||
vim.lsp.config('lua_ls', {
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
disable = {
|
||||
'missing-fields',
|
||||
'undefined-global',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.lsp.enable('lua_ls')
|
||||
|
||||
-- python
|
||||
vim.lsp.config("basedpyright", {
|
||||
settings = {
|
||||
basedpyright = {
|
||||
inlayHints = true,
|
||||
analysis = {
|
||||
diagnosticSeverityOverrides = {
|
||||
reportUnusedImport = "none",
|
||||
reportUnusedVariable = "none",
|
||||
reportAttributeAccessIssue = "none",
|
||||
reportUnusedClass = "none",
|
||||
reportUnusedFunction = "none",
|
||||
reportDuplicateImport = "none",
|
||||
reportArgumentType = "error",
|
||||
},
|
||||
typeCheckingMode = "standard",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.lsp.enable("basedpyright")
|
||||
-- python
|
||||
vim.lsp.config('basedpyright', {
|
||||
settings = {
|
||||
basedpyright = {
|
||||
inlayHints = true,
|
||||
analysis = {
|
||||
diagnosticSeverityOverrides = {
|
||||
reportUnusedImport = 'none',
|
||||
reportUnusedVariable = 'none',
|
||||
reportAttributeAccessIssue = 'none',
|
||||
reportUnusedClass = 'none',
|
||||
reportUnusedFunction = 'none',
|
||||
reportDuplicateImport = 'none',
|
||||
reportArgumentType = 'error',
|
||||
},
|
||||
typeCheckingMode = 'standard',
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.lsp.enable('basedpyright')
|
||||
|
||||
-- bash
|
||||
vim.lsp.config("bashls", {
|
||||
settings = {
|
||||
bashIde = {
|
||||
shellcheckArguments = {
|
||||
"--exclude=SC1090,SC1091,SC2076,SC2164",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.lsp.enable("bashls")
|
||||
-- bash
|
||||
vim.lsp.config('bashls', {
|
||||
settings = {
|
||||
bashIde = {
|
||||
shellcheckArguments = {
|
||||
'--exclude=SC1090,SC1091,SC2076,SC2164',
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.lsp.enable('bashls')
|
||||
|
||||
-- cpp
|
||||
vim.lsp.config("clangd", {
|
||||
cmd = {
|
||||
"clangd",
|
||||
"--fallback-style=llvm",
|
||||
"--header-insertion=iwyu",
|
||||
"-j=4",
|
||||
},
|
||||
})
|
||||
vim.lsp.enable("clangd")
|
||||
-- cpp
|
||||
vim.lsp.config('clangd', {
|
||||
cmd = {
|
||||
'clangd',
|
||||
'--fallback-style=llvm',
|
||||
'--header-insertion=iwyu',
|
||||
'-j=4',
|
||||
},
|
||||
})
|
||||
vim.lsp.enable('clangd')
|
||||
end)
|
||||
Reference in new issue
Block a user