improved lsp

This commit is contained in:
MasterGordon 2022-10-29 14:11:30 +02:00
parent 81c09df8b7
commit eb5ab2da9b
6 changed files with 33 additions and 13 deletions

View File

@ -140,7 +140,8 @@ return require("packer").startup(
"hrsh7th/cmp-path",
"hrsh7th/cmp-nvim-lua",
"hrsh7th/cmp-emoji",
"David-Kunz/cmp-npm"
"David-Kunz/cmp-npm",
"hrsh7th/cmp-nvim-lsp-signature-help"
}
}
use {

View File

@ -115,7 +115,8 @@ options = {
-- {name = "buffer"},
{name = "emoji"},
{name = "copilot", group_index = 2},
{name = "npm", keyword_length = 4}
{name = "npm", keyword_length = 4},
{name = "nvim_lsp_signature_help"}
}
}

View File

@ -1,5 +1,11 @@
-- dapui
require("dapui").setup()
require("dapui").setup(
{
controls = {
enabled = false
}
}
)
local dap, dapui = require("dap"), require("dapui")
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open()

View File

@ -54,6 +54,15 @@ require("formatter").setup(
stdin = false
}
end
},
cs = {
function()
return {
exe = "dotnet",
args = {"csharpier", "--write-stdout"},
stdin = true
}
end
}
}
}
@ -63,17 +72,17 @@ vim.api.nvim_exec(
[[
augroup FormatAutogroup
autocmd!
autocmd BufWritePost *.h,*.cpp,*.rs,*.lua,*.tsx,*.ts,*.js,*.jsx,*.json FormatWrite
autocmd BufWritePost *.h,*.cpp,*.rs,*.lua,*.tsx,*.ts,*.js,*.jsx,*.json,*.cs FormatWrite
augroup END
]],
true
)
local formatGrp = vim.api.nvim_create_augroup("Format", {clear = true})
vim.api.nvim_create_autocmd(
"BufWritePre",
{
pattern = "*.cs",
command = "lua vim.lsp.buf.format { async = false }",
group = formatGrp
}
)
-- local formatGrp = vim.api.nvim_create_augroup("Format", {clear = true})
-- vim.api.nvim_create_autocmd(
-- "BufWritePre",
-- {
-- pattern = "*.cs",
-- command = "lua vim.lsp.buf.format { async = false }",
-- group = formatGrp
-- }
-- )

View File

@ -707,6 +707,7 @@ local TabPages = {
local TabLine = {TabLineOffset, BufferLine, TabPages}
require "heirline".setup(StatusLines, WinBars, TabLine)
vim.o.showtabline = 2
vim.cmd([[au FileType * if index(['wipe', 'delete', 'unload'], &bufhidden) >= 0 | set nobuflisted | endif]])

View File

@ -4,6 +4,8 @@ vim.fn.sign_define("DiagnosticSignError", {text = " ", texthl = "DiagnosticSi
vim.fn.sign_define("DiagnosticSignWarn", {text = "", texthl = "DiagnosticSignWarn"})
vim.fn.sign_define("DiagnosticSignInfo", {text = "", texthl = "DiagnosticSignInfo"})
vim.fn.sign_define("DiagnosticSignHint", {text = "", texthl = "DiagnosticSignHint"})
vim.fn.sign_define("DapBreakpoint", {text = "", texthl = "DiagnosticSignError"})
vim.fn.sign_define("DapStopped", {text = "", texthl = "DiagnosticSignInfo"})
--- Completion Icons
require("lspkind").init({})