mirror of
https://github.com/ksyasuda/dotfiles.git
synced 2025-12-05 02:53:38 -08:00
update nvim config
This commit is contained in:
@@ -158,7 +158,8 @@ local lsp_mappings = {
|
|||||||
{ mode = "n", key = "gDf", cmd = ":Telescope lsp_definitions<CR>", group = "LSP Definitions" },
|
{ mode = "n", key = "gDf", cmd = ":Telescope lsp_definitions<CR>", group = "LSP Definitions" },
|
||||||
{ mode = "n", key = "gF", cmd = ":edit <cfile><CR>", group = "Edit File" },
|
{ mode = "n", key = "gF", cmd = ":edit <cfile><CR>", group = "Edit File" },
|
||||||
{ mode = "n", key = "gT", cmd = ":Telescope lsp_type_definitions<CR>", group = "LSP Type Definitions" },
|
{ mode = "n", key = "gT", cmd = ":Telescope lsp_type_definitions<CR>", group = "LSP Type Definitions" },
|
||||||
{ mode = "n", key = "gb", cmd = ":Gitsigns blame_line<CR>", group = "Git Blame" },
|
{ mode = "n", key = "gb", cmd = ":Gitsigns blame_line<CR>", group = "Blame Line" },
|
||||||
|
{ mode = "n", key = "<leader>gb", cmd = ":Gitsigns blame<CR>", group = "Git Blame" },
|
||||||
{ mode = "n", key = "gi", cmd = ":Telescope lsp_implementations<CR>", group = "Telescope Implementations" },
|
{ mode = "n", key = "gi", cmd = ":Telescope lsp_implementations<CR>", group = "Telescope Implementations" },
|
||||||
{ mode = "n", key = "gj", cmd = ":Telescope jumplist<CR>", group = "Telescope Jumplist" },
|
{ mode = "n", key = "gj", cmd = ":Telescope jumplist<CR>", group = "Telescope Jumplist" },
|
||||||
{ mode = "n", key = "gr", cmd = ":Telescope lsp_references<CR>", goup = "LSP References" },
|
{ mode = "n", key = "gr", cmd = ":Telescope lsp_references<CR>", goup = "LSP References" },
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ return {
|
|||||||
current_line_blame_opts = {
|
current_line_blame_opts = {
|
||||||
virt_text = true,
|
virt_text = true,
|
||||||
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
|
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
|
||||||
delay = 1000,
|
delay = 500,
|
||||||
ignore_whitespace = false,
|
ignore_whitespace = false,
|
||||||
virt_text_priority = 100,
|
virt_text_priority = 100,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ return {
|
|||||||
-- Depending on the usage, you might want to add additional paths here.
|
-- Depending on the usage, you might want to add additional paths here.
|
||||||
-- "${3rd}/luv/library",
|
-- "${3rd}/luv/library",
|
||||||
-- "${3rd}/busted/library",
|
-- "${3rd}/busted/library",
|
||||||
|
"/usr/lib/lua-language-server/meta/3rd/busted/library",
|
||||||
},
|
},
|
||||||
-- or pull in all of 'runtimepath'. NOTE: this is a lot slower and will cause issues when working on your own configuration (see https://github.com/neovim/nvim-lspconfig/issues/3189)
|
-- or pull in all of 'runtimepath'. NOTE: this is a lot slower and will cause issues when working on your own configuration (see https://github.com/neovim/nvim-lspconfig/issues/3189)
|
||||||
-- library = vim.api.nvim_get_runtime_file("", true)
|
-- library = vim.api.nvim_get_runtime_file("", true)
|
||||||
@@ -74,6 +75,11 @@ return {
|
|||||||
Lua = {},
|
Lua = {},
|
||||||
},
|
},
|
||||||
handlers = {},
|
handlers = {},
|
||||||
|
root_dir = function(bufnr, on_dir)
|
||||||
|
if not vim.fn.bufname(bufnr):match("%.txt$") then
|
||||||
|
on_dir(vim.fn.getcwd())
|
||||||
|
end
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
vim.lsp.enable(lsp)
|
vim.lsp.enable(lsp)
|
||||||
elseif lsp == "basedpyright" then
|
elseif lsp == "basedpyright" then
|
||||||
|
|||||||
@@ -20,6 +20,20 @@ return {
|
|||||||
"-e",
|
"-e",
|
||||||
"2250",
|
"2250",
|
||||||
}
|
}
|
||||||
|
-- Save original function
|
||||||
|
local orig_try_lint = lint.try_lint
|
||||||
|
|
||||||
|
lint.try_lint = function(...)
|
||||||
|
local bufnr = vim.api.nvim_get_current_buf()
|
||||||
|
local buftype = vim.api.nvim_get_option_value("buftype", { buf = bufnr })
|
||||||
|
|
||||||
|
-- Skip linting for non-file buffers (like hover docs)
|
||||||
|
if buftype ~= "" then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
return orig_try_lint(...)
|
||||||
|
end
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||||
callback = function()
|
callback = function()
|
||||||
|
|||||||
Reference in New Issue
Block a user