Skip to content

Commit ff42b77

Browse files
committed
fix issue with lazygit
2 parents 5bdc9a9 + 3338d39 commit ff42b77

File tree

5 files changed

+98
-41
lines changed

5 files changed

+98
-41
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ If you are experiencing issues, please make sure you have the latest versions.
2323

2424
External Requirements:
2525
- Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`)
26-
- [ripgrep](https://github.com/BurntSushi/ripgrep#installation)
26+
- [ripgrep](https://github.com/BurntSushi/ripgrep#installation),
27+
[fd-find](https://github.com/sharkdp/fd#installation)
2728
- Clipboard tool (xclip/xsel/win32yank or other depending on the platform)
2829
- A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons
2930
- if you have it set `vim.g.have_nerd_font` in `init.lua` to true

lua/plugins/bufferline.lua

Lines changed: 60 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,31 @@ return {
99

1010
require('bufferline').setup {
1111
options = {
12-
mode = 'buffers', -- set to "tabs" to only show tabpages instead
13-
themable = true, -- allows highlight groups to be overriden i.e. sets highlights as default
14-
numbers = 'none', -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string,
15-
close_command = 'Bdelete! %d', -- can be a string | function, see "Mouse actions"
12+
mode = 'buffers', -- 'buffers', -- set to "tabs" to only show tabpages instead
13+
14+
themable = true, -- allows highlight groups to be overriden i.e. sets highlights as default
15+
numbers = 'none', -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string,
16+
close_command = 'Bdelete! %d', -- can be a string | function, see "Mouse actions"
1617
right_mouse_command = 'Bdelete! %d', -- can be a string | function, see "Mouse actions"
17-
left_mouse_command = 'buffer %d', -- can be a string | function, see "Mouse actions"
18-
middle_mouse_command = nil, -- can be a string | function, see "Mouse actions"
18+
left_mouse_command = 'buffer %d', -- can be a string | function, see "Mouse actions"
19+
middle_mouse_command = nil, -- can be a string | function, see "Mouse actions"
1920
-- buffer_close_icon = '󰅖',
2021
buffer_close_icon = '',
2122
-- buffer_close_icon = '✕',
22-
close_icon = '',
23+
close_icon = '',
2324
path_components = 1, -- Show only the file name without the directory
2425
modified_icon = '',
25-
left_trunc_marker = '',
26-
right_trunc_marker = '',
26+
left_trunc_marker = '',
27+
right_trunc_marker = '',
2728
max_name_length = 30,
2829
max_prefix_length = 30, -- prefix used when a buffer is de-duplicated
2930
tab_size = 21,
30-
diagnostics = false,
31+
diagnostics = "nvim_lsp",
3132
diagnostics_update_in_insert = false,
33+
diagnostics_indicator = function(count, level, diagnostics_dict, context)
34+
local icon = level:match("error") and "󰅚 " or "󰀪 "
35+
return " " .. icon .. count
36+
end,
3237
color_icons = true,
3338
show_buffer_icons = true,
3439
show_buffer_close_icons = true,
@@ -61,6 +66,51 @@ return {
6166
-- background = {},
6267
-- indicator_selected = {},
6368
-- fill = {},
69+
--
70+
71+
-- Error highlighting (pink theme)
72+
error = {
73+
fg = '#ff69b4', -- Hot pink
74+
bg = '#2d2d2d',
75+
},
76+
error_selected = {
77+
fg = '#ff1493', -- Deep pink for active tab
78+
bg = '#3d3d3d',
79+
bold = true,
80+
},
81+
error_visible = {
82+
fg = '#ff69b4',
83+
bg = '#2d2d2d',
84+
},
85+
86+
-- Warning highlighting (optional)
87+
warning = {
88+
fg = '#ffb86c',
89+
bg = '#2d2d2d',
90+
},
91+
warning_selected = {
92+
fg = '#ff8c00',
93+
bg = '#3d3d3d',
94+
bold = true,
95+
},
96+
97+
-- Normal tab highlighting
98+
tab = {
99+
fg = '#6272a4',
100+
bg = '#282a36',
101+
},
102+
tab_selected = {
103+
fg = '#f8f8f2',
104+
bg = '#44475a',
105+
bold = true,
106+
},
107+
108+
-- Background
109+
fill = {
110+
bg = '#282a36',
111+
},
112+
113+
64114
},
65115
}
66116

lua/plugins/lsp-keymaps.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ function M.get()
1616
{ 'gI', vim.lsp.buf.implementation, desc = 'Go to Implementation' },
1717
{ 'gy', vim.lsp.buf.type_definition, desc = 'Go to Type Definition' },
1818
{ 'gD', vim.lsp.buf.declaration, desc = 'Go to Declaration' },
19-
{ 'K', vim.lsp.buf.hover, desc = 'Hover' },
2019
{ 'gK', vim.lsp.buf.signature_help, desc = 'Signature Help' },
2120
{ '<C-k>', vim.lsp.buf.signature_help, mode = 'i', desc = 'Signature Help' },
2221
{ '<leader>ca', vim.lsp.buf.code_action, desc = 'Code Action', mode = { 'n', 'v' } },

lua/plugins/lsp.lua

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,15 @@ return {
2828
end,
2929
},
3030
},
31-
3231
config = function()
3332
vim.api.nvim_create_autocmd('LspAttach', {
3433
group = vim.api.nvim_create_augroup('lsp-attach', { clear = true }),
3534
callback = function(event)
3635
local map = function(keys, func, desc)
3736
vim.keymap.set('n', keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
3837
end
39-
4038
local telescope_ok, telescope = pcall(require, 'telescope.builtin')
4139
if not telescope_ok then return end
42-
4340
map('gd', telescope.lsp_definitions, 'Go to Definition')
4441
map('gr', telescope.lsp_references, 'Go to References')
4542
map('gI', telescope.lsp_implementations, 'Go to Implementation')
@@ -49,16 +46,12 @@ return {
4946
map('<leader>rn', vim.lsp.buf.rename, 'Rename')
5047
map('<leader>ca', vim.lsp.buf.code_action, 'Code Action')
5148
map('gD', vim.lsp.buf.declaration, 'Go to Declaration')
52-
53-
map('<S-K>', function()
49+
map('K', function()
5450
local lspsaga_hover_ok, lspsaga_hover = pcall(require, 'lspsaga.hover')
5551
if lspsaga_hover_ok then
5652
lspsaga_hover:render_hover_doc()
57-
else
58-
vim.lsp.buf.hover()
5953
end
6054
end, 'Show Hover')
61-
6255
local client = vim.lsp.get_client_by_id(event.data.client_id)
6356
if client and client.server_capabilities.documentHighlightProvider then
6457
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
@@ -91,9 +84,16 @@ return {
9184
},
9285
filetypes = { 'go', 'templ' },
9386
},
94-
-- tsserver = { settings = { completions = { completeFunctionCalls = true }, }, filetypes = { 'typescript', 'typescriptreact', 'typescript.tsx', 'javascript' }, root_dir = require('lspconfig.util').root_pattern('package.json', 'tsconfig.json', '.git'), },
87+
astro = {
88+
filetypes = { "astro" },
89+
init_options = {
90+
typescript = {
91+
tsdk = vim.fn.stdpath("data") .. "/mason/packages/typescript-language-server/node_modules/typescript/lib",
92+
},
93+
},
94+
},
9595
eslint = {},
96-
html = { filetypes = { 'html', 'twig', 'hbs' } }, -- Removed 'templ' from here
96+
html = { filetypes = { 'html', 'twig', 'hbs' } },
9797
templ = {
9898
cmd = { vim.fn.stdpath("data") .. "/mason/bin/templ", "lsp" },
9999
filetypes = { "templ" },
@@ -133,37 +133,41 @@ return {
133133
cssls = {},
134134
}
135135

136-
-- Enable LSP Features
137136
require('mason').setup()
138-
local ensure_installed = vim.tbl_keys(servers)
139-
vim.list_extend(ensure_installed, { 'templ', 'typescript-language-server' })
140-
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
137+
138+
local capabilities = vim.tbl_deep_extend(
139+
'force',
140+
{},
141+
vim.lsp.protocol.make_client_capabilities(),
142+
require('cmp_nvim_lsp').default_capabilities()
143+
)
141144

142145
require('mason-lspconfig').setup {
143-
handlers = {
144-
function(server_name)
145-
local server = servers[server_name] or {}
146-
server.capabilities = vim.tbl_deep_extend(
147-
'force',
148-
{},
149-
vim.lsp.protocol.make_client_capabilities(),
150-
require('cmp_nvim_lsp').default_capabilities(),
151-
server.capabilities or {}
152-
)
153-
require('lspconfig')[server_name].setup(server)
154-
end,
155-
},
146+
ensure_installed = vim.tbl_keys(servers),
156147
}
157148

149+
-- Setup servers manually
150+
for name, config in pairs(servers) do
151+
config.capabilities = vim.tbl_deep_extend('force', {}, capabilities, config.capabilities or {})
152+
require('lspconfig')[name].setup(config)
153+
end
154+
155+
vim.api.nvim_create_autocmd("BufWritePre", {
156+
pattern = "*.astro",
157+
callback = function()
158+
vim.lsp.buf.format({ async = false })
159+
end,
160+
})
161+
158162
-- Auto-format and organize imports on save for Go
159163
vim.api.nvim_create_autocmd("BufWritePre", {
160164
pattern = "*.go",
161165
callback = function()
162-
vim.lsp.buf.format({ async = false }) -- Format
166+
vim.lsp.buf.format({ async = false })
163167
vim.lsp.buf.code_action({
164168
context = { only = { "source.organizeImports" } },
165169
apply = true,
166-
}) -- Organize imports
170+
})
167171
end,
168172
})
169173
end,

lua/plugins/telescope.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,14 @@ return {
2626

2727
require('telescope').setup {
2828
defaults = {
29+
winblend = 0,
2930
mappings = {
3031
i = {
3132
['<C-k>'] = actions.move_selection_previous, -- move to prev result
3233
['<C-j>'] = actions.move_selection_next, -- move to next result
3334
['<C-l>'] = actions.select_default, -- open file
35+
-- Enable paste from system clipboard
36+
['<C-r>'] = actions.paste_register,
3437
},
3538
n = {
3639
['q'] = actions.close,

0 commit comments

Comments
 (0)