From 5e0c152611a8cd98b4556dc159bde8b7184ae14c Mon Sep 17 00:00:00 2001 From: gabriellecronofy <140393993+gabriellecronofy@users.noreply.github.com> Date: Thu, 25 Apr 2024 14:27:08 +0100 Subject: [PATCH 1/5] Autopairs plugin update to auto end. --- init.lua | 10 +++++----- lua/kickstart/plugins/autopairs.lua | 7 ++++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/init.lua b/init.lua index 036eefb8c3b..cf14f69fc50 100644 --- a/init.lua +++ b/init.lua @@ -374,10 +374,10 @@ require('lazy').setup({ local builtin = require 'telescope.builtin' vim.keymap.set('n', 'sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) vim.keymap.set('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) - vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) + vim.keymap.set('n', 'f', 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('n', 'sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) + vim.keymap.set('n', 'F', 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)' }) @@ -874,11 +874,11 @@ require('lazy').setup({ -- Uncomment any of the lines below to enable them (you will need to restart nvim). -- -- require 'kickstart.plugins.debug', - -- require 'kickstart.plugins.indent_line', + 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 + 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` -- This is the easiest way to modularize your config. diff --git a/lua/kickstart/plugins/autopairs.lua b/lua/kickstart/plugins/autopairs.lua index 87a7e5ffa2e..f0cde4f3325 100644 --- a/lua/kickstart/plugins/autopairs.lua +++ b/lua/kickstart/plugins/autopairs.lua @@ -5,12 +5,17 @@ return { 'windwp/nvim-autopairs', event = 'InsertEnter', -- Optional dependency - dependencies = { 'hrsh7th/nvim-cmp' }, + dependencies = { 'hrsh7th/nvim-cmp', 'RRethy/nvim-treesitter-endwise' }, config = function() require('nvim-autopairs').setup {} -- If you want to automatically add `(` after selecting a function or method local cmp_autopairs = require 'nvim-autopairs.completion.cmp' local cmp = require 'cmp' cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done()) + require('nvim-treesitter.configs').setup { + endwise = { + enable = true, + }, + } end, } From 1e445e999b4ff88c05668b27b3b25e5599f2dac4 Mon Sep 17 00:00:00 2001 From: gabriellecronofy Date: Thu, 4 Jul 2024 16:35:30 +0100 Subject: [PATCH 2/5] . --- init.lua | 88 ++++++++++++++++++++++++++++++++----- lua/custom/plugins/init.lua | 42 +++++++++++++++++- 2 files changed, 117 insertions(+), 13 deletions(-) diff --git a/init.lua b/init.lua index cf14f69fc50..85ba02e77e5 100644 --- a/init.lua +++ b/init.lua @@ -227,19 +227,80 @@ vim.opt.rtp:prepend(lazypath) require('lazy').setup({ -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically + { + 'ruifm/gitlinker.nvim', + dependencies = 'nvim-lua/plenary.nvim', + event = 'VeryLazy', + opts = { mapping = 'gl' }, + }, - -- NOTE: Plugins can also be added by using a table, - -- with the first argument being the link and the following - -- keys can be used to configure plugin behavior/loading/etc. - -- - -- Use `opts = {}` to force a plugin to be loaded. - -- - -- This is equivalent to: - -- require('Comment').setup({}) + { + 'ruanyl/vim-gh-line', + }, + { + 'klen/nvim-test', + config = function() + -- NOTE: Plugins can also be added by using a table, + -- with the first argument being the link and the following + -- keys can be used to configure plugin behavior/loading/etc. + -- + -- Use `opts = {}` to force a plugin to be loaded. + -- + -- This is equivalent to: + -- require('Comment').setup({}) + require('nvim-test').setup { + run = true, -- run tests (using for debug) + commands_create = true, -- create commands (TestFile, TestLast, ...) + filename_modifier = ':.', -- modify filenames before tests run(:h filename-modifiers) + silent = false, -- less notifications + term = 'terminal', -- a terminal to run ("terminal"|"toggleterm") + termOpts = { + direction = 'vertical', -- terminal's direction ("horizontal"|"vertical"|"float") + width = 96, -- terminal's width (for vertical|float) + height = 24, -- terminal's height (for horizontal|float) + go_back = false, -- return focus to original window after executing + stopinsert = 'auto', -- exit from insert mode (true|false|"auto") + keep_one = true, -- keep only one terminal for testing + }, + runners = { -- setup tests runners + cs = 'nvim-test.runners.dotnet', + go = 'nvim-test.runners.go-test', + haskell = 'nvim-test.runners.hspec', + javascriptreact = 'nvim-test.runners.jest', + javascript = 'nvim-test.runners.jest', + lua = 'nvim-test.runners.busted', + python = 'nvim-test.runners.pytest', + ruby = 'nvim-test.runners.rspec', + rust = 'nvim-test.runners.cargo-test', + typescript = 'nvim-test.runners.jest', + typescriptreact = 'nvim-test.runners.jest', + }, + require('nvim-test.runners.jest'):setup { + command = '~/node_modules/.bin/jest', -- a command to run the test runner + args = { '--collectCoverage=false' }, -- default arguments + env = { CUSTOM_VAR = 'value' }, -- custom environment variables + + file_pattern = '\\v(__tests__/.*|(spec|test))\\.(js|jsx|coffee|ts|tsx)$', -- determine whether a file is a testfile + find_files = { '{name}.test.{ext}', '{name}.spec.{ext}' }, -- find testfile for a file + + filename_modifier = ':.', -- modify filename before tests run (:h filename-modifiers) + working_directory = nil, -- set working directory (cwd by default) + }, + require('nvim-test.runners.rspec'):setup { + command = 'bundle', + }, + } + end, + }, -- "gc" to comment visual regions/lines { 'numToStr/Comment.nvim', opts = {} }, - + { + 'stevearc/oil.nvim', + opts = {}, + -- Optional dependencies + dependencies = { 'nvim-tree/nvim-web-devicons' }, + }, -- Here is a more advanced example where we pass configuration -- options to `gitsigns.nvim`. This is equivalent to the following Lua: -- require('gitsigns').setup({ ... }) @@ -286,8 +347,10 @@ require('lazy').setup({ ['r'] = { name = '[R]ename', _ = 'which_key_ignore' }, ['s'] = { name = '[S]earch', _ = 'which_key_ignore' }, ['w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, - ['t'] = { name = '[T]oggle', _ = 'which_key_ignore' }, + -- ['t'] = { name = '[T]oggle', _ = 'which_key_ignore' }, ['h'] = { name = 'Git [H]unk', _ = 'which_key_ignore' }, + ['t'] = { 'TestFile', 'TestFile' }, + ['T'] = { 'TestNearest', 'TestNearest' }, } -- visual mode require('which-key').register({ @@ -567,6 +630,7 @@ require('lazy').setup({ local servers = { -- clangd = {}, -- gopls = {}, + solargraph = {}, -- pyright = {}, -- rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs @@ -575,7 +639,7 @@ require('lazy').setup({ -- https://github.com/pmizio/typescript-tools.nvim -- -- But for many setups, the LSP (`tsserver`) will work just fine - -- tsserver = {}, + tsserver = {}, -- lua_ls = { @@ -878,7 +942,7 @@ require('lazy').setup({ -- require 'kickstart.plugins.lint', require 'kickstart.plugins.autopairs', -- require 'kickstart.plugins.neo-tree', - require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps + -- 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` -- This is the easiest way to modularize your config. diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index be0eb9d8d7a..f9c4384ea2e 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -1,4 +1,44 @@ --- You can add your own plugins here or in other files in this directory! +-local vim = vim +local Plug = vim.fn['plug#'] + +vim.call('plug#begin') + +-- Shorthand notation for GitHub; translates to https://github.com/junegunn/vim-easy-align +Plug('junegunn/vim-easy-align') + +-- Any valid git URL is allowed +Plug('https://github.com/junegunn/seoul256.vim.git') + +-- Using a tagged release; wildcard allowed (requires git 1.9.2 or above) +Plug('fatih/vim-go', { ['tag'] = '*' }) + +-- Using a non-default branch +Plug('neoclide/coc.nvim', { ['branch'] = 'release' }) + +-- Use 'dir' option to install plugin in a non-default directory +Plug('junegunn/fzf', { ['dir'] = '~/.fzf' }) + +-- Post-update hook: run a shell command after installing or updating the plugin +Plug('junegunn/fzf', { ['dir'] = '~/.fzf', ['do'] = './install --all' }) + +-- Post-update hook can be a lambda expression +Plug('junegunn/fzf', { ['do'] = function() + vim.fn['fzf#install']() +end }) + +-- If the vim plugin is in a subdirectory, use 'rtp' option to specify its path +Plug('nsf/gocode', { ['rtp'] = 'vim' }) + +-- On-demand loading: loaded when the specified command is executed +Plug('preservim/nerdtree', { ['on'] = 'NERDTreeToggle' }) + +-- On-demand loading: loaded when a file with a specific file type is opened +Plug('tpope/vim-fireplace', { ['for'] = 'clojure' }) + +-- Unmanaged plugin (manually installed and updated) +Plug('~/my-prototype-plugin') + +vim.call('plug#end')- You can add your own plugins here or in other files in this directory! -- I promise not to create any merge conflicts in this directory :) -- -- See the kickstart.nvim README for more information From 999c24baaf3f20cf3e2f24f7510e512a017652f9 Mon Sep 17 00:00:00 2001 From: gabriellecronofy Date: Fri, 11 Jul 2025 11:22:08 +0100 Subject: [PATCH 3/5] Update to sw --- init.lua | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 74 insertions(+), 7 deletions(-) diff --git a/init.lua b/init.lua index 85ba02e77e5..3d6ec84c500 100644 --- a/init.lua +++ b/init.lua @@ -166,6 +166,7 @@ vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D] vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' }) vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' }) vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) +vim.diagnostic.config { virtual_text = false } -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier -- for people to discover. Otherwise, you normally need to press , which @@ -223,10 +224,36 @@ vim.opt.rtp:prepend(lazypath) -- To update plugins you can run -- :Lazy update -- +local projectionist_config = function () + vim.cmd [[ + let g:projectionist_heuristics ={ + \ "spec/*.rb": { + \ "app/*.rb": { "alternate": "spec/{}_spec.rb", "type": "source"}, + \ "app/javascript/src/*.js": { "alternate": "spec/javascript/{}.test.js", "type": "source"}, + \ "app/javascript/src/*.jsx": { "alternate": "spec/javascript/{}.test.js", "type": "source"}, + \ "lib/*.rb": { "alternate": "spec/{}_spec.rb", "type": "source"}, + \ "spec/*_spec.rb": { "alternate": ["app/{}.rb","lib/{}.rb"], "type": "test"}, + \ "spec/javascript/*.test.js": { "alternate": ["app/javascript/src/{}.js", "app/javascript/src/{}.jsx"], "type": "test"}, + \ }, + \ "*_test.go": { + \ "*.go": { "alternate": "{}_test.go", "type": "test" }, + \ "*_test.go": { "alternate": "{}.go", "type": "source" }, + \ }, + \ "*.erb": { + \ "*.html.erb": { "alternate": "{}.text.erb", "type": "text" }, + \ "*.text.erb": { "alternate": "{}.html.erb", "type": "html" }, + \ } + \} +]] +end + -- 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). + -- 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically + 'nvim-lua/plenary.nvim', + 'nvim-pack/nvim-spectre', { 'ruifm/gitlinker.nvim', dependencies = 'nvim-lua/plenary.nvim', @@ -234,6 +261,12 @@ require('lazy').setup({ opts = { mapping = 'gl' }, }, +{ + -- Map tools and actions based on the project + "tpope/vim-projectionist", + config = projectionist_config, + event = "VeryLazy", + }, { 'ruanyl/vim-gh-line', }, @@ -386,7 +419,12 @@ require('lazy').setup({ end, }, { 'nvim-telescope/telescope-ui-select.nvim' }, - + { + "nvim-telescope/telescope-live-grep-args.nvim" , + -- This will not install any breaking changes. + -- For major updates, this must be adjusted manually. + version = "^1.0.0", + }, -- Useful for getting pretty icons, but requires a Nerd Font. { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, }, @@ -432,6 +470,7 @@ require('lazy').setup({ -- Enable Telescope extensions if they are installed pcall(require('telescope').load_extension, 'fzf') pcall(require('telescope').load_extension, 'ui-select') + pcall(require('telescope').load_extension "live_grep_args") -- See `:help telescope.builtin` local builtin = require 'telescope.builtin' @@ -445,6 +484,18 @@ require('lazy').setup({ 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', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) + vim.keymap.set('n', 'S', 'lua require("spectre").toggle()', { + desc = "Toggle Spectre" + }) + vim.keymap.set('n', 'sw', 'lua require("spectre").open_visual({select_word=true})', { + desc = "Search current word" + }) + vim.keymap.set('v', 'sw', 'lua require("spectre").open_visual()', { + desc = "Search current word" + }) + vim.keymap.set('n', 'sp', 'lua require("spectre").open_file_search({select_word=true})', { + desc = "Search on current file" + }) -- Slightly advanced example of overriding default behavior and theme vim.keymap.set('n', '/', function() @@ -532,7 +583,7 @@ require('lazy').setup({ -- Jump to the definition of the word under your cursor. -- This is where a variable was first declared, or where a function is defined, etc. -- To jump back, press . - map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') + map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')init. -- Find references for the word under your cursor. map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') @@ -603,6 +654,26 @@ require('lazy').setup({ end, }) + local hardmode = true + if hardmode then + -- Show an error message if a disabled key is pressed + local msg = [[echohl Error | echo "KEY DISABLED" | echohl None]] + + -- Disable arrow keys in insert mode with a styled message + vim.api.nvim_set_keymap('i', '', '' .. msg, { noremap = true, silent = false }) + vim.api.nvim_set_keymap('i', '', '' .. msg, { noremap = true, silent = false }) + vim.api.nvim_set_keymap('i', '', '' .. msg, { noremap = true, silent = false }) + vim.api.nvim_set_keymap('i', '', '' .. msg, { noremap = true, silent = false }) + vim.api.nvim_set_keymap('i', '', '' .. msg, { noremap = true, silent = false }) + vim.api.nvim_set_keymap('i', '', '' .. msg, { noremap = true, silent = false }) + + -- Disable arrow keys in normal mode with a styled message + vim.api.nvim_set_keymap('n', '', msg, { noremap = true, silent = false }) + vim.api.nvim_set_keymap('n', '', msg, { noremap = true, silent = false }) + vim.api.nvim_set_keymap('n', '', msg, { noremap = true, silent = false }) + vim.api.nvim_set_keymap('n', '', msg, { noremap = true, silent = false }) + vim.api.nvim_set_keymap('n', '', msg, { noremap = true, silent = false }) + end vim.api.nvim_create_autocmd('LspDetach', { group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }), callback = function(event) @@ -708,11 +779,7 @@ require('lazy').setup({ -- Disable "format_on_save lsp_fallback" for languages that don't -- have a well standardized coding style. You can add additional -- languages here or re-enable it for the disabled ones. - local disable_filetypes = { c = true, cpp = true } - return { - timeout_ms = 500, - lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype], - } + return end, formatters_by_ft = { lua = { 'stylua' }, From b849cddfbdfac03f6fe1c732b9ccaa4c6a4ddd23 Mon Sep 17 00:00:00 2001 From: gabriellecronofy Date: Fri, 11 Jul 2025 11:23:47 +0100 Subject: [PATCH 4/5] Remove typo --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 3d6ec84c500..7a8f8c1e3e1 100644 --- a/init.lua +++ b/init.lua @@ -583,7 +583,7 @@ require('lazy').setup({ -- Jump to the definition of the word under your cursor. -- This is where a variable was first declared, or where a function is defined, etc. -- To jump back, press . - map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')init. + map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') -- Find references for the word under your cursor. map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') From 7e21eb0b0435596e22ad17a37ded720e695c59ae Mon Sep 17 00:00:00 2001 From: gabriellecronofy Date: Tue, 21 Apr 2026 12:09:56 +0100 Subject: [PATCH 5/5] WIP CLAUDE fix tsserver renamed to ts_ls in Mason/lspconfig --- init.lua | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 7a8f8c1e3e1..50409bbbcb2 100644 --- a/init.lua +++ b/init.lua @@ -205,6 +205,17 @@ vim.api.nvim_create_autocmd('TextYankPost', { end, }) +vim.api.nvim_create_autocmd('BufWritePre', { + desc = 'Remove trailing whitespace on save', + group = vim.api.nvim_create_augroup('kickstart-trim-whitespace', { clear = true }), + pattern = '*', + callback = function() + local save_cursor = vim.fn.getpos(".") + vim.cmd([[%s/\s\+$//e]]) + vim.fn.setpos(".", save_cursor) + end, +}) + -- [[ Install `lazy.nvim` plugin manager ]] -- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' @@ -479,6 +490,7 @@ require('lazy').setup({ vim.keymap.set('n', 'f', 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('n', 'gd', builtin.grep_string, { desc = '[G] to [D]efinition' }) vim.keymap.set('n', 'F', 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' }) @@ -709,8 +721,8 @@ require('lazy').setup({ -- Some languages (like typescript) have entire language plugins that can be useful: -- https://github.com/pmizio/typescript-tools.nvim -- - -- But for many setups, the LSP (`tsserver`) will work just fine - tsserver = {}, + -- But for many setups, the LSP (`ts_ls`) will work just fine + ts_ls = {}, -- lua_ls = { @@ -751,7 +763,7 @@ require('lazy').setup({ local server = servers[server_name] or {} -- This handles overriding only values explicitly passed -- by the server configuration above. Useful when disabling - -- certain features of an LSP (for example, turning off formatting for tsserver) + -- certain features of an LSP (for example, turning off formatting for ts_ls) server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) require('lspconfig')[server_name].setup(server) end,