user/neovim: remove lsp.with
This commit is contained in:
parent
10fbeac140
commit
0edeac9f4c
1 changed files with 17 additions and 22 deletions
|
|
@ -108,18 +108,18 @@ require('lualine').setup {
|
||||||
-- many thanks to @kristijanhusak
|
-- many thanks to @kristijanhusak
|
||||||
-- https://github.com/nvim-treesitter/nvim-treesitter/issues/1167#issuecomment-920824125
|
-- https://github.com/nvim-treesitter/nvim-treesitter/issues/1167#issuecomment-920824125
|
||||||
function _G.javascript_indent()
|
function _G.javascript_indent()
|
||||||
local line = vim.fn.getline(vim.v.lnum)
|
local line = vim.fn.getline(vim.v.lnum)
|
||||||
local prev_line = vim.fn.getline(vim.v.lnum - 1)
|
local prev_line = vim.fn.getline(vim.v.lnum - 1)
|
||||||
if line:match('^%s*[%*/]%s*') then
|
if line:match('^%s*[%*/]%s*') then
|
||||||
if prev_line:match('^%s*%*%s*') then
|
if prev_line:match('^%s*%*%s*') then
|
||||||
return vim.fn.indent(vim.v.lnum - 1)
|
return vim.fn.indent(vim.v.lnum - 1)
|
||||||
|
end
|
||||||
|
if prev_line:match('^%s*/%*%*%s*$') then
|
||||||
|
return vim.fn.indent(vim.v.lnum - 1) + 1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
if prev_line:match('^%s*/%*%*%s*$') then
|
|
||||||
return vim.fn.indent(vim.v.lnum - 1) + 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return vim.fn['GetJavascriptIndent']()
|
return vim.fn['GetJavascriptIndent']()
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.cmd('au FileType javascript setlocal indentexpr=v:lua.javascript_indent()')
|
vim.cmd('au FileType javascript setlocal indentexpr=v:lua.javascript_indent()')
|
||||||
|
|
@ -157,18 +157,13 @@ vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
|
vim.diagnostic.config({
|
||||||
vim.lsp.diagnostic.on_publish_diagnostics, {
|
focusable = false,
|
||||||
focusable = false,
|
virtual_text = false,
|
||||||
virtual_text = false,
|
underline = true,
|
||||||
underline = true,
|
signs = true,
|
||||||
signs = true,
|
update_in_insert = true
|
||||||
update_in_insert = true
|
})
|
||||||
}
|
|
||||||
)
|
|
||||||
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(
|
|
||||||
vim.lsp.handlers.signature_help, { focusable = false }
|
|
||||||
)
|
|
||||||
|
|
||||||
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue