Skip to content

Commit bab5ad2

Browse files
adding
1 parent 2887c2e commit bab5ad2

File tree

4 files changed

+42
-5
lines changed

4 files changed

+42
-5
lines changed

lua/config/keymaps.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,4 @@ vim.keymap.set('v', '<A-k>', ":m '<-2<CR>gv=gv", { desc = 'Move selection up' })
5050
vim.keymap.set('n', '<C-,>', 'gcc', { desc = 'Comment line', remap = true })
5151
vim.keymap.set('v', '<C-,>', 'gc', { desc = 'Comment selection', remap = true })
5252

53-
-- Copy to clipboard with Ctrl+C
5453
vim.keymap.set('v', '<C-c>', '"+y', { desc = 'Copy to clipboard' })

lua/config/options.lua

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ vim.opt.updatetime = 250
1717
vim.opt.timeoutlen = 300
1818

1919
-- Enable inline diagnostics
20-
vim.diagnostic.config({
20+
vim.diagnostic.config {
2121
virtual_text = {
2222
prefix = '',
2323
source = 'always',
@@ -26,11 +26,22 @@ vim.diagnostic.config({
2626
underline = true,
2727
update_in_insert = false,
2828
severity_sort = true,
29-
})
29+
}
3030

3131
vim.opt.splitright = true
3232
vim.opt.splitbelow = true
3333
vim.opt.list = false
3434
vim.opt.inccommand = 'split'
3535
vim.opt.cursorline = true
36-
vim.opt.scrolloff = 10
36+
vim.opt.scrolloff = 10
37+
38+
-- Set indentation for specific filetypes
39+
vim.api.nvim_create_autocmd('FileType', {
40+
pattern = { 'typescript', 'javascript', 'typescriptreact', 'javascriptreact', 'html', 'css' },
41+
callback = function()
42+
vim.opt_local.tabstop = 2
43+
vim.opt_local.shiftwidth = 2
44+
vim.opt_local.expandtab = true
45+
end,
46+
})
47+

lua/plugins/lsp.lua

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ return {
2121
'hrsh7th/cmp-nvim-lsp',
2222
},
2323
config = function()
24+
-- Set default position encoding to prevent warnings
25+
local original_make_position_params = vim.lsp.util.make_position_params
26+
vim.lsp.util.make_position_params = function(win, offset_encoding)
27+
offset_encoding = offset_encoding or 'utf-16'
28+
return original_make_position_params(win, offset_encoding)
29+
end
30+
2431
vim.api.nvim_create_autocmd('LspAttach', {
2532
group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }),
2633
callback = function(event)
@@ -29,7 +36,7 @@ return {
2936
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
3037
end
3138

32-
map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
39+
map('gd', vim.lsp.buf.definition, '[G]oto [D]efinition')
3340
map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
3441
map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
3542
map('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
@@ -71,8 +78,16 @@ return {
7178
end,
7279
})
7380

81+
-- Set global position encoding preference
82+
vim.lsp.protocol.PositionEncodingKind = vim.lsp.protocol.PositionEncodingKind or {}
83+
vim.lsp.protocol.PositionEncodingKind.UTF16 = 'utf-16'
84+
7485
local capabilities = vim.lsp.protocol.make_client_capabilities()
7586
capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities())
87+
88+
-- Set position encoding to utf-16 (widely supported) to avoid warnings
89+
capabilities.general = capabilities.general or {}
90+
capabilities.general.positionEncodings = { 'utf-16' }
7691

7792
local servers = {
7893
omnisharp = {
@@ -110,6 +125,7 @@ return {
110125

111126
-- Setup Gleam LSP separately (not managed by Mason)
112127
require('lspconfig').gleam.setup({})
128+
113129
end,
114130
},
115131
}

lua/plugins/theme.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,17 @@ return {
178178
hi('@tag', c.class, '', '')
179179
hi('@tag.attribute', c.property, '', '')
180180
hi('@tag.delimiter', c.operator, '', '')
181+
182+
-- JSX/HTML specific highlights
183+
hi('@tag.javascript', c.class, '', '')
184+
hi('@tag.tsx', c.class, '', '')
185+
hi('@tag.jsx', c.class, '', '')
186+
hi('@tag.builtin.javascript', c.keyword, '', '')
187+
hi('@tag.builtin.tsx', c.keyword, '', '')
188+
hi('@tag.builtin.jsx', c.keyword, '', '')
189+
hi('@constructor.javascript', c.class, '', '')
190+
hi('@constructor.tsx', c.class, '', '')
191+
hi('@constructor.jsx', c.class, '', '')
181192

182193
-- LSP
183194
hi('@lsp.type.class', c.class, '', '')

0 commit comments

Comments
 (0)