fix issue with lazygit
This commit is contained in:
commit
ff42b77215
|
|
@ -23,7 +23,8 @@ If you are experiencing issues, please make sure you have the latest versions.
|
||||||
|
|
||||||
External Requirements:
|
External Requirements:
|
||||||
- Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`)
|
- Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`)
|
||||||
- [ripgrep](https://github.com/BurntSushi/ripgrep#installation)
|
- [ripgrep](https://github.com/BurntSushi/ripgrep#installation),
|
||||||
|
[fd-find](https://github.com/sharkdp/fd#installation)
|
||||||
- Clipboard tool (xclip/xsel/win32yank or other depending on the platform)
|
- Clipboard tool (xclip/xsel/win32yank or other depending on the platform)
|
||||||
- A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons
|
- A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons
|
||||||
- if you have it set `vim.g.have_nerd_font` in `init.lua` to true
|
- if you have it set `vim.g.have_nerd_font` in `init.lua` to true
|
||||||
|
|
|
||||||
|
|
@ -9,26 +9,31 @@ return {
|
||||||
|
|
||||||
require('bufferline').setup {
|
require('bufferline').setup {
|
||||||
options = {
|
options = {
|
||||||
mode = 'buffers', -- set to "tabs" to only show tabpages instead
|
mode = 'buffers', -- 'buffers', -- set to "tabs" to only show tabpages instead
|
||||||
themable = true, -- allows highlight groups to be overriden i.e. sets highlights as default
|
|
||||||
numbers = 'none', -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string,
|
themable = true, -- allows highlight groups to be overriden i.e. sets highlights as default
|
||||||
close_command = 'Bdelete! %d', -- can be a string | function, see "Mouse actions"
|
numbers = 'none', -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string,
|
||||||
|
close_command = 'Bdelete! %d', -- can be a string | function, see "Mouse actions"
|
||||||
right_mouse_command = 'Bdelete! %d', -- can be a string | function, see "Mouse actions"
|
right_mouse_command = 'Bdelete! %d', -- can be a string | function, see "Mouse actions"
|
||||||
left_mouse_command = 'buffer %d', -- can be a string | function, see "Mouse actions"
|
left_mouse_command = 'buffer %d', -- can be a string | function, see "Mouse actions"
|
||||||
middle_mouse_command = nil, -- can be a string | function, see "Mouse actions"
|
middle_mouse_command = nil, -- can be a string | function, see "Mouse actions"
|
||||||
-- buffer_close_icon = '',
|
-- buffer_close_icon = '',
|
||||||
buffer_close_icon = '✗',
|
buffer_close_icon = '✗',
|
||||||
-- buffer_close_icon = '✕',
|
-- buffer_close_icon = '✕',
|
||||||
close_icon = '',
|
close_icon = '',
|
||||||
path_components = 1, -- Show only the file name without the directory
|
path_components = 1, -- Show only the file name without the directory
|
||||||
modified_icon = '●',
|
modified_icon = '●',
|
||||||
left_trunc_marker = '',
|
left_trunc_marker = '',
|
||||||
right_trunc_marker = '',
|
right_trunc_marker = '',
|
||||||
max_name_length = 30,
|
max_name_length = 30,
|
||||||
max_prefix_length = 30, -- prefix used when a buffer is de-duplicated
|
max_prefix_length = 30, -- prefix used when a buffer is de-duplicated
|
||||||
tab_size = 21,
|
tab_size = 21,
|
||||||
diagnostics = false,
|
diagnostics = "nvim_lsp",
|
||||||
diagnostics_update_in_insert = false,
|
diagnostics_update_in_insert = false,
|
||||||
|
diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
||||||
|
local icon = level:match("error") and " " or " "
|
||||||
|
return " " .. icon .. count
|
||||||
|
end,
|
||||||
color_icons = true,
|
color_icons = true,
|
||||||
show_buffer_icons = true,
|
show_buffer_icons = true,
|
||||||
show_buffer_close_icons = true,
|
show_buffer_close_icons = true,
|
||||||
|
|
@ -61,6 +66,51 @@ return {
|
||||||
-- background = {},
|
-- background = {},
|
||||||
-- indicator_selected = {},
|
-- indicator_selected = {},
|
||||||
-- fill = {},
|
-- fill = {},
|
||||||
|
--
|
||||||
|
|
||||||
|
-- Error highlighting (pink theme)
|
||||||
|
error = {
|
||||||
|
fg = '#ff69b4', -- Hot pink
|
||||||
|
bg = '#2d2d2d',
|
||||||
|
},
|
||||||
|
error_selected = {
|
||||||
|
fg = '#ff1493', -- Deep pink for active tab
|
||||||
|
bg = '#3d3d3d',
|
||||||
|
bold = true,
|
||||||
|
},
|
||||||
|
error_visible = {
|
||||||
|
fg = '#ff69b4',
|
||||||
|
bg = '#2d2d2d',
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Warning highlighting (optional)
|
||||||
|
warning = {
|
||||||
|
fg = '#ffb86c',
|
||||||
|
bg = '#2d2d2d',
|
||||||
|
},
|
||||||
|
warning_selected = {
|
||||||
|
fg = '#ff8c00',
|
||||||
|
bg = '#3d3d3d',
|
||||||
|
bold = true,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Normal tab highlighting
|
||||||
|
tab = {
|
||||||
|
fg = '#6272a4',
|
||||||
|
bg = '#282a36',
|
||||||
|
},
|
||||||
|
tab_selected = {
|
||||||
|
fg = '#f8f8f2',
|
||||||
|
bg = '#44475a',
|
||||||
|
bold = true,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Background
|
||||||
|
fill = {
|
||||||
|
bg = '#282a36',
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ function M.get()
|
||||||
{ 'gI', vim.lsp.buf.implementation, desc = 'Go to Implementation' },
|
{ 'gI', vim.lsp.buf.implementation, desc = 'Go to Implementation' },
|
||||||
{ 'gy', vim.lsp.buf.type_definition, desc = 'Go to Type Definition' },
|
{ 'gy', vim.lsp.buf.type_definition, desc = 'Go to Type Definition' },
|
||||||
{ 'gD', vim.lsp.buf.declaration, desc = 'Go to Declaration' },
|
{ 'gD', vim.lsp.buf.declaration, desc = 'Go to Declaration' },
|
||||||
{ 'K', vim.lsp.buf.hover, desc = 'Hover' },
|
|
||||||
{ 'gK', vim.lsp.buf.signature_help, desc = 'Signature Help' },
|
{ 'gK', vim.lsp.buf.signature_help, desc = 'Signature Help' },
|
||||||
{ '<C-k>', vim.lsp.buf.signature_help, mode = 'i', desc = 'Signature Help' },
|
{ '<C-k>', vim.lsp.buf.signature_help, mode = 'i', desc = 'Signature Help' },
|
||||||
{ '<leader>ca', vim.lsp.buf.code_action, desc = 'Code Action', mode = { 'n', 'v' } },
|
{ '<leader>ca', vim.lsp.buf.code_action, desc = 'Code Action', mode = { 'n', 'v' } },
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@ return {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
config = function()
|
config = function()
|
||||||
vim.api.nvim_create_autocmd('LspAttach', {
|
vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
group = vim.api.nvim_create_augroup('lsp-attach', { clear = true }),
|
group = vim.api.nvim_create_augroup('lsp-attach', { clear = true }),
|
||||||
|
|
@ -36,10 +35,8 @@ return {
|
||||||
local map = function(keys, func, desc)
|
local map = function(keys, func, desc)
|
||||||
vim.keymap.set('n', keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
|
vim.keymap.set('n', keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
|
||||||
end
|
end
|
||||||
|
|
||||||
local telescope_ok, telescope = pcall(require, 'telescope.builtin')
|
local telescope_ok, telescope = pcall(require, 'telescope.builtin')
|
||||||
if not telescope_ok then return end
|
if not telescope_ok then return end
|
||||||
|
|
||||||
map('gd', telescope.lsp_definitions, 'Go to Definition')
|
map('gd', telescope.lsp_definitions, 'Go to Definition')
|
||||||
map('gr', telescope.lsp_references, 'Go to References')
|
map('gr', telescope.lsp_references, 'Go to References')
|
||||||
map('gI', telescope.lsp_implementations, 'Go to Implementation')
|
map('gI', telescope.lsp_implementations, 'Go to Implementation')
|
||||||
|
|
@ -49,16 +46,12 @@ return {
|
||||||
map('<leader>rn', vim.lsp.buf.rename, 'Rename')
|
map('<leader>rn', vim.lsp.buf.rename, 'Rename')
|
||||||
map('<leader>ca', vim.lsp.buf.code_action, 'Code Action')
|
map('<leader>ca', vim.lsp.buf.code_action, 'Code Action')
|
||||||
map('gD', vim.lsp.buf.declaration, 'Go to Declaration')
|
map('gD', vim.lsp.buf.declaration, 'Go to Declaration')
|
||||||
|
map('K', function()
|
||||||
map('<S-K>', function()
|
|
||||||
local lspsaga_hover_ok, lspsaga_hover = pcall(require, 'lspsaga.hover')
|
local lspsaga_hover_ok, lspsaga_hover = pcall(require, 'lspsaga.hover')
|
||||||
if lspsaga_hover_ok then
|
if lspsaga_hover_ok then
|
||||||
lspsaga_hover:render_hover_doc()
|
lspsaga_hover:render_hover_doc()
|
||||||
else
|
|
||||||
vim.lsp.buf.hover()
|
|
||||||
end
|
end
|
||||||
end, 'Show Hover')
|
end, 'Show Hover')
|
||||||
|
|
||||||
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
||||||
if client and client.server_capabilities.documentHighlightProvider then
|
if client and client.server_capabilities.documentHighlightProvider then
|
||||||
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
|
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
|
||||||
|
|
@ -91,9 +84,16 @@ return {
|
||||||
},
|
},
|
||||||
filetypes = { 'go', 'templ' },
|
filetypes = { 'go', 'templ' },
|
||||||
},
|
},
|
||||||
-- tsserver = { settings = { completions = { completeFunctionCalls = true }, }, filetypes = { 'typescript', 'typescriptreact', 'typescript.tsx', 'javascript' }, root_dir = require('lspconfig.util').root_pattern('package.json', 'tsconfig.json', '.git'), },
|
astro = {
|
||||||
|
filetypes = { "astro" },
|
||||||
|
init_options = {
|
||||||
|
typescript = {
|
||||||
|
tsdk = vim.fn.stdpath("data") .. "/mason/packages/typescript-language-server/node_modules/typescript/lib",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
eslint = {},
|
eslint = {},
|
||||||
html = { filetypes = { 'html', 'twig', 'hbs' } }, -- Removed 'templ' from here
|
html = { filetypes = { 'html', 'twig', 'hbs' } },
|
||||||
templ = {
|
templ = {
|
||||||
cmd = { vim.fn.stdpath("data") .. "/mason/bin/templ", "lsp" },
|
cmd = { vim.fn.stdpath("data") .. "/mason/bin/templ", "lsp" },
|
||||||
filetypes = { "templ" },
|
filetypes = { "templ" },
|
||||||
|
|
@ -133,37 +133,41 @@ return {
|
||||||
cssls = {},
|
cssls = {},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Enable LSP Features
|
|
||||||
require('mason').setup()
|
require('mason').setup()
|
||||||
local ensure_installed = vim.tbl_keys(servers)
|
|
||||||
vim.list_extend(ensure_installed, { 'templ', 'typescript-language-server' })
|
local capabilities = vim.tbl_deep_extend(
|
||||||
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
'force',
|
||||||
|
{},
|
||||||
|
vim.lsp.protocol.make_client_capabilities(),
|
||||||
|
require('cmp_nvim_lsp').default_capabilities()
|
||||||
|
)
|
||||||
|
|
||||||
require('mason-lspconfig').setup {
|
require('mason-lspconfig').setup {
|
||||||
handlers = {
|
ensure_installed = vim.tbl_keys(servers),
|
||||||
function(server_name)
|
|
||||||
local server = servers[server_name] or {}
|
|
||||||
server.capabilities = vim.tbl_deep_extend(
|
|
||||||
'force',
|
|
||||||
{},
|
|
||||||
vim.lsp.protocol.make_client_capabilities(),
|
|
||||||
require('cmp_nvim_lsp').default_capabilities(),
|
|
||||||
server.capabilities or {}
|
|
||||||
)
|
|
||||||
require('lspconfig')[server_name].setup(server)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- Setup servers manually
|
||||||
|
for name, config in pairs(servers) do
|
||||||
|
config.capabilities = vim.tbl_deep_extend('force', {}, capabilities, config.capabilities or {})
|
||||||
|
require('lspconfig')[name].setup(config)
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
|
pattern = "*.astro",
|
||||||
|
callback = function()
|
||||||
|
vim.lsp.buf.format({ async = false })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
-- Auto-format and organize imports on save for Go
|
-- Auto-format and organize imports on save for Go
|
||||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
pattern = "*.go",
|
pattern = "*.go",
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.lsp.buf.format({ async = false }) -- Format
|
vim.lsp.buf.format({ async = false })
|
||||||
vim.lsp.buf.code_action({
|
vim.lsp.buf.code_action({
|
||||||
context = { only = { "source.organizeImports" } },
|
context = { only = { "source.organizeImports" } },
|
||||||
apply = true,
|
apply = true,
|
||||||
}) -- Organize imports
|
})
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
|
|
||||||
|
|
@ -26,11 +26,14 @@ return {
|
||||||
|
|
||||||
require('telescope').setup {
|
require('telescope').setup {
|
||||||
defaults = {
|
defaults = {
|
||||||
|
winblend = 0,
|
||||||
mappings = {
|
mappings = {
|
||||||
i = {
|
i = {
|
||||||
['<C-k>'] = actions.move_selection_previous, -- move to prev result
|
['<C-k>'] = actions.move_selection_previous, -- move to prev result
|
||||||
['<C-j>'] = actions.move_selection_next, -- move to next result
|
['<C-j>'] = actions.move_selection_next, -- move to next result
|
||||||
['<C-l>'] = actions.select_default, -- open file
|
['<C-l>'] = actions.select_default, -- open file
|
||||||
|
-- Enable paste from system clipboard
|
||||||
|
['<C-r>'] = actions.paste_register,
|
||||||
},
|
},
|
||||||
n = {
|
n = {
|
||||||
['q'] = actions.close,
|
['q'] = actions.close,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue