adding
This commit is contained in:
parent
2887c2ed8c
commit
bab5ad2587
|
@ -50,5 +50,4 @@ vim.keymap.set('v', '<A-k>', ":m '<-2<CR>gv=gv", { desc = 'Move selection up' })
|
|||
vim.keymap.set('n', '<C-,>', 'gcc', { desc = 'Comment line', remap = true })
|
||||
vim.keymap.set('v', '<C-,>', 'gc', { desc = 'Comment selection', remap = true })
|
||||
|
||||
-- Copy to clipboard with Ctrl+C
|
||||
vim.keymap.set('v', '<C-c>', '"+y', { desc = 'Copy to clipboard' })
|
|
@ -17,7 +17,7 @@ vim.opt.updatetime = 250
|
|||
vim.opt.timeoutlen = 300
|
||||
|
||||
-- Enable inline diagnostics
|
||||
vim.diagnostic.config({
|
||||
vim.diagnostic.config {
|
||||
virtual_text = {
|
||||
prefix = '●',
|
||||
source = 'always',
|
||||
|
@ -26,7 +26,7 @@ vim.diagnostic.config({
|
|||
underline = true,
|
||||
update_in_insert = false,
|
||||
severity_sort = true,
|
||||
})
|
||||
}
|
||||
|
||||
vim.opt.splitright = true
|
||||
vim.opt.splitbelow = true
|
||||
|
@ -34,3 +34,14 @@ vim.opt.list = false
|
|||
vim.opt.inccommand = 'split'
|
||||
vim.opt.cursorline = true
|
||||
vim.opt.scrolloff = 10
|
||||
|
||||
-- Set indentation for specific filetypes
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = { 'typescript', 'javascript', 'typescriptreact', 'javascriptreact', 'html', 'css' },
|
||||
callback = function()
|
||||
vim.opt_local.tabstop = 2
|
||||
vim.opt_local.shiftwidth = 2
|
||||
vim.opt_local.expandtab = true
|
||||
end,
|
||||
})
|
||||
|
||||
|
|
|
@ -21,6 +21,13 @@ return {
|
|||
'hrsh7th/cmp-nvim-lsp',
|
||||
},
|
||||
config = function()
|
||||
-- Set default position encoding to prevent warnings
|
||||
local original_make_position_params = vim.lsp.util.make_position_params
|
||||
vim.lsp.util.make_position_params = function(win, offset_encoding)
|
||||
offset_encoding = offset_encoding or 'utf-16'
|
||||
return original_make_position_params(win, offset_encoding)
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }),
|
||||
callback = function(event)
|
||||
|
@ -29,7 +36,7 @@ return {
|
|||
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
|
||||
end
|
||||
|
||||
map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
|
||||
map('gd', vim.lsp.buf.definition, '[G]oto [D]efinition')
|
||||
map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
||||
map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
|
||||
map('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
|
||||
|
@ -71,9 +78,17 @@ return {
|
|||
end,
|
||||
})
|
||||
|
||||
-- Set global position encoding preference
|
||||
vim.lsp.protocol.PositionEncodingKind = vim.lsp.protocol.PositionEncodingKind or {}
|
||||
vim.lsp.protocol.PositionEncodingKind.UTF16 = 'utf-16'
|
||||
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities())
|
||||
|
||||
-- Set position encoding to utf-16 (widely supported) to avoid warnings
|
||||
capabilities.general = capabilities.general or {}
|
||||
capabilities.general.positionEncodings = { 'utf-16' }
|
||||
|
||||
local servers = {
|
||||
omnisharp = {
|
||||
cmd = { 'omnisharp-mono' },
|
||||
|
@ -110,6 +125,7 @@ return {
|
|||
|
||||
-- Setup Gleam LSP separately (not managed by Mason)
|
||||
require('lspconfig').gleam.setup({})
|
||||
|
||||
end,
|
||||
},
|
||||
}
|
|
@ -179,6 +179,17 @@ return {
|
|||
hi('@tag.attribute', c.property, '', '')
|
||||
hi('@tag.delimiter', c.operator, '', '')
|
||||
|
||||
-- JSX/HTML specific highlights
|
||||
hi('@tag.javascript', c.class, '', '')
|
||||
hi('@tag.tsx', c.class, '', '')
|
||||
hi('@tag.jsx', c.class, '', '')
|
||||
hi('@tag.builtin.javascript', c.keyword, '', '')
|
||||
hi('@tag.builtin.tsx', c.keyword, '', '')
|
||||
hi('@tag.builtin.jsx', c.keyword, '', '')
|
||||
hi('@constructor.javascript', c.class, '', '')
|
||||
hi('@constructor.tsx', c.class, '', '')
|
||||
hi('@constructor.jsx', c.class, '', '')
|
||||
|
||||
-- LSP
|
||||
hi('@lsp.type.class', c.class, '', '')
|
||||
hi('@lsp.type.interface', c.interface, '', '')
|
||||
|
|
Loading…
Reference in New Issue