diagnostic
This commit is contained in:
parent
656898074e
commit
5b44802b68
@ -240,10 +240,6 @@ vim.keymap.set({ "n", "v" }, "<C-Down>", "j", { noremap = true, silent = true })
|
|||||||
vim.keymap.set({ "n", "v" }, "<C-Left>", "h", { noremap = true, silent = true })
|
vim.keymap.set({ "n", "v" }, "<C-Left>", "h", { noremap = true, silent = true })
|
||||||
vim.keymap.set({ "n", "v" }, "<C-Right>", "l", { noremap = true, silent = true })
|
vim.keymap.set({ "n", "v" }, "<C-Right>", "l", { noremap = true, silent = true })
|
||||||
|
|
||||||
-- ctrl-n p to navigate lsp suggestions, next and previous
|
|
||||||
vim.keymap.set("i", "<C-n>", "<cmd>lua cmp.mapping.select_next_item()<CR>", { noremap = true, silent = true })
|
|
||||||
vim.keymap.set("i", "<C-p>", "<cmd>lua cmp.mapping.select_previous_item()<CR>", { noremap = true, silent = true })
|
|
||||||
|
|
||||||
-- map leader u v c to CsvViewEnable display_mode=border with description `CSV View (commas)`
|
-- map leader u v c to CsvViewEnable display_mode=border with description `CSV View (commas)`
|
||||||
vim.keymap.set("n", "<leader>uvc", "<cmd>CsvViewEnable display_mode=border<CR>", { desc = "CSV View (commas)" })
|
vim.keymap.set("n", "<leader>uvc", "<cmd>CsvViewEnable display_mode=border<CR>", { desc = "CSV View (commas)" })
|
||||||
-- map leader u v t to CsvViewEnable delimiter=\t display_mode=border with description `CSV View (tabs)`
|
-- map leader u v t to CsvViewEnable delimiter=\t display_mode=border with description `CSV View (tabs)`
|
||||||
|
|||||||
@ -5,5 +5,6 @@
|
|||||||
vim.opt.laststatus = 3
|
vim.opt.laststatus = 3
|
||||||
vim.g.maplocalleader = ","
|
vim.g.maplocalleader = ","
|
||||||
vim.diagnostic.config({ virtual_text = true })
|
vim.diagnostic.config({ virtual_text = true })
|
||||||
|
vim.opt.completeopt = { "menuone", "noselect", "popup" }
|
||||||
|
|
||||||
vim.opt.scrolloff = 20
|
vim.opt.scrolloff = 20
|
||||||
|
|||||||
@ -5,15 +5,10 @@ return {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"saghen/blink.cmp",
|
"saghen/blink.cmp",
|
||||||
dependencies = { "fang2hou/blink-copilot" },
|
enabled = false,
|
||||||
opts = {
|
|
||||||
sources = {
|
|
||||||
providers = {
|
|
||||||
copilot = {
|
|
||||||
module = "blink-copilot",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fang2hou/blink-copilot",
|
||||||
|
enabled = false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,16 +64,15 @@ if vim.uv.fs_stat(pair_ls_config) then
|
|||||||
dofile(pair_ls_config)
|
dofile(pair_ls_config)
|
||||||
end
|
end
|
||||||
|
|
||||||
---------------------
|
|
||||||
vim.api.nvim_create_autocmd("LspAttach", {
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
group = vim.api.nvim_create_augroup("my.lsp", {}),
|
group = vim.api.nvim_create_augroup("my.lsp", {}),
|
||||||
|
|
||||||
callback = function(args)
|
callback = function(args)
|
||||||
local opts = { remap = false }
|
|
||||||
local client = assert(vim.lsp.get_client_by_id(args.data.client_id))
|
local client = assert(vim.lsp.get_client_by_id(args.data.client_id))
|
||||||
local builtin = require("telescope.builtin")
|
|
||||||
|
|
||||||
-- along with your other config
|
if client:supports_method("textDocument/completion") then
|
||||||
|
vim.lsp.completion.enable(true, client.id, args.buf, { autotrigger = true })
|
||||||
|
end
|
||||||
|
|
||||||
if client:supports_method("textDocument/formatting") then
|
if client:supports_method("textDocument/formatting") then
|
||||||
-- the most important part
|
-- the most important part
|
||||||
@ -110,11 +109,17 @@ end
|
|||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
pattern = "elixir",
|
pattern = "elixir",
|
||||||
callback = function(args)
|
callback = function(args)
|
||||||
|
local root = vim.fs.root(args.buf, { "mix.exs", ".git" })
|
||||||
|
if not root then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
vim.lsp.start({
|
vim.lsp.start({
|
||||||
name = "exofx-lsp",
|
name = "exofx-lsp",
|
||||||
cmd_env = { MIX_ENV = "test" },
|
cmd_env = { MIX_ENV = "test" },
|
||||||
cmd = { "mix", "exofx.lsp" },
|
cmd = { "mix", "exofx.lsp" },
|
||||||
root_dir = vim.fs.root(args.buf, { "mix.exs", ".git" }),
|
root_dir = root,
|
||||||
|
cmd_cwd = root,
|
||||||
-- capabilities = vim.lsp.protocol.make_client_capabilities(),
|
-- capabilities = vim.lsp.protocol.make_client_capabilities(),
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
@ -179,10 +184,13 @@ vim.api.nvim_create_autocmd({ "LspAttach", "BufEnter" }, {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
vim.keymap.set("i", "<M-Space>", function()
|
vim.keymap.set("i", "<M-Space>", function()
|
||||||
local cmp = require("blink.cmp")
|
if vim.fn.pumvisible() == 1 then
|
||||||
cmp.reload()
|
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<C-e>", true, false, true), "n", false)
|
||||||
cmp.show()
|
end
|
||||||
print("asd")
|
|
||||||
|
vim.schedule(function()
|
||||||
|
vim.lsp.completion.get()
|
||||||
|
end)
|
||||||
end, { desc = "Force LSP completion" })
|
end, { desc = "Force LSP completion" })
|
||||||
-- vim.api.nvim_create_autocmd("FileType", {
|
-- vim.api.nvim_create_autocmd("FileType", {
|
||||||
-- pattern = "elixir",
|
-- pattern = "elixir",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user