diff --git a/init.lua b/init.lua index cbf9ff65..777c697a 100644 --- a/init.lua +++ b/init.lua @@ -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', 'Q', 'qa', { desc = 'Quit All' }) -- Clear highlights on search when pressing in normal mode -- See `:help hlsearch` @@ -338,6 +339,7 @@ require('lazy').setup({ spec = { { 'c', group = '[C]ode', mode = { 'n', 'x' } }, { 'd', group = '[D]ocument' }, + { 'g', group = '[G]it' }, { 'r', group = '[R]ename' }, { 's', group = '[S]earch' }, { 'w', group = '[W]orkspace' }, @@ -431,7 +433,9 @@ require('lazy').setup({ vim.keymap.set('n', 'sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) vim.keymap.set('n', 'sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) vim.keymap.set('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) - vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) + vim.keymap.set('n', 's.', function() + builtin.oldfiles { only_cwd = true } + end, { desc = '[S]earch Recent Files ("." for repeat)' }) vim.keymap.set('n', '', 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', 'gg', 'LazyGit', { desc = 'LazyGit' }) + end, + }, + { -- Highlight, edit, and navigate code 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate',