Commit e1fc3d3a authored by Tim van Deurzen's avatar Tim van Deurzen

Update neovim config.

parent 2a418040
...@@ -19,6 +19,10 @@ lsp_config.rust_analyzer.setup{ ...@@ -19,6 +19,10 @@ lsp_config.rust_analyzer.setup{
capabilities = capabilities, capabilities = capabilities,
} }
lsp_config.angularls.setup{
capabilities = capabilities,
}
lsp_config.yamlls.setup{ lsp_config.yamlls.setup{
capabilities = capabilities, capabilities = capabilities,
} }
...@@ -59,34 +63,61 @@ lsp_config.sumneko_lua.setup{ ...@@ -59,34 +63,61 @@ lsp_config.sumneko_lua.setup{
}, },
} }
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics, { local eslint = {
underline = true, lintCommand = "eslint_d -f unix --stdin --stdin-filename ${INPUT}",
virtual_text = { lintStdin = true,
prefix = " » ", lintFormats = {"%f:%l:%c: %m"},
spacing = 8, lintIgnoreExitCode = true,
severity_limit = "Error", formatCommand = "eslint_d --fix-to-stdout --stdin --stdin-filename=${INPUT}",
}, formatStdin = true
signs = true, }
update_in_insert = true,
lsp_config.efm.setup {
init_options = {documentFormatting = true},
filetypes = {"javascript", "typescript"},
root_dir = function(fname)
return lsp_config.util.root_pattern("tsconfig.json")(fname) or
lsp_config.util.root_pattern(".eslintrc.js", ".git")(fname);
end,
settings = {
rootMarkers = {".eslintrc.js", ".git/"},
languages = {
javascript = {eslint},
typescript = {eslint}
}
} }
}
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics, {
underline = true,
virtual_text = {
prefix = " » ",
spacing = 8,
severity_limit = "Error",
},
signs = true,
update_in_insert = true,
}
) )
do do
local default_handler = vim.lsp.handlers["textdocument/publishdiagnostics"] local default_handler = vim.lsp.handlers["textdocument/publishdiagnostics"]
vim.lsp.handlers["textdocument/publishdiagnostics"] = function(err, method, result, client_id, bufnr, config) vim.lsp.handlers["textdocument/publishdiagnostics"] = function(err, method, result, client_id, bufnr, config)
default_handler(err, method, result, client_id, bufnr, config) default_handler(err, method, result, client_id, bufnr, config)
local diagnostics = vim.lsp.diagnostic.get_all() local diagnostics = vim.lsp.diagnostic.get_all()
local qflist = {} local qflist = {}
for bufnr_, diagnostic in pairs(diagnostics) do for bufnr_, diagnostic in pairs(diagnostics) do
for _, d in ipairs(diagnostic) do for _, d in ipairs(diagnostic) do
d.bufnr = bufnr_ d.bufnr = bufnr_
d.lnum = d.range.start.line + 1 d.lnum = d.range.start.line + 1
d.col = d.range.start.character + 1 d.col = d.range.start.character + 1
d.text = d.message d.text = d.message
table.insert(qflist, d) table.insert(qflist, d)
end end
end
vim.lsp.util.set_qflist(qflist)
end end
vim.lsp.util.set_qflist(qflist)
end
end end
...@@ -204,10 +204,24 @@ return require('packer').startup(function() ...@@ -204,10 +204,24 @@ return require('packer').startup(function()
config = function() config = function()
require('lsp_signature').on_attach({ require('lsp_signature').on_attach({
bind = true, bind = true, -- This is mandatory, otherwise border config won't get registered.
-- If you want to hook lspsaga or other signature handler, pls set to false
doc_lines = 2, -- will show two lines of comment/doc(if there are more than two lines in doc, will be truncated);
-- set to 0 if you do not want any API comments be shown
-- This setting only take effect in insert mode, it does not affect signature help in normal
-- mode
hint_enable = true, -- virtual hint enable
hint_prefix = "🐼 ", -- Panda for parameter
hint_scheme = "String",
use_lspsaga = false, -- set to true if you want to use lspsaga popup
handler_opts = { handler_opts = {
border = "single" border = "shadow" -- double, single, shadow, none
} },
decorator = {"`", "`"} -- decoractor can be `decorator = {"***", "***"}` `decorator = {"**", "**"}` `decorator = {"**_", "_**"}`
-- `decorator = {"*", "*"} see markdown help for more details
-- <u></u> ~ ~ does not supported by nvim
}) })
end end
} }
...@@ -221,4 +235,6 @@ return require('packer').startup(function() ...@@ -221,4 +235,6 @@ return require('packer').startup(function()
require('gitsigns').setup() require('gitsigns').setup()
end end
} }
use 'tomlion/vim-solidity'
end) end)
...@@ -18,8 +18,8 @@ ts_configs.setup { ...@@ -18,8 +18,8 @@ ts_configs.setup {
}, },
refactor = { refactor = {
smart_rename = {enable = true, keymaps = {smart_rename = "grr"}}, smart_rename = {enable = true, keymaps = {smart_rename = "grr"}},
highlight_definitions = {enable = true} highlight_definitions = {enable = true},
-- highlight_current_scope = { enable = true } highlight_current_scope = { enable = false }
}, },
textobjects = { textobjects = {
select = { select = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment