From 65f9b32fcb713b23ac406825c87adf05844cd798 Mon Sep 17 00:00:00 2001 From: Ruslan Rakhmanov Date: Tue, 8 Apr 2025 06:36:13 +0200 Subject: [PATCH 01/22] Lazygit, vtsls, angularjs lsps, everforest color scheme, qol improvements --- init.lua | 76 +++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 67 insertions(+), 9 deletions(-) diff --git a/init.lua b/init.lua index cbf9ff65d67..777c697a560 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', From 7b78562f582ccfa1586c0d79522510c8085e5909 Mon Sep 17 00:00:00 2001 From: Ruslan Rakhmanov Date: Tue, 8 Apr 2025 17:36:18 +0200 Subject: [PATCH 02/22] Added delay for which-key --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 777c697a560..515cc79d446 100644 --- a/init.lua +++ b/init.lua @@ -297,7 +297,7 @@ require('lazy').setup({ opts = { -- delay between pressing a key and opening which-key (milliseconds) -- this setting is independent of vim.opt.timeoutlen - delay = 0, + delay = 500, icons = { -- set icon mappings to true if you have a Nerd Font mappings = vim.g.have_nerd_font, From 607e6fca8d66532520248e413f8f8234071be478 Mon Sep 17 00:00:00 2001 From: Ruslan Rakhmanov Date: Tue, 8 Apr 2025 20:57:13 +0200 Subject: [PATCH 03/22] Neotree, telescope results formatting --- init.lua | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/init.lua b/init.lua index 515cc79d446..e48cbb34652 100644 --- a/init.lua +++ b/init.lua @@ -406,11 +406,16 @@ require('lazy').setup({ -- You can put your default mappings / updates / etc. in here -- All the info you're looking for is in `:help telescope.setup()` -- - -- defaults = { - -- mappings = { - -- i = { [''] = 'to_fuzzy_refine' }, - -- }, - -- }, + defaults = { + -- mappings = { + -- i = { [''] = 'to_fuzzy_refine' }, + -- }, + path_display = { + filename_first = { + reverse_directories = true, + }, + }, + }, -- pickers = {} extensions = { ['ui-select'] = { @@ -1052,7 +1057,7 @@ require('lazy').setup({ -- require 'kickstart.plugins.indent_line', -- require 'kickstart.plugins.lint', -- require 'kickstart.plugins.autopairs', - -- require 'kickstart.plugins.neo-tree', + require 'kickstart.plugins.neo-tree', -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` From 7327ec9ac832d1284fa594531bbd4f385692ceeb Mon Sep 17 00:00:00 2001 From: Ruslan Rakhmanov Date: Wed, 9 Apr 2025 10:57:35 +0200 Subject: [PATCH 04/22] Use Telescope version from master instead of 0.1.8 --- init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index e48cbb34652..1e97ae7a693 100644 --- a/init.lua +++ b/init.lua @@ -359,7 +359,8 @@ require('lazy').setup({ { -- Fuzzy Finder (files, lsp, etc) 'nvim-telescope/telescope.nvim', event = 'VimEnter', - branch = '0.1.x', + version = false, + -- tag = '0.1.8', dependencies = { 'nvim-lua/plenary.nvim', { -- If encountering errors, see telescope-fzf-native README for installation instructions From 11b70a5344f984d45ac95d8e21cbc63b4c100c82 Mon Sep 17 00:00:00 2001 From: Ruslan Rakhmanov Date: Wed, 9 Apr 2025 18:01:56 +0200 Subject: [PATCH 05/22] Leap, autopairs --- init.lua | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 1e97ae7a693..17a142cb373 100644 --- a/init.lua +++ b/init.lua @@ -1045,6 +1045,25 @@ require('lazy').setup({ -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects }, + { + 'ggandor/leap.nvim', + enabled = true, + keys = { + { 's', mode = { 'n', 'x', 'o' }, desc = 'Leap Forward to' }, + { 'S', mode = { 'n', 'x', 'o' }, desc = 'Leap Backward to' }, + { 'gs', mode = { 'n', 'x', 'o' }, desc = 'Leap from Windows' }, + }, + config = function(_, opts) + local leap = require 'leap' + for k, v in pairs(opts) do + leap.opts[k] = v + end + leap.add_default_mappings(true) + vim.keymap.del({ 'x', 'o' }, 'x') + vim.keymap.del({ 'x', 'o' }, 'X') + end, + }, + -- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the -- init.lua. If you want these files, they are in the repository, so you can just download them and -- place them in the correct locations. @@ -1057,7 +1076,7 @@ require('lazy').setup({ -- require 'kickstart.plugins.debug', -- require 'kickstart.plugins.indent_line', -- require 'kickstart.plugins.lint', - -- require 'kickstart.plugins.autopairs', + require 'kickstart.plugins.autopairs', require 'kickstart.plugins.neo-tree', -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps From 5ff2a9d6e42c74e45483c77914eabbc5b47c9246 Mon Sep 17 00:00:00 2001 From: Ruslan Rakhmanov Date: Wed, 9 Apr 2025 18:35:13 +0200 Subject: [PATCH 06/22] Cleanup init.lua --- init.lua | 92 ++------------------------------------------------------ 1 file changed, 2 insertions(+), 90 deletions(-) diff --git a/init.lua b/init.lua index 17a142cb373..ff458f4404f 100644 --- a/init.lua +++ b/init.lua @@ -1,87 +1,8 @@ --[[ - -===================================================================== -==================== READ THIS BEFORE CONTINUING ==================== -===================================================================== -======== .-----. ======== -======== .----------------------. | === | ======== -======== |.-""""""""""""""""""-.| |-----| ======== -======== || || | === | ======== -======== || KICKSTART.NVIM || |-----| ======== -======== || || | === | ======== -======== || || |-----| ======== -======== ||:Tutor || |:::::| ======== -======== |'-..................-'| |____o| ======== -======== `"")----------------(""` ___________ ======== -======== /::::::::::| |::::::::::\ \ no mouse \ ======== -======== /:::========| |==hjkl==:::\ \ required \ ======== -======== '""""""""""""' '""""""""""""' '""""""""""' ======== -======== ======== -===================================================================== -===================================================================== - -What is Kickstart? - - Kickstart.nvim is *not* a distribution. - - Kickstart.nvim is a starting point for your own configuration. - The goal is that you can read every line of code, top-to-bottom, understand - what your configuration is doing, and modify it to suit your needs. - - Once you've done that, you can start exploring, configuring and tinkering to - make Neovim your own! That might mean leaving Kickstart just the way it is for a while - or immediately breaking it into modular pieces. It's up to you! - - If you don't know anything about Lua, I recommend taking some time to read through - a guide. One possible example which will only take 10-15 minutes: - - https://learnxinyminutes.com/docs/lua/ - - After understanding a bit more about Lua, you can use `:help lua-guide` as a - reference for how Neovim integrates Lua. + Lua 15 mins guide - https://learnxinyminutes.com/docs/lua/ - :help lua-guide - - (or HTML version): https://neovim.io/doc/user/lua-guide.html - -Kickstart Guide: - - TODO: The very first thing you should do is to run the command `:Tutor` in Neovim. - - If you don't know what this means, type the following: - - - - : - - Tutor - - - - (If you already know the Neovim basics, you can skip this step.) - - Once you've completed that, you can continue working through **AND READING** the rest - of the kickstart init.lua. - - Next, run AND READ `:help`. - This will open up a help window with some basic information - about reading, navigating and searching the builtin help documentation. - - This should be the first place you go to look when you're stuck or confused - with something. It's one of my favorite Neovim features. - - MOST IMPORTANTLY, we provide a keymap "sh" to [s]earch the [h]elp documentation, - which is very useful when you're not exactly sure of what you're looking for. - I have left several `:help X` comments throughout the init.lua - These are hints about where to find more information about the relevant settings, - plugins or Neovim features used in Kickstart. - - NOTE: Look for lines like this - - Throughout the file. These are for you, the reader, to help you understand what is happening. - Feel free to delete them once you know what you're doing, but they should serve as a guide - for when you are first encountering a few different constructs in your Neovim config. - -If you experience any errors while trying to install kickstart, run `:checkhealth` for more info. - -I hope you enjoy your Neovim journey, -- TJ - -P.S. You can delete this when you're done too. It's your config now! :) + If you experience any errors while trying to install kickstart, run `:checkhealth` for more info. --]] -- Set as the leader key @@ -101,7 +22,6 @@ vim.g.have_nerd_font = false -- Make line numbers default 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 -- Enable mouse mode, can be useful for resizing splits for example! @@ -227,16 +147,8 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then end ---@diagnostic disable-next-line: undefined-field vim.opt.rtp:prepend(lazypath) --- [[ Configure and install plugins ]] --- --- To check the current status of your plugins, run -- :Lazy --- --- You can press `?` in this menu for help. Use `:q` to close the window --- --- To update plugins you can run -- :Lazy update --- -- NOTE: Here is where you install your plugins. require('lazy').setup({ -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). From 8d7439522a194e77051d18c80984133e377862f0 Mon Sep 17 00:00:00 2001 From: Ruslan Rakhmanov Date: Wed, 9 Apr 2025 19:57:39 +0200 Subject: [PATCH 07/22] Change autocomplete shortcuts, added shorcut for Lazy --- init.lua | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/init.lua b/init.lua index ff458f4404f..3911ee07269 100644 --- a/init.lua +++ b/init.lua @@ -1,5 +1,5 @@ --[[ - Lua 15 mins guide - https://learnxinyminutes.com/docs/lua/ + - Lua 15 mins guide - https://learnxinyminutes.com/docs/lua/ - :help lua-guide If you experience any errors while trying to install kickstart, run `:checkhealth` for more info. @@ -257,6 +257,7 @@ require('lazy').setup({ { 'w', group = '[W]orkspace' }, { 't', group = '[T]oggle' }, { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, + { 'm', group = '[M]isc' }, }, }, }, @@ -792,24 +793,28 @@ require('lazy').setup({ -- No, but seriously. Please read `:help ins-completion`, it is really good! mapping = cmp.mapping.preset.insert { -- Select the [n]ext item - [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.select_next_item(), -- Select the [p]revious item - [''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.select_prev_item(), + --[''] = cmp.mapping.select_next_item(), + --[''] = cmp.mapping.select_prev_item(), -- Scroll the documentation window [b]ack / [f]orward - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + -- [''] = cmp.mapping.scroll_docs(-4), + -- [''] = cmp.mapping.scroll_docs(4), -- Accept ([y]es) the completion. -- This will auto-import if your LSP supports it. -- This will expand snippets if the LSP sent a snippet. - [''] = cmp.mapping.confirm { select = true }, + -- [''] = cmp.mapping.confirm { select = true }, + [''] = cmp.mapping.confirm { + behavior = cmp.ConfirmBehavior.Insert, + select = true, + }, - -- If you prefer more traditional completion keymaps, - -- you can uncomment the following lines - --[''] = cmp.mapping.confirm { select = true }, - --[''] = cmp.mapping.select_next_item(), - --[''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.close(), -- Manually trigger a completion from nvim-cmp. -- Generally you don't need this, because nvim-cmp will display @@ -976,6 +981,8 @@ require('lazy').setup({ end, }, + vim.keymap.set('n', 'hl', 'Lazy', { desc = 'Lazy' }), + -- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the -- init.lua. If you want these files, they are in the repository, so you can just download them and -- place them in the correct locations. From 80b4d0176b62c9ce585264cedc0af0a2a36fa34d Mon Sep 17 00:00:00 2001 From: Ruslan Rakhmanov Date: Fri, 11 Apr 2025 19:50:14 +0200 Subject: [PATCH 08/22] Html, css autocompletions --- init.lua | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 3911ee07269..409d970666d 100644 --- a/init.lua +++ b/init.lua @@ -121,6 +121,10 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the upper win -- vim.keymap.set("n", "", "J", { desc = "Move window to the lower" }) -- vim.keymap.set("n", "", "K", { desc = "Move window to the upper" }) +-- Lazy keymaps +vim.keymap.set('n', 'ml', 'Lazy', { desc = 'Lazy' }) +vim.keymap.set('n', 'mr', 'LspRestart', { desc = 'Restart LSP' }) + -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` @@ -258,6 +262,7 @@ require('lazy').setup({ { 't', group = '[T]oggle' }, { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, { 'm', group = '[M]isc' }, + { 'u', group = '[U]I' }, }, }, }, @@ -620,6 +625,7 @@ require('lazy').setup({ }, }, + -- NOTE: Dont forget to `npm i -g @vtsls/language-server` vtsls = { settings = { typescript = { @@ -640,6 +646,7 @@ require('lazy').setup({ }, }, + -- NOTE: Dont forget to `npm i -g @angular/language-server` angularls = { capabilities = lsp_capabilities, filetypes = { 'typescript', 'html', 'angular', 'htmlangular' }, @@ -657,6 +664,43 @@ require('lazy').setup({ } end, }, + + -- NOTE: Dont forget to `npm i -g vscode-langservers-extracted` + cssls = { + capabilities = lsp_capabilities, + cmd = { 'vscode-css-language-server', '--stdio' }, + filetypes = { 'css', 'scss' }, + init_options = { provideFormatter = true }, + -- TODO: Maybe I should use same patter for root finding as for "angularls" server? + root_dir = require('lspconfig.util').root_pattern('package.json', '.git'), + single_file_support = true, + settings = { + css = { validate = true }, + scss = { validate = true }, + }, + }, + + -- TODO: Add emmet abbreviation + -- NOTE: Dont forget to `npm i -g vscode-langservers-extracted` + html = { + capabilities = lsp_capabilities, + cmd = { 'vscode-html-language-server', '--stdio' }, + filetypes = { 'html', 'htmlangular' }, + init_options = { + { + configurationSection = { 'html', 'css', 'javascript', 'htmlangular' }, + embeddedLanguages = { + css = true, + javascript = true, + }, + provideFormatter = true, + }, + }, + -- TODO: Maybe I should use same patter for root finding as for "angularls" server? + root_dir = require('lspconfig.util').root_pattern('package.json', '.git'), + single_file_support = true, + settings = {}, + }, } -- Ensure the servers and tools above are installed @@ -981,8 +1025,6 @@ require('lazy').setup({ end, }, - vim.keymap.set('n', 'hl', 'Lazy', { desc = 'Lazy' }), - -- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the -- init.lua. If you want these files, they are in the repository, so you can just download them and -- place them in the correct locations. From 07d3bcb177585ed4b357b7a5341a0a5bd7db7a29 Mon Sep 17 00:00:00 2001 From: Ruslan Rakhmanov Date: Sat, 19 Apr 2025 09:47:01 +0200 Subject: [PATCH 09/22] JS Debug using obsolete vscode-chrome-debug lib --- init.lua | 8 +++-- lua/kickstart/plugins/debug.lua | 54 +++++++++++++++++++++++++-------- 2 files changed, 47 insertions(+), 15 deletions(-) diff --git a/init.lua b/init.lua index 409d970666d..fc5052013ae 100644 --- a/init.lua +++ b/init.lua @@ -651,7 +651,9 @@ require('lazy').setup({ 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) + return require('lspconfig.util').root_pattern('angular.json', 'workspace.json', 'nx.json', 'package.json', 'tsconfig.base.json', 'project.json')( + fname + ) end, on_new_config = function(new_config, new_root_dir) new_config.cmd = { @@ -913,7 +915,7 @@ require('lazy').setup({ priority = 1000, -- Make sure to load this before all the other start plugins. config = function() require('everforest').setup { - background = 'medium', + background = 'hard', ui_contrast = 'low', } @@ -1034,7 +1036,7 @@ require('lazy').setup({ -- Here are some example plugins that I've included in the Kickstart repository. -- Uncomment any of the lines below to enable them (you will need to restart nvim). -- - -- require 'kickstart.plugins.debug', + require 'kickstart.plugins.debug', -- require 'kickstart.plugins.indent_line', -- require 'kickstart.plugins.lint', require 'kickstart.plugins.autopairs', diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 753cb0cedd3..0e313381b39 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -23,37 +23,52 @@ return { -- Add your own debuggers here 'leoluz/nvim-dap-go', + + -- Web + { + 'microsoft/vscode-chrome-debug', + version = '1.x', + build = 'npm i && npm run build', + }, }, keys = { -- Basic debugging keymaps, feel free to change to your liking! { - '', + '', function() require('dap').continue() end, desc = 'Debug: Start/Continue', }, { - '', + '', function() require('dap').step_into() end, desc = 'Debug: Step Into', }, { - '', + '', function() require('dap').step_over() end, desc = 'Debug: Step Over', }, { - '', + '', function() require('dap').step_out() end, desc = 'Debug: Step Out', }, + -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. + { + '', + function() + require('dapui').toggle() + end, + desc = 'Debug: See last session result.', + }, { 'b', function() @@ -68,14 +83,6 @@ return { end, desc = 'Debug: Set Breakpoint', }, - -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. - { - '', - function() - require('dapui').toggle() - end, - desc = 'Debug: See last session result.', - }, }, config = function() local dap = require 'dap' @@ -136,6 +143,29 @@ return { dap.listeners.before.event_terminated['dapui_config'] = dapui.close dap.listeners.before.event_exited['dapui_config'] = dapui.close + dap.adapters.chrome = { + type = 'executable', + command = 'node', + args = { vim.fn.stdpath 'data' .. '/lazy/vscode-chrome-debug/out/src/chromeDebug.js' }, -- TODO adjust + } + + -- TODO: Figure out how to launch chrome automatically + -- TODO: Figure out why I have two additional configurations when starting debugger: "Launch Chrome Debugger", "Debug App Two" + -- now I have to do "open -a "Google Chrome" --args --remote-debugging-port=9222" + dap.configurations.typescript = { + { + name = 'Attach to Chrome', + type = 'chrome', + request = 'attach', + program = '${file}', + cwd = vim.fn.getcwd(), + sourceMaps = true, + protocol = 'inspector', + port = 9222, + webRoot = '${workspaceFolder}', + }, + } + -- Install golang specific config require('dap-go').setup { delve = { From 1c2ea8daba07e5ff6d160dd2e282aa013ca2a373 Mon Sep 17 00:00:00 2001 From: Ruslan Rakhmanov Date: Sun, 20 Apr 2025 16:52:29 +0200 Subject: [PATCH 10/22] JS Debug using vscode-js-debug --- init.lua | 4 +- lua/kickstart/plugins/debug.lua | 248 ++++++++++++++++++++++++++------ 2 files changed, 209 insertions(+), 43 deletions(-) diff --git a/init.lua b/init.lua index fc5052013ae..4418dd192ca 100644 --- a/init.lua +++ b/init.lua @@ -254,7 +254,7 @@ require('lazy').setup({ -- Document existing key chains spec = { { 'c', group = '[C]ode', mode = { 'n', 'x' } }, - { 'd', group = '[D]ocument' }, + { 'd', group = '[D]ebug/Document' }, { 'g', group = '[G]it' }, { 'r', group = '[R]ename' }, { 's', group = '[S]earch' }, @@ -479,7 +479,7 @@ require('lazy').setup({ -- Fuzzy find all the symbols in your current document. -- Symbols are things like variables, functions, types, etc. - map('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') + map('dS', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') -- Fuzzy find all the symbols in your current workspace. -- Similar to document symbols, except searches over your entire project. diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 0e313381b39..9557e084677 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -26,62 +26,143 @@ return { -- Web { - 'microsoft/vscode-chrome-debug', - version = '1.x', - build = 'npm i && npm run build', + 'microsoft/vscode-js-debug', + -- TODO: check wheter vscode-js-debug has some "build dap server script in package.json" + build = 'npm i && npx gulp dapDebugServer', }, }, keys = { - -- Basic debugging keymaps, feel free to change to your liking! + { -- NOTE: Temporary solution to open chrome - until I'll figure out how to run it automatically + 'dd', + ':!open -a "Google Chrome" --args --remote-debugging-port=9222', + }, + -- TODO: change lua formatter to keep such entries in one line { - '', + 'dB', + function() + require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') + end, + desc = 'Breakpoint Condition', + }, + { + 'db', + function() + require('dap').toggle_breakpoint() + end, + desc = 'Toggle Breakpoint', + }, + { + 'dc', function() require('dap').continue() end, - desc = 'Debug: Start/Continue', + desc = 'Run/Continue', + }, + { + 'da', + function() + require('dap').continue { before = get_args } + end, + desc = 'Run with Args', + }, + { + 'dC', + function() + require('dap').run_to_cursor() + end, + desc = 'Run to Cursor', }, { - '', + 'dg', + function() + require('dap').goto_() + end, + desc = 'Go to Line (No Execute)', + }, + { + 'di', function() require('dap').step_into() end, - desc = 'Debug: Step Into', + desc = 'Step Into', }, { - '', + 'dj', function() - require('dap').step_over() + require('dap').down() end, - desc = 'Debug: Step Over', + desc = 'Down', }, { - '', + 'dk', + function() + require('dap').up() + end, + desc = 'Up', + }, + { + 'dl', + function() + require('dap').run_last() + end, + desc = 'Run Last', + }, + { + 'do', function() require('dap').step_out() end, - desc = 'Debug: Step Out', + desc = 'Step Out', + }, + { + 'dO', + function() + require('dap').step_over() + end, + desc = 'Step Over', + }, + { + 'dP', + function() + require('dap').pause() + end, + desc = 'Pause', }, -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. { - '', + 'dl', function() require('dapui').toggle() end, desc = 'Debug: See last session result.', }, { - 'b', + 'dr', function() - require('dap').toggle_breakpoint() + require('dap').repl.toggle() end, - desc = 'Debug: Toggle Breakpoint', + desc = 'Toggle REPL', }, { - 'B', + 'ds', function() - require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') + require('dap').session() + end, + desc = 'Session', + }, + { + 'dt', + function() + require('dap').terminate() + end, + desc = 'Terminate', + }, + { + 'dw', + function() + require('dap.ui.widgets').hover() end, - desc = 'Debug: Set Breakpoint', + desc = 'Widgets', }, }, config = function() @@ -143,28 +224,113 @@ return { dap.listeners.before.event_terminated['dapui_config'] = dapui.close dap.listeners.before.event_exited['dapui_config'] = dapui.close - dap.adapters.chrome = { - type = 'executable', - command = 'node', - args = { vim.fn.stdpath 'data' .. '/lazy/vscode-chrome-debug/out/src/chromeDebug.js' }, -- TODO adjust - } + for _, adapterType in ipairs { 'node', 'chrome', 'msedge' } do + local pwaType = 'pwa-' .. adapterType - -- TODO: Figure out how to launch chrome automatically - -- TODO: Figure out why I have two additional configurations when starting debugger: "Launch Chrome Debugger", "Debug App Two" - -- now I have to do "open -a "Google Chrome" --args --remote-debugging-port=9222" - dap.configurations.typescript = { - { - name = 'Attach to Chrome', - type = 'chrome', - request = 'attach', - program = '${file}', - cwd = vim.fn.getcwd(), - sourceMaps = true, - protocol = 'inspector', - port = 9222, - webRoot = '${workspaceFolder}', - }, - } + dap.adapters[pwaType] = { + type = 'server', + host = 'localhost', + port = '${port}', + executable = { + command = 'node', + args = { + vim.fn.stdpath 'data' .. '/lazy/vscode-js-debug/dist/src/dapDebugServer.js', + '${port}', + }, + }, + } + + -- this allow us to handle launch.json configurations + -- which specify type as "node" or "chrome" or "msedge" + dap.adapters[adapterType] = function(cb, config) + local nativeAdapter = dap.adapters[pwaType] + + config.type = pwaType + + if type(nativeAdapter) == 'function' then + nativeAdapter(cb, config) + else + cb(nativeAdapter) + end + end + end + + local enter_launch_url = function() + local co = coroutine.running() + return coroutine.create(function() + vim.ui.input({ prompt = 'Enter URL: ', default = 'http://localhost:4201' }, function(url) + if url == nil or url == '' then + return + else + coroutine.resume(co, url) + end + end) + end) + end + + for _, language in ipairs { 'typescript', 'javascript', 'typescriptreact', 'javascriptreact', 'vue' } do + dap.configurations[language] = { + -- NOTE: Tested configs + -- NOTE: inspired by https://github.com/StevanFreeborn/nvim-config/blob/main/lua/plugins/debugging.lua + -- TODO: Figure out why I have two additional configurations when starting debugger: "Launch Chrome Debugger", "Debug App Two" + -- now I have to do "open -a "Google Chrome" --args --remote-debugging-port=9222" + { + -- TODO: Figure out how to launch chrome automatically + -- url = enter_launch_url, + name = 'Attach to Chrome', + type = 'pwa-chrome', + request = 'attach', + program = '${file}', + cwd = vim.fn.getcwd(), + sourceMaps = true, + protocol = 'inspector', + port = 9222, + webRoot = '${workspaceFolder}', + }, + { + -- TODO: This config launches chrome, breapoints are working, but it's very slow for some reason + type = 'pwa-chrome', + request = 'launch', + name = 'Launch Chrome (nvim-dap)', + url = enter_launch_url, + webRoot = '${workspaceFolder}', + sourceMaps = true, + }, + + -- NOTE: Untested configs + { + type = 'pwa-node', + request = 'launch', + name = 'Launch file using Node.js (nvim-dap)', + program = '${file}', + cwd = '${workspaceFolder}', + }, + { + type = 'pwa-node', + request = 'attach', + name = 'Attach to process using Node.js (nvim-dap)', + processId = require('dap.utils').pick_process, + cwd = '${workspaceFolder}', + }, + -- requires ts-node to be installed globally or locally + { + type = 'pwa-node', + request = 'launch', + name = 'Launch file using Node.js with ts-node/register (nvim-dap)', + program = '${file}', + cwd = '${workspaceFolder}', + runtimeArgs = { '-r', 'ts-node/register' }, + }, + { + type = 'pwa-msedge', + request = 'launch', + name = 'Launch Edge (nvim-dap)', + url = enter_launch_url, + webRoot = '${workspaceFolder}', + sourceMaps = true, + }, + } + end -- Install golang specific config require('dap-go').setup { From b85254ead6cc967cf948cfe3a2244c22a2bbc860 Mon Sep 17 00:00:00 2001 From: Ruslan Rakhmanov Date: Sun, 20 Apr 2025 17:37:55 +0200 Subject: [PATCH 11/22] Cleaned up TODOs, removed lazy-lock.json from gitignore --- .gitignore | 2 +- lazy-lock.json | 38 +++++++++++++++++++++++++++++++++ lua/kickstart/plugins/debug.lua | 4 ++-- 3 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 lazy-lock.json diff --git a/.gitignore b/.gitignore index 005b535b606..34477f08fdf 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ test.sh nvim spell/ -lazy-lock.json +# lazy-lock.json diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 00000000000..f7ac0cd0dfa --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,38 @@ +{ + "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" }, + "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "031e6ba70b0ad5eee49fd2120ff7a2e325b17fa7" }, + "cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "conform.nvim": { "branch": "master", "commit": "6632e7d788a85bf8405ea0c812d343fc308b7b8c" }, + "everforest-nvim": { "branch": "main", "commit": "135cc21a45756e688dd1a3cbeb1c80a04b569b46" }, + "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, + "gitsigns.nvim": { "branch": "main", "commit": "02eafb1273afec94447f66d1a43fc5e477c2ab8a" }, + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, + "lazygit.nvim": { "branch": "main", "commit": "b9eae3badab982e71abab96d3ee1d258f0c07961" }, + "leap.nvim": { "branch": "main", "commit": "8a0efa79133fee211017d769c8031512192008b3" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "4c2cdc69d69fe00c15ae8648f7e954d99e5de3ea" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "1255518cb067e038a4755f5cb3e980f79b6ab89c" }, + "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, + "mini.nvim": { "branch": "main", "commit": "c404fc5717866ff738aadeeb1f54ab8ed270ae1e" }, + "neo-tree.nvim": { "branch": "main", "commit": "9b5d67119c46e3262ffe1508fe6d8540b79ad75d" }, + "nui.nvim": { "branch": "main", "commit": "8d3bce9764e627b62b07424e0df77f680d47ffdb" }, + "nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" }, + "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, + "nvim-dap": { "branch": "master", "commit": "98bf130702eaafad8567c0e3ea1171c2552d58bb" }, + "nvim-dap-go": { "branch": "main", "commit": "8763ced35b19c8dc526e04a70ab07c34e11ad064" }, + "nvim-dap-ui": { "branch": "master", "commit": "881a69e25bd6658864fab47450025490b74be878" }, + "nvim-lspconfig": { "branch": "master", "commit": "32b6a6449aaba11461fffbb596dd6310af79eea4" }, + "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, + "nvim-treesitter": { "branch": "master", "commit": "684eeac91ed8e297685a97ef70031d19ac1de25a" }, + "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, + "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, + "telescope.nvim": { "branch": "master", "commit": "a4ed82509cecc56df1c7138920a1aeaf246c0ac5" }, + "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, + "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, + "vscode-js-debug": { "branch": "main", "commit": "41c802115c16b25c5a4c3573c1b38b4ba58875e3" }, + "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } +} diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 9557e084677..37f1b989fd8 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -272,10 +272,10 @@ return { dap.configurations[language] = { -- NOTE: Tested configs -- NOTE: inspired by https://github.com/StevanFreeborn/nvim-config/blob/main/lua/plugins/debugging.lua - -- TODO: Figure out why I have two additional configurations when starting debugger: "Launch Chrome Debugger", "Debug App Two" - -- now I have to do "open -a "Google Chrome" --args --remote-debugging-port=9222" + -- NOTE: If debug launch suggests strange entries which are not provided by setup (like I had "Launch Chrome Debugger") - check ".vscode" folder of project; launch.config from there is automatically added { -- TODO: Figure out how to launch chrome automatically + -- now I have to do "open -a "Google Chrome" --args --remote-debugging-port=9222" -- url = enter_launch_url, name = 'Attach to Chrome', type = 'pwa-chrome', From 8a3fe4fb0bd9e414420ad3131f78653c20c062cc Mon Sep 17 00:00:00 2001 From: Ruslan Rakhmanov Date: Sun, 20 Apr 2025 19:50:59 +0200 Subject: [PATCH 12/22] Moved rename to "code" section --- init.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 4418dd192ca..455bd568b08 100644 --- a/init.lua +++ b/init.lua @@ -256,7 +256,6 @@ require('lazy').setup({ { 'c', group = '[C]ode', mode = { 'n', 'x' } }, { 'd', group = '[D]ebug/Document' }, { 'g', group = '[G]it' }, - { 'r', group = '[R]ename' }, { 's', group = '[S]earch' }, { 'w', group = '[W]orkspace' }, { 't', group = '[T]oggle' }, @@ -487,7 +486,7 @@ require('lazy').setup({ -- Rename the variable under your cursor. -- Most Language Servers support renaming across files, etc. - map('rn', vim.lsp.buf.rename, '[R]e[n]ame') + map('cr', vim.lsp.buf.rename, '[R]ename') -- Execute a code action, usually your cursor needs to be on top of an error -- or a suggestion from your LSP for this to activate. From 2188a51eb0a6d11264f054d7253208828e1bbd25 Mon Sep 17 00:00:00 2001 From: Ruslan Rakhmanov Date: Sun, 4 May 2025 17:42:59 +0200 Subject: [PATCH 13/22] Small improvements --- init.lua | 3 ++- lazy-lock.json | 1 + lua/kickstart/plugins/debug.lua | 2 +- lua/kickstart/plugins/neo-tree.lua | 5 +++++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 455bd568b08..ffa8574577b 100644 --- a/init.lua +++ b/init.lua @@ -772,6 +772,7 @@ require('lazy').setup({ end, formatters_by_ft = { lua = { 'stylua' }, + htmlangular = { 'prettier' }, -- Conform can also run multiple formatters sequentially -- python = { "isort", "black" }, -- @@ -915,7 +916,7 @@ require('lazy').setup({ config = function() require('everforest').setup { background = 'hard', - ui_contrast = 'low', + ui_contrast = 'high', } -- Load the colorscheme here. diff --git a/lazy-lock.json b/lazy-lock.json index f7ac0cd0dfa..a6a2a3ab3d3 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -7,6 +7,7 @@ "conform.nvim": { "branch": "master", "commit": "6632e7d788a85bf8405ea0c812d343fc308b7b8c" }, "everforest-nvim": { "branch": "main", "commit": "135cc21a45756e688dd1a3cbeb1c80a04b569b46" }, "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, + "github-theme": { "branch": "main", "commit": "c106c9472154d6b2c74b74565616b877ae8ed31d" }, "gitsigns.nvim": { "branch": "main", "commit": "02eafb1273afec94447f66d1a43fc5e477c2ab8a" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 37f1b989fd8..55f2f45a205 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -34,7 +34,7 @@ return { keys = { { -- NOTE: Temporary solution to open chrome - until I'll figure out how to run it automatically 'dd', - ':!open -a "Google Chrome" --args --remote-debugging-port=9222', + ':!open -a "Google Chrome" --args --remote-debugging-port=9222', }, -- TODO: change lua formatter to keep such entries in one line { diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua index bd4422695aa..13fa6607cef 100644 --- a/lua/kickstart/plugins/neo-tree.lua +++ b/lua/kickstart/plugins/neo-tree.lua @@ -14,6 +14,11 @@ return { { '\\', ':Neotree reveal', desc = 'NeoTree reveal', silent = true }, }, opts = { + default_component_configs = { + indent = { + indent_size = 1, + }, + }, filesystem = { window = { mappings = { From 887b6da7969d7589f06d09b83010107cab4271a2 Mon Sep 17 00:00:00 2001 From: Ruslan Rakhmanov Date: Thu, 8 May 2025 10:12:55 +0200 Subject: [PATCH 14/22] Telescope grepstring for visual selection, enter mode for blink autocompletion --- init.lua | 5 +++-- lazy-lock.json | 7 +------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/init.lua b/init.lua index ae5b3b9c455..cb6a7cb6e99 100644 --- a/init.lua +++ b/init.lua @@ -255,7 +255,7 @@ require('lazy').setup({ spec = { { 'd', group = '[D]ebug/Document' }, { 'g', group = '[G]it' }, - { 's', group = '[S]earch' }, + { 's', group = '[S]earch', mode = { 'n', 'v' } }, { 't', group = '[T]oggle' }, { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, { 'm', group = '[M]isc' }, @@ -349,6 +349,7 @@ require('lazy').setup({ vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) vim.keymap.set('n', 'ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' }) vim.keymap.set('n', 'sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) + vim.keymap.set('v', 'sv', builtin.grep_string, { desc = '[S]earch current [V]isual selection' }) 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' }) @@ -837,7 +838,7 @@ require('lazy').setup({ -- : Toggle signature help -- -- See :h blink-cmp-config-keymap for defining your own keymap - preset = 'default', + preset = 'enter', -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps diff --git a/lazy-lock.json b/lazy-lock.json index a6a2a3ab3d3..7d60c9b4852 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,13 +1,9 @@ { "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" }, - "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "031e6ba70b0ad5eee49fd2120ff7a2e325b17fa7" }, - "cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" }, - "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "blink.cmp": { "branch": "main", "commit": "4f38ce99a472932d5776337f08f7a8180f1f571a" }, "conform.nvim": { "branch": "master", "commit": "6632e7d788a85bf8405ea0c812d343fc308b7b8c" }, "everforest-nvim": { "branch": "main", "commit": "135cc21a45756e688dd1a3cbeb1c80a04b569b46" }, "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, - "github-theme": { "branch": "main", "commit": "c106c9472154d6b2c74b74565616b877ae8ed31d" }, "gitsigns.nvim": { "branch": "main", "commit": "02eafb1273afec94447f66d1a43fc5e477c2ab8a" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, @@ -21,7 +17,6 @@ "neo-tree.nvim": { "branch": "main", "commit": "9b5d67119c46e3262ffe1508fe6d8540b79ad75d" }, "nui.nvim": { "branch": "main", "commit": "8d3bce9764e627b62b07424e0df77f680d47ffdb" }, "nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" }, - "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, "nvim-dap": { "branch": "master", "commit": "98bf130702eaafad8567c0e3ea1171c2552d58bb" }, "nvim-dap-go": { "branch": "main", "commit": "8763ced35b19c8dc526e04a70ab07c34e11ad064" }, "nvim-dap-ui": { "branch": "master", "commit": "881a69e25bd6658864fab47450025490b74be878" }, From 38e05523b94eadbbbdbbd27fb154bf68898fb3c2 Mon Sep 17 00:00:00 2001 From: Ruslan Rakhmanov Date: Thu, 8 May 2025 11:05:24 +0200 Subject: [PATCH 15/22] Added trouble.nvim --- init.lua | 38 ++++++++++++++++++++++++++++++++++++++ lazy-lock.json | 1 + 2 files changed, 39 insertions(+) diff --git a/init.lua b/init.lua index cb6a7cb6e99..9b3cbf54987 100644 --- a/init.lua +++ b/init.lua @@ -1002,6 +1002,44 @@ require('lazy').setup({ end, }, + { + 'folke/trouble.nvim', + opts = {}, -- for default options, refer to the configuration section for custom setup. + cmd = 'Trouble', + keys = { + { + 'xx', + 'Trouble diagnostics toggle', + desc = 'Diagnostics (Trouble)', + }, + { + 'xX', + 'Trouble diagnostics toggle filter.buf=0', + desc = 'Buffer Diagnostics (Trouble)', + }, + { + 'cs', + 'Trouble symbols toggle focus=false', + desc = 'Symbols (Trouble)', + }, + { + 'cl', + 'Trouble lsp toggle focus=false win.position=right', + desc = 'LSP Definitions / references / ... (Trouble)', + }, + { + 'xL', + 'Trouble loclist toggle', + desc = 'Location List (Trouble)', + }, + { + 'xQ', + 'Trouble qflist toggle', + desc = 'Quickfix List (Trouble)', + }, + }, + }, + -- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the -- init.lua. If you want these files, they are in the repository, so you can just download them and -- place them in the correct locations. diff --git a/lazy-lock.json b/lazy-lock.json index 7d60c9b4852..c3d32b41741 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -28,6 +28,7 @@ "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "a4ed82509cecc56df1c7138920a1aeaf246c0ac5" }, "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, + "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, "vscode-js-debug": { "branch": "main", "commit": "41c802115c16b25c5a4c3573c1b38b4ba58875e3" }, "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } From d8aa0e5ed4af144c0b10ca89ac71fbb04aca9a66 Mon Sep 17 00:00:00 2001 From: Ruslan Rakhmanov Date: Thu, 8 May 2025 11:23:24 +0200 Subject: [PATCH 16/22] Added virtual lines for diagnostic errors --- init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init.lua b/init.lua index 9b3cbf54987..2fd57f12ef9 100644 --- a/init.lua +++ b/init.lua @@ -554,6 +554,9 @@ require('lazy').setup({ severity_sort = true, float = { border = 'rounded', source = 'if_many' }, underline = { severity = vim.diagnostic.severity.ERROR }, + virtual_lines = { + current_line = true, + }, signs = vim.g.have_nerd_font and { text = { [vim.diagnostic.severity.ERROR] = '󰅚 ', From 2c5855052195fc548b9a4faead5a63d927e2568c Mon Sep 17 00:00:00 2001 From: Ruslan Rakhmanov Date: Tue, 20 May 2025 07:39:16 +0200 Subject: [PATCH 17/22] Git blame added --- init.lua | 10 ++++++++++ lazy-lock.json | 32 ++++++++++++++++---------------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/init.lua b/init.lua index 2fd57f12ef9..cb482c4dfaf 100644 --- a/init.lua +++ b/init.lua @@ -960,6 +960,16 @@ require('lazy').setup({ end, }, + { + 'FabijanZulj/blame.nvim', + lazy = false, + config = function() + require('blame').setup {} + + vim.keymap.set('n', 'gb', 'BlameToggle', { desc = 'Toggle blame' }) + end, + }, + { -- Highlight, edit, and navigate code 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', diff --git a/lazy-lock.json b/lazy-lock.json index c3d32b41741..38527142eab 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,28 +1,29 @@ { - "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, + "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, + "blame.nvim": { "branch": "main", "commit": "b87b8c820e4cec06fbbd2f946b7b35c45906ee0c" }, "blink.cmp": { "branch": "main", "commit": "4f38ce99a472932d5776337f08f7a8180f1f571a" }, - "conform.nvim": { "branch": "master", "commit": "6632e7d788a85bf8405ea0c812d343fc308b7b8c" }, - "everforest-nvim": { "branch": "main", "commit": "135cc21a45756e688dd1a3cbeb1c80a04b569b46" }, + "conform.nvim": { "branch": "master", "commit": "372fc521f8421b7830ea6db4d6ea3bae1c77548c" }, + "everforest-nvim": { "branch": "main", "commit": "2eb7c348f880ba93de4d98cae049c9441f5d4d49" }, "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, - "gitsigns.nvim": { "branch": "main", "commit": "02eafb1273afec94447f66d1a43fc5e477c2ab8a" }, + "gitsigns.nvim": { "branch": "main", "commit": "43b0c856ae5f32a195d83f4a27fe21d63e6c966c" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, "lazygit.nvim": { "branch": "main", "commit": "b9eae3badab982e71abab96d3ee1d258f0c07961" }, - "leap.nvim": { "branch": "main", "commit": "8a0efa79133fee211017d769c8031512192008b3" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, + "leap.nvim": { "branch": "main", "commit": "2b68ddc0802bd295e64c9e2e75f18f755e50dbcc" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "d39a75bbce4b8aad5d627191ea915179c77c100f" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "4c2cdc69d69fe00c15ae8648f7e954d99e5de3ea" }, - "mason-tool-installer.nvim": { "branch": "main", "commit": "1255518cb067e038a4755f5cb3e980f79b6ab89c" }, - "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, - "mini.nvim": { "branch": "main", "commit": "c404fc5717866ff738aadeeb1f54ab8ed270ae1e" }, - "neo-tree.nvim": { "branch": "main", "commit": "9b5d67119c46e3262ffe1508fe6d8540b79ad75d" }, - "nui.nvim": { "branch": "main", "commit": "8d3bce9764e627b62b07424e0df77f680d47ffdb" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "aafae207d5a2a28c59c9d478d8581c2739135d09" }, + "mason.nvim": { "branch": "main", "commit": "7c7318e8bae7e3536ef6b9e86b9e38e74f2e125e" }, + "mini.nvim": { "branch": "main", "commit": "6105b69d79fef0afed5ed576081b1997ef2b4be1" }, + "neo-tree.nvim": { "branch": "main", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" }, + "nui.nvim": { "branch": "main", "commit": "f535005e6ad1016383f24e39559833759453564e" }, "nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" }, - "nvim-dap": { "branch": "master", "commit": "98bf130702eaafad8567c0e3ea1171c2552d58bb" }, + "nvim-dap": { "branch": "master", "commit": "8df427aeba0a06c6577dc3ab82de3076964e3b8d" }, "nvim-dap-go": { "branch": "main", "commit": "8763ced35b19c8dc526e04a70ab07c34e11ad064" }, - "nvim-dap-ui": { "branch": "master", "commit": "881a69e25bd6658864fab47450025490b74be878" }, - "nvim-lspconfig": { "branch": "master", "commit": "32b6a6449aaba11461fffbb596dd6310af79eea4" }, + "nvim-dap-ui": { "branch": "master", "commit": "73a26abf4941aa27da59820fd6b028ebcdbcf932" }, + "nvim-lspconfig": { "branch": "master", "commit": "4bc481b6f0c0cf3671fc894debd0e00347089a4e" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, - "nvim-treesitter": { "branch": "master", "commit": "684eeac91ed8e297685a97ef70031d19ac1de25a" }, + "nvim-treesitter": { "branch": "master", "commit": "28d480e0624b259095e56f353ec911f9f2a0f404" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, @@ -30,6 +31,5 @@ "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, - "vscode-js-debug": { "branch": "main", "commit": "41c802115c16b25c5a4c3573c1b38b4ba58875e3" }, "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } } From 97ed05cad3ffb7d0d205e334af37b38328dd650c Mon Sep 17 00:00:00 2001 From: Ruslan Rakhmanov Date: Tue, 27 May 2025 16:06:32 +0200 Subject: [PATCH 18/22] Linter and prettier for TS --- init.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/init.lua b/init.lua index cb482c4dfaf..af888a2e3ff 100644 --- a/init.lua +++ b/init.lua @@ -773,6 +773,8 @@ require('lazy').setup({ formatters_by_ft = { lua = { 'stylua' }, htmlangular = { 'prettier' }, + angular = { 'prettier' }, + typescript = { 'prettier', 'eslint_d' }, -- Conform can also run multiple formatters sequentially -- python = { "isort", "black" }, -- @@ -957,6 +959,8 @@ require('lazy').setup({ }, config = function() vim.keymap.set('n', 'gg', 'LazyGit', { desc = 'LazyGit' }) + + require('telescope').load_extension 'lazygit' end, }, From 4ee16398a1de60b2967c8cc585f75d742c021d80 Mon Sep 17 00:00:00 2001 From: Ruslan Rakhmanov Date: Wed, 28 May 2025 15:30:34 +0200 Subject: [PATCH 19/22] Added oil.nvim --- init.lua | 15 +++++++++++++++ lazy-lock.json | 2 ++ 2 files changed, 17 insertions(+) diff --git a/init.lua b/init.lua index af888a2e3ff..dcac96d76a6 100644 --- a/init.lua +++ b/init.lua @@ -1057,6 +1057,21 @@ require('lazy').setup({ }, }, + { -- Oil + 'stevearc/oil.nvim', + ---@module 'oil' + ---@type oil.SetupOpts + opts = {}, + keys = { + { '-', 'Oil --float', desc = 'Oil' }, + }, + -- Optional dependencies + dependencies = { { 'echasnovski/mini.icons', opts = {} } }, + -- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if you prefer nvim-web-devicons + -- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations. + lazy = false, + }, + -- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the -- init.lua. If you want these files, they are in the repository, so you can just download them and -- place them in the correct locations. diff --git a/lazy-lock.json b/lazy-lock.json index 38527142eab..b222b229038 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -14,6 +14,7 @@ "mason-nvim-dap.nvim": { "branch": "main", "commit": "4c2cdc69d69fe00c15ae8648f7e954d99e5de3ea" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "aafae207d5a2a28c59c9d478d8581c2739135d09" }, "mason.nvim": { "branch": "main", "commit": "7c7318e8bae7e3536ef6b9e86b9e38e74f2e125e" }, + "mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" }, "mini.nvim": { "branch": "main", "commit": "6105b69d79fef0afed5ed576081b1997ef2b4be1" }, "neo-tree.nvim": { "branch": "main", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" }, "nui.nvim": { "branch": "main", "commit": "f535005e6ad1016383f24e39559833759453564e" }, @@ -24,6 +25,7 @@ "nvim-lspconfig": { "branch": "master", "commit": "4bc481b6f0c0cf3671fc894debd0e00347089a4e" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-treesitter": { "branch": "master", "commit": "28d480e0624b259095e56f353ec911f9f2a0f404" }, + "oil.nvim": { "branch": "master", "commit": "685cdb4ffa74473d75a1b97451f8654ceeab0f4a" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, From ecacbd24f805b0c7bd4f15efbc5854238b550f3e Mon Sep 17 00:00:00 2001 From: Ruslan Rakhmanov Date: Wed, 28 May 2025 19:44:43 +0200 Subject: [PATCH 20/22] Added hardtime and nvim-notify --- init.lua | 15 +++++++++++++++ lazy-lock.json | 2 ++ 2 files changed, 17 insertions(+) diff --git a/init.lua b/init.lua index dcac96d76a6..2b46aef84f2 100644 --- a/init.lua +++ b/init.lua @@ -1072,6 +1072,19 @@ require('lazy').setup({ lazy = false, }, + { -- Hardtime + 'm4xshen/hardtime.nvim', + lazy = false, + dependencies = { 'MunifTanjim/nui.nvim' }, + opts = {}, + }, + + { -- nvim-notify + 'rcarriga/nvim-notify', + lazy = false, + opts = {}, + }, + -- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the -- init.lua. If you want these files, they are in the repository, so you can just download them and -- place them in the correct locations. @@ -1120,5 +1133,7 @@ require('lazy').setup({ }, }) +vim.notify = require 'notify' + -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et diff --git a/lazy-lock.json b/lazy-lock.json index b222b229038..8e65bee1ec8 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -6,6 +6,7 @@ "everforest-nvim": { "branch": "main", "commit": "2eb7c348f880ba93de4d98cae049c9441f5d4d49" }, "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, "gitsigns.nvim": { "branch": "main", "commit": "43b0c856ae5f32a195d83f4a27fe21d63e6c966c" }, + "hardtime.nvim": { "branch": "main", "commit": "1a3648a53002c2911ccb88e9c9f876cdc6c43ad6" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, "lazygit.nvim": { "branch": "main", "commit": "b9eae3badab982e71abab96d3ee1d258f0c07961" }, @@ -24,6 +25,7 @@ "nvim-dap-ui": { "branch": "master", "commit": "73a26abf4941aa27da59820fd6b028ebcdbcf932" }, "nvim-lspconfig": { "branch": "master", "commit": "4bc481b6f0c0cf3671fc894debd0e00347089a4e" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, + "nvim-notify": { "branch": "master", "commit": "b5825cf9ee881dd8e43309c93374ed5b87b7a896" }, "nvim-treesitter": { "branch": "master", "commit": "28d480e0624b259095e56f353ec911f9f2a0f404" }, "oil.nvim": { "branch": "master", "commit": "685cdb4ffa74473d75a1b97451f8654ceeab0f4a" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, From f20c465628715b3909f0b3ec933ae9e1c3fac4de Mon Sep 17 00:00:00 2001 From: Ruslan Rakhmanov Date: Wed, 28 May 2025 19:47:35 +0200 Subject: [PATCH 21/22] Enabled nerd fonts --- init.lua | 2 +- lazy-lock.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 2b46aef84f2..997db640fbb 100644 --- a/init.lua +++ b/init.lua @@ -12,7 +12,7 @@ vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = false +vim.g.have_nerd_font = true -- [[ Setting options ]] -- See `:help vim.opt` diff --git a/lazy-lock.json b/lazy-lock.json index 8e65bee1ec8..31bf35f90ab 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -27,6 +27,7 @@ "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-notify": { "branch": "master", "commit": "b5825cf9ee881dd8e43309c93374ed5b87b7a896" }, "nvim-treesitter": { "branch": "master", "commit": "28d480e0624b259095e56f353ec911f9f2a0f404" }, + "nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" }, "oil.nvim": { "branch": "master", "commit": "685cdb4ffa74473d75a1b97451f8654ceeab0f4a" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, From 1a67b5a87cabd0248509c2361d14ced845b3073a Mon Sep 17 00:00:00 2001 From: Ruslan Rakhmanov Date: Fri, 6 Jun 2025 21:58:19 +0200 Subject: [PATCH 22/22] Added precognition --- init.lua | 33 ++++++++++++++++++++++++++++++++- lazy-lock.json | 1 + 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 997db640fbb..8ebe5c8d34c 100644 --- a/init.lua +++ b/init.lua @@ -895,7 +895,7 @@ require('lazy').setup({ priority = 1000, -- Make sure to load this before all the other start plugins. config = function() require('everforest').setup { - background = 'hard', + background = 'soft', ui_contrast = 'high', } @@ -1085,6 +1085,37 @@ require('lazy').setup({ opts = {}, }, + { + 'tris203/precognition.nvim', + --event = "VeryLazy", + opts = { + -- startVisible = true, + -- showBlankVirtLine = true, + -- highlightColor = { link = "Comment" }, + -- hints = { + -- Caret = { text = "^", prio = 2 }, + -- Dollar = { text = "$", prio = 1 }, + -- MatchingPair = { text = "%", prio = 5 }, + -- Zero = { text = "0", prio = 1 }, + -- w = { text = "w", prio = 10 }, + -- b = { text = "b", prio = 9 }, + -- e = { text = "e", prio = 8 }, + -- W = { text = "W", prio = 7 }, + -- B = { text = "B", prio = 6 }, + -- E = { text = "E", prio = 5 }, + -- }, + -- gutterHints = { + -- G = { text = "G", prio = 10 }, + -- gg = { text = "gg", prio = 9 }, + -- PrevParagraph = { text = "{", prio = 8 }, + -- NextParagraph = { text = "}", prio = 8 }, + -- }, + -- disabled_fts = { + -- "startify", + -- }, + }, + }, + -- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the -- init.lua. If you want these files, they are in the repository, so you can just download them and -- place them in the correct locations. diff --git a/lazy-lock.json b/lazy-lock.json index 31bf35f90ab..1b551d11dcd 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -30,6 +30,7 @@ "nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" }, "oil.nvim": { "branch": "master", "commit": "685cdb4ffa74473d75a1b97451f8654ceeab0f4a" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, + "precognition.nvim": { "branch": "main", "commit": "80ac0a99064eba71894dd164e891cc5d7e05827e" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "a4ed82509cecc56df1c7138920a1aeaf246c0ac5" },