haskell lsp config remove reduce, and clean todo-comments
This commit is contained in:
parent
dc36449701
commit
df40f2fdbc
3 changed files with 39 additions and 43 deletions
|
@ -30,7 +30,11 @@ autocmd('TextYankPost', {
|
||||||
autocmd({ "BufWritePre" }, {
|
autocmd({ "BufWritePre" }, {
|
||||||
group = TsousaGroup,
|
group = TsousaGroup,
|
||||||
pattern = "*",
|
pattern = "*",
|
||||||
command = [[%s/\s\+$//e]],
|
callback = function ()
|
||||||
|
local cursor_pos = vim.fn.getpos('.')
|
||||||
|
vim.cmd([[%s/\s\+$//e]])
|
||||||
|
vim.fn.setpos('.', cursor_pos)
|
||||||
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
autocmd("LspAttach", {
|
autocmd("LspAttach", {
|
||||||
|
|
|
@ -29,11 +29,6 @@ return {
|
||||||
|
|
||||||
require("luasnip.loaders.from_vscode").lazy_load()
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
|
|
||||||
local check_backspace = function()
|
|
||||||
local col = vim.fn.col "." - 1
|
|
||||||
return col == 0 or vim.fn.getline("."):sub(col, col):match "%s"
|
|
||||||
end
|
|
||||||
|
|
||||||
cmp.setup {
|
cmp.setup {
|
||||||
snippet = {
|
snippet = {
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
|
@ -54,20 +49,14 @@ return {
|
||||||
),
|
),
|
||||||
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
|
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
|
||||||
|
|
||||||
["<C-k>"] = cmp.mapping(function(fallback)
|
["<C-l>"] = cmp.mapping(function()
|
||||||
if luasnip.expand_or_jumpable() then
|
if luasnip.expand_or_jumpable() then
|
||||||
luasnip.expand_or_jump()
|
luasnip.expand_or_jump()
|
||||||
elseif check_backspace() then
|
|
||||||
fallback()
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
end
|
||||||
end),
|
end),
|
||||||
["<C-j>"] = cmp.mapping(function(fallback)
|
["<C-h>"] = cmp.mapping(function()
|
||||||
if luasnip.jumpable(-1) then
|
if luasnip.jumpable(-1) then
|
||||||
luasnip.jump(-1)
|
luasnip.jump(-1)
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
),
|
),
|
||||||
|
@ -210,6 +199,24 @@ return {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
|
group = vim.api.nvim_create_augroup("TsousaLspConfig", {}),
|
||||||
|
callback = function(e)
|
||||||
|
local bufopts = { buffer = e.buf }
|
||||||
|
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
|
||||||
|
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
|
||||||
|
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
|
||||||
|
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
||||||
|
vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, bufopts)
|
||||||
|
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, bufopts)
|
||||||
|
vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, bufopts)
|
||||||
|
vim.keymap.set('n', '<leader>wss', vim.lsp.buf.workspace_symbol, bufopts)
|
||||||
|
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||||
|
vim.keymap.set('n', '<leader>fo', function() vim.lsp.buf.format { async = true } end, bufopts)
|
||||||
|
vim.keymap.set('i', '<C-s>', vim.lsp.buf.signature_help, bufopts)
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
mason_lspconfig.setup({
|
mason_lspconfig.setup({
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
lua_ls,
|
lua_ls,
|
||||||
|
@ -224,11 +231,24 @@ return {
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
-- add here other custom overrides
|
-- add here other custom overrides
|
||||||
|
["hls"] = function()
|
||||||
|
lspconfig.hls.setup({
|
||||||
|
settings = {
|
||||||
|
haskell = {
|
||||||
|
plugin = {
|
||||||
|
stan = { globalOn = false },
|
||||||
|
hlint = { config = { flags = { "--ignore=Eta reduce" } } }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end,
|
||||||
["lua_ls"] = function()
|
["lua_ls"] = function()
|
||||||
lspconfig.lua_ls.setup({
|
lspconfig.lua_ls.setup({
|
||||||
settings = {
|
settings = {
|
||||||
Lua = {
|
Lua = {
|
||||||
diagnostics = { globals = { "vim" } }
|
diagnostics = { globals = { "vim" } },
|
||||||
|
telemetry = { enable = false }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -20,10 +20,6 @@ return {
|
||||||
NOTE = { icon = " ", color = "hint", alt = { "INFO", "info", "note" } },
|
NOTE = { icon = " ", color = "hint", alt = { "INFO", "info", "note" } },
|
||||||
TEST = { icon = "⏲ ", color = "test", alt = { "TESTING", "PASSED", "FAILED", "test" } },
|
TEST = { icon = "⏲ ", color = "test", alt = { "TESTING", "PASSED", "FAILED", "test" } },
|
||||||
},
|
},
|
||||||
gui_style = {
|
|
||||||
fg = "NONE", -- The gui style to use for the fg highlight group.
|
|
||||||
bg = "BOLD", -- The gui style to use for the bg highlight group.
|
|
||||||
},
|
|
||||||
merge_keywords = true, -- when true, custom keywords will be merged with the defaults
|
merge_keywords = true, -- when true, custom keywords will be merged with the defaults
|
||||||
-- highlighting of the line containing the todo comment
|
-- highlighting of the line containing the todo comment
|
||||||
-- * before: highlights before the keyword (typically comment characters)
|
-- * before: highlights before the keyword (typically comment characters)
|
||||||
|
@ -41,30 +37,6 @@ return {
|
||||||
max_line_len = 400, -- ignore lines longer than this
|
max_line_len = 400, -- ignore lines longer than this
|
||||||
exclude = {}, -- list of file types to exclude highlighting
|
exclude = {}, -- list of file types to exclude highlighting
|
||||||
},
|
},
|
||||||
-- list of named colors where we try to extract the guifg from the
|
|
||||||
-- list of highlight groups or use the hex color if hl not found as a fallback
|
|
||||||
colors = {
|
|
||||||
error = { "DiagnosticError", "ErrorMsg", "#DC2626" },
|
|
||||||
warning = { "DiagnosticWarn", "WarningMsg", "#FBBF24" },
|
|
||||||
info = { "DiagnosticInfo", "#2563EB" },
|
|
||||||
hint = { "DiagnosticHint", "#10B981" },
|
|
||||||
default = { "Identifier", "#7C3AED" },
|
|
||||||
test = { "Identifier", "#FF00FF" }
|
|
||||||
},
|
|
||||||
search = {
|
|
||||||
command = "rg",
|
|
||||||
args = {
|
|
||||||
"--color=never",
|
|
||||||
"--no-heading",
|
|
||||||
"--with-filename",
|
|
||||||
"--line-number",
|
|
||||||
"--column",
|
|
||||||
},
|
|
||||||
-- regex that will be used to match keywords.
|
|
||||||
-- don't replace the (KEYWORDS) placeholder
|
|
||||||
pattern = [[\b(KEYWORDS):]], -- ripgrep regex
|
|
||||||
-- pattern = [[\b(KEYWORDS)\b]], -- match without the extra colon. You'll likely get false positives
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue