Lazygit, vtsls, angularjs lsps, everforest color scheme, qol improvements

This commit is contained in:
Ruslan Rakhmanov 2025-04-08 06:36:13 +02:00
parent e947649cb0
commit 65f9b32fcb
1 changed files with 67 additions and 9 deletions

View File

@ -102,7 +102,7 @@ vim.g.have_nerd_font = false
vim.opt.number = true
-- You can also add relative line numbers, to help with jumping.
-- Experiment for yourself to see if you like it!
-- vim.opt.relativenumber = true
vim.opt.relativenumber = true
-- Enable mouse mode, can be useful for resizing splits for example!
vim.opt.mouse = 'a'
@ -163,6 +163,7 @@ vim.opt.confirm = true
-- [[ Basic Keymaps ]]
-- See `:help vim.keymap.set()`
vim.keymap.set('n', '<leader>Q', '<cmd>qa<cr>', { desc = 'Quit All' })
-- Clear highlights on search when pressing <Esc> in normal mode
-- See `:help hlsearch`
@ -338,6 +339,7 @@ require('lazy').setup({
spec = {
{ '<leader>c', group = '[C]ode', mode = { 'n', 'x' } },
{ '<leader>d', group = '[D]ocument' },
{ '<leader>g', group = '[G]it' },
{ '<leader>r', group = '[R]ename' },
{ '<leader>s', group = '[S]earch' },
{ '<leader>w', group = '[W]orkspace' },
@ -431,7 +433,9 @@ require('lazy').setup({
vim.keymap.set('n', '<leader>sg', builtin.live_grep, { desc = '[S]earch by [G]rep' })
vim.keymap.set('n', '<leader>sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' })
vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' })
vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
vim.keymap.set('n', '<leader>s.', function()
builtin.oldfiles { only_cwd = true }
end, { desc = '[S]earch Recent Files ("." for repeat)' })
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
-- Slightly advanced example of overriding default behavior and theme
@ -696,6 +700,44 @@ require('lazy').setup({
},
},
},
vtsls = {
settings = {
typescript = {
preferences = {
importModuleSpecifier = 'project-relative',
importModuleSpecifierPreference = 'relative',
importModuleSpecifierEnding = 'minimal',
},
inlayHints = {
parameterNames = { enabled = 'all' },
parameterTypes = { enabled = true },
variableTypes = { enabled = true },
propertyDeclarationTypes = { enabled = true },
functionLikeReturnTypes = { enabled = true },
enumMemberValues = { enabled = true },
},
},
},
},
angularls = {
capabilities = lsp_capabilities,
filetypes = { 'typescript', 'html', 'angular', 'htmlangular' },
root_dir = function(fname)
return require('lspconfig.util').root_pattern('angular.json', 'workspace.json', 'nx.json', 'package.json', 'tsconfig.base.json')(fname)
end,
on_new_config = function(new_config, new_root_dir)
new_config.cmd = {
'ngserver',
'--stdio',
'--tsProbeLocations',
new_root_dir,
'--ngProbeLocations',
new_root_dir,
}
end,
},
}
-- Ensure the servers and tools above are installed
@ -898,20 +940,20 @@ require('lazy').setup({
-- change the command in the config to whatever the name of that colorscheme is.
--
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
'folke/tokyonight.nvim',
'neanias/everforest-nvim',
lazy = false,
priority = 1000, -- Make sure to load this before all the other start plugins.
config = function()
---@diagnostic disable-next-line: missing-fields
require('tokyonight').setup {
styles = {
comments = { italic = false }, -- Disable italics in comments
},
require('everforest').setup {
background = 'medium',
ui_contrast = 'low',
}
-- Load the colorscheme here.
-- Like many other themes, this one has different styles, and you could load
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
vim.cmd.colorscheme 'tokyonight-night'
vim.cmd.colorscheme 'everforest'
end,
},
@ -955,6 +997,22 @@ require('lazy').setup({
-- Check out: https://github.com/echasnovski/mini.nvim
end,
},
{ -- LazyGit
'kdheepak/lazygit.nvim',
lazy = false,
cmd = {
'LazyGit',
'LazyGitConfig',
'LazyGitCurrentFile',
'LazyGitFilter',
'LazyGitFilterCurrentFile',
},
config = function()
vim.keymap.set('n', '<leader>gg', '<cmd>LazyGit<CR>', { desc = 'LazyGit' })
end,
},
{ -- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',