From f7a2b45abe8f96107ebec06b45a4fd3a96db93d5 Mon Sep 17 00:00:00 2001 From: Simo Soini Date: Tue, 12 Dec 2023 14:58:31 +0200 Subject: [PATCH 01/20] Added my initial changes to kickstart.nvim. --- init.lua | 68 +++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 55 insertions(+), 13 deletions(-) diff --git a/init.lua b/init.lua index cf4a3790026..21135b1e325 100644 --- a/init.lua +++ b/init.lua @@ -69,6 +69,18 @@ vim.opt.rtp:prepend(lazypath) require('lazy').setup({ -- NOTE: First, some plugins that don't require any configuration + -- Navigation integration for tmux + 'christoomey/vim-tmux-navigator', + + -- Undotree for saving file editing history + 'mbbill/undotree', + + -- Automatic pairs for parentheses etc. + 'jiangmiao/auto-pairs', + + -- Github copilot + 'github/copilot.vim', + -- Git related plugins 'tpope/vim-fugitive', 'tpope/vim-rhubarb', @@ -76,6 +88,23 @@ require('lazy').setup({ -- Detect tabstop and shiftwidth automatically 'tpope/vim-sleuth', + -- Harpoon for fast navigation within a project + { + 'theprimeagen/harpoon', + config = function() + local mark = require('harpoon.mark') + local ui = require('harpoon.ui') + + vim.keymap.set('n', 'a', mark.add_file) + vim.keymap.set('n', '', ui.toggle_quick_menu) + + vim.keymap.set('n', '', function() ui.nav_file(1) end) + vim.keymap.set('n', '', function() ui.nav_file(2) end) + vim.keymap.set('n', '', function() ui.nav_file(3) end) + end + }, + + -- NOTE: This is where your plugins related to LSP can be installed. -- The configuration is done below. Search for lspconfig to find it below. { @@ -113,7 +142,7 @@ require('lazy').setup({ }, -- Useful plugin to show you pending keybinds. - { 'folke/which-key.nvim', opts = {} }, + { 'folke/which-key.nvim', opts = {} }, { -- Adds git related signs to the gutter, as well as utilities for managing changes 'lewis6991/gitsigns.nvim', @@ -190,11 +219,11 @@ require('lazy').setup({ }, { - -- Theme inspired by Atom - 'navarasu/onedark.nvim', + -- Theme + 'nyoom-engineering/oxocarbon.nvim', priority = 1000, config = function() - vim.cmd.colorscheme 'onedark' + vim.cmd.colorscheme 'oxocarbon' end, }, @@ -205,9 +234,9 @@ require('lazy').setup({ opts = { options = { icons_enabled = false, - theme = 'onedark', - component_separators = '|', - section_separators = '', + theme = 'oxocarbon', + -- component_separators = '|', + -- section_separators = '', }, }, }, @@ -257,7 +286,7 @@ require('lazy').setup({ -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart -- These are some example plugins that I've included in the kickstart repository. -- Uncomment any of the lines below to enable them. - -- require 'kickstart.plugins.autoformat', + require 'kickstart.plugins.autoformat', -- require 'kickstart.plugins.debug', -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` @@ -273,11 +302,15 @@ require('lazy').setup({ -- See `:help vim.o` -- NOTE: You can change these options as you wish! +-- Enable scrolloff +vim.opt.scrolloff = 8 + -- Set highlight on search vim.o.hlsearch = false --- Make line numbers default +-- Enable relative linenumbers vim.wo.number = true +vim.opt.relativenumber = true -- Enable mouse mode vim.o.mouse = 'a' @@ -326,6 +359,14 @@ vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnos vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) +-- Move highlighted lines up and down +vim.keymap.set('v', 'J', ':m ">+1gv=gv') +vim.keymap.set('v', 'K', ':m ">-2gv=gv') + +-- Center search results +vim.keymap.set('n', 'n', 'nzzzv') +vim.keymap.set('n', 'N', 'Nzzzv') + -- [[ Highlight on yank ]] -- See `:help vim.highlight.on_yank()` local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) @@ -426,7 +467,8 @@ vim.defer_fn(function() ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash' }, -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) - auto_install = false, + auto_install = true, + sync_install = false, highlight = { enable = true }, indent = { enable = true }, @@ -563,12 +605,12 @@ require('mason-lspconfig').setup() -- If you want to override the default filetypes that your language server will attach to you can -- define the property 'filetypes' to the map in question. local servers = { - -- clangd = {}, + clangd = {}, -- gopls = {}, -- pyright = {}, - -- rust_analyzer = {}, + rust_analyzer = {}, -- tsserver = {}, - -- html = { filetypes = { 'html', 'twig', 'hbs'} }, + -- html = { filetypes = { 'html', 'twig', 'hbs' } }, lua_ls = { Lua = { From b633984e57db07a09c01cc75b32328a2f6d08a02 Mon Sep 17 00:00:00 2001 From: Simo Soini Date: Thu, 21 Dec 2023 22:40:59 +0200 Subject: [PATCH 02/20] Fixed moving highlighted lines up and down. --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 21135b1e325..cd56f254a72 100644 --- a/init.lua +++ b/init.lua @@ -360,8 +360,8 @@ vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Open float vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) -- Move highlighted lines up and down -vim.keymap.set('v', 'J', ':m ">+1gv=gv') -vim.keymap.set('v', 'K', ':m ">-2gv=gv') +vim.keymap.set('v', 'J', ":m '>+1gv=gv") +vim.keymap.set('v', 'K', ":m '>-2gv=gv") -- Center search results vim.keymap.set('n', 'n', 'nzzzv') From 2f96cf56f83dcd7c126755b599d971d7b80d8974 Mon Sep 17 00:00:00 2001 From: Simo Soini Date: Tue, 6 Aug 2024 10:23:26 +0300 Subject: [PATCH 03/20] Show gitignored files and fix keymap not working. --- init.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index cd56f254a72..1c96228a4ac 100644 --- a/init.lua +++ b/init.lua @@ -95,7 +95,7 @@ require('lazy').setup({ local mark = require('harpoon.mark') local ui = require('harpoon.ui') - vim.keymap.set('n', 'a', mark.add_file) + vim.keymap.set('n', '', mark.add_file) vim.keymap.set('n', '', ui.toggle_quick_menu) vim.keymap.set('n', '', function() ui.nav_file(1) end) @@ -389,6 +389,12 @@ require('telescope').setup { }, }, }, + pickers = { + find_files = { + no_ignore = true, + hidden = true, + }, + }, } -- Enable telescope fzf native, if installed From 8a1f4d3a81ce70f30b742680e3c77d791e74bd9e Mon Sep 17 00:00:00 2001 From: Simo Soini Date: Tue, 3 Dec 2024 09:26:25 +0200 Subject: [PATCH 04/20] Update nvim config. --- .gitignore | 1 - init.lua | 53 +++++++++++++++++++++++++++----------------------- lazy-lock.json | 40 +++++++++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 25 deletions(-) create mode 100644 lazy-lock.json diff --git a/.gitignore b/.gitignore index 005b535b606..8a192cab54d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,3 @@ test.sh nvim spell/ -lazy-lock.json diff --git a/init.lua b/init.lua index fb44e2b4bcb..8dad4c3c958 100644 --- a/init.lua +++ b/init.lua @@ -91,7 +91,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` @@ -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' @@ -240,13 +240,13 @@ require('lazy').setup({ 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically -- Navigation integration for tmux - 'christoomey/vim-tmux-navigator', + -- 'christoomey/vim-tmux-navigator', -- Undotree for saving file editing history 'mbbill/undotree', -- Automatic pairs for parentheses etc. - 'jiangmiao/auto-pairs', + -- 'jiangmiao/auto-pairs', -- Github copilot 'github/copilot.vim', @@ -262,16 +262,22 @@ require('lazy').setup({ { 'theprimeagen/harpoon', config = function() - local mark = require('harpoon.mark') - local ui = require('harpoon.ui') + local mark = require 'harpoon.mark' + local ui = require 'harpoon.ui' vim.keymap.set('n', '', mark.add_file) vim.keymap.set('n', '', ui.toggle_quick_menu) - vim.keymap.set('n', '', function() ui.nav_file(1) end) - vim.keymap.set('n', '', function() ui.nav_file(2) end) - vim.keymap.set('n', '', function() ui.nav_file(3) end) - end + vim.keymap.set('n', '', function() + ui.nav_file(1) + end) + vim.keymap.set('n', '', function() + ui.nav_file(2) + end) + vim.keymap.set('n', '', function() + ui.nav_file(3) + end) + end, }, -- NOTE: Plugins can also be added by using a table, @@ -441,7 +447,6 @@ require('lazy').setup({ -- Telescope picker. This is really useful to discover what Telescope can -- do as well as how to actually do it! - -- [[ Configure Telescope ]] -- See `:help telescope` and `:help telescope.setup()` require('telescope').setup { @@ -804,12 +809,12 @@ require('lazy').setup({ -- `friendly-snippets` contains a variety of premade snippets. -- See the README about individual language/framework/plugin snippets: -- https://github.com/rafamadriz/friendly-snippets - -- { - -- 'rafamadriz/friendly-snippets', - -- config = function() - -- require('luasnip.loaders.from_vscode').lazy_load() - -- end, - -- }, + { + 'rafamadriz/friendly-snippets', + config = function() + require('luasnip.loaders.from_vscode').lazy_load() + end, + }, }, }, 'saadparwaiz1/cmp_luasnip', @@ -855,9 +860,9 @@ require('lazy').setup({ -- 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.confirm { select = true }, + [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.select_prev_item(), -- Manually trigger a completion from nvim-cmp. -- Generally you don't need this, because nvim-cmp will display @@ -994,11 +999,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.neo-tree', - -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps + require 'kickstart.plugins.autopairs', + 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` -- This is the easiest way to modularize your config. diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 00000000000..b17fdea9c9f --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,40 @@ +{ + "LuaSnip": { "branch": "master", "commit": "33b06d72d220aa56a7ce80a0dd6f06c70cd82b9d" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "conform.nvim": { "branch": "master", "commit": "7a3d99eb151e636670ce4842ab073d7485f7bc61" }, + "copilot.vim": { "branch": "release", "commit": "87038123804796ca7af20d1b71c3428d858a9124" }, + "fidget.nvim": { "branch": "main", "commit": "e2a175c2abe2d4f65357da1c98c59a5cfb2b543f" }, + "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, + "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, + "harpoon": { "branch": "master", "commit": "1bc17e3e42ea3c46b33c0bbad6a880792692a1b3" }, + "indent-blankline.nvim": { "branch": "master", "commit": "7871a88056f7144defca9c931e311a3134c5d509" }, + "lazy.nvim": { "branch": "main", "commit": "56ead98e05bb37a4ec28930a54d836d033cf00f2" }, + "lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" }, + "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, + "luvit-meta": { "branch": "main", "commit": "57d464c4acb5c2e66bd4145060f5dc9e96a7bbb7" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "8e46de9241d3997927af12196bd8faa0ed08c29a" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, + "mini.nvim": { "branch": "main", "commit": "c6eede272cfdb9b804e40dc43bb9bff53f38ed8a" }, + "neo-tree.nvim": { "branch": "main", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" }, + "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, + "nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" }, + "nvim-cmp": { "branch": "main", "commit": "ca4d3330d386e76967e53b85953c170658255ecb" }, + "nvim-lspconfig": { "branch": "master", "commit": "1aa9f36b6d542dafc0b4a38c48969d036003b00a" }, + "nvim-treesitter": { "branch": "master", "commit": "b31188671d8a060022dbbeb6905019e69e310108" }, + "oxocarbon.nvim": { "branch": "main", "commit": "004777819ba294423b638a35a75c9f0c7be758ed" }, + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, + "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, + "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, + "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, + "tokyonight.nvim": { "branch": "main", "commit": "3d02469b98396dc03e87a4f4b64e109801ef6890" }, + "undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" }, + "vim-fugitive": { "branch": "master", "commit": "320b18fba2a4f2fe3c8225c778c687e0d2620384" }, + "vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" }, + "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, + "vim-tmux-navigator": { "branch": "master", "commit": "424b5caa154bff34dc258ee53cec5a8e36cf7ea8" }, + "which-key.nvim": { "branch": "main", "commit": "9b365a6428a9633e3eeb34dbef1b791511c54f70" } +} From f96e7f4b70fbd74b85576569d313352cf492b954 Mon Sep 17 00:00:00 2001 From: Simo Soini Date: Tue, 3 Dec 2024 10:40:46 +0200 Subject: [PATCH 05/20] Properly disable copilot --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 8dad4c3c958..5e099794088 100644 --- a/init.lua +++ b/init.lua @@ -249,7 +249,7 @@ require('lazy').setup({ -- 'jiangmiao/auto-pairs', -- Github copilot - 'github/copilot.vim', + -- 'github/copilot.vim', -- Git related plugins 'tpope/vim-fugitive', From 0719d87d65f1edc367c2d9a58ff53575494d0065 Mon Sep 17 00:00:00 2001 From: Simo Soini Date: Wed, 7 May 2025 19:30:06 +0300 Subject: [PATCH 06/20] Remove old lines to fix config. --- .gitignore | 1 + init.lua | 5 ----- lazy-lock.json | 40 ---------------------------------------- 3 files changed, 1 insertion(+), 45 deletions(-) delete mode 100644 lazy-lock.json diff --git a/.gitignore b/.gitignore index 8a192cab54d..413895a843d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,6 @@ tags test.sh .luarc.json nvim +lazy-lock.json spell/ diff --git a/init.lua b/init.lua index 57447a4266b..d0cb36b34b5 100644 --- a/init.lua +++ b/init.lua @@ -910,11 +910,6 @@ require('lazy').setup({ nerd_font_variant = 'mono', }, - -- 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(), completion = { -- By default, you may press `` to show the documentation. -- Optionally, set `auto_show = true` to show the documentation after a delay. diff --git a/lazy-lock.json b/lazy-lock.json deleted file mode 100644 index b17fdea9c9f..00000000000 --- a/lazy-lock.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "LuaSnip": { "branch": "master", "commit": "33b06d72d220aa56a7ce80a0dd6f06c70cd82b9d" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, - "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "conform.nvim": { "branch": "master", "commit": "7a3d99eb151e636670ce4842ab073d7485f7bc61" }, - "copilot.vim": { "branch": "release", "commit": "87038123804796ca7af20d1b71c3428d858a9124" }, - "fidget.nvim": { "branch": "main", "commit": "e2a175c2abe2d4f65357da1c98c59a5cfb2b543f" }, - "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, - "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, - "harpoon": { "branch": "master", "commit": "1bc17e3e42ea3c46b33c0bbad6a880792692a1b3" }, - "indent-blankline.nvim": { "branch": "master", "commit": "7871a88056f7144defca9c931e311a3134c5d509" }, - "lazy.nvim": { "branch": "main", "commit": "56ead98e05bb37a4ec28930a54d836d033cf00f2" }, - "lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" }, - "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, - "luvit-meta": { "branch": "main", "commit": "57d464c4acb5c2e66bd4145060f5dc9e96a7bbb7" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "8e46de9241d3997927af12196bd8faa0ed08c29a" }, - "mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" }, - "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, - "mini.nvim": { "branch": "main", "commit": "c6eede272cfdb9b804e40dc43bb9bff53f38ed8a" }, - "neo-tree.nvim": { "branch": "main", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" }, - "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, - "nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" }, - "nvim-cmp": { "branch": "main", "commit": "ca4d3330d386e76967e53b85953c170658255ecb" }, - "nvim-lspconfig": { "branch": "master", "commit": "1aa9f36b6d542dafc0b4a38c48969d036003b00a" }, - "nvim-treesitter": { "branch": "master", "commit": "b31188671d8a060022dbbeb6905019e69e310108" }, - "oxocarbon.nvim": { "branch": "main", "commit": "004777819ba294423b638a35a75c9f0c7be758ed" }, - "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, - "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, - "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, - "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, - "tokyonight.nvim": { "branch": "main", "commit": "3d02469b98396dc03e87a4f4b64e109801ef6890" }, - "undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" }, - "vim-fugitive": { "branch": "master", "commit": "320b18fba2a4f2fe3c8225c778c687e0d2620384" }, - "vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" }, - "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, - "vim-tmux-navigator": { "branch": "master", "commit": "424b5caa154bff34dc258ee53cec5a8e36cf7ea8" }, - "which-key.nvim": { "branch": "main", "commit": "9b365a6428a9633e3eeb34dbef1b791511c54f70" } -} From 17bee8e1a4698fab6f5a257bf1cd5da76fd288c5 Mon Sep 17 00:00:00 2001 From: Simo Soini Date: Sun, 11 May 2025 22:31:23 +0300 Subject: [PATCH 07/20] Fix theme and change back to enter autocompletion. --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index d0cb36b34b5..8eba6aa4a81 100644 --- a/init.lua +++ b/init.lua @@ -328,9 +328,9 @@ require('lazy').setup({ { -- Theme 'nyoom-engineering/oxocarbon.nvim', - priority = 1000, config = function() vim.cmd.colorscheme 'oxocarbon' + vim.opt.background = 'dark' end, }, @@ -898,7 +898,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 From e678569e85ffce02a3fad908d97f833ee98aa898 Mon Sep 17 00:00:00 2001 From: Simo Soini Date: Mon, 12 May 2025 13:39:55 +0300 Subject: [PATCH 08/20] Added oil.nvim for directory manipulation. --- init.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/init.lua b/init.lua index 8eba6aa4a81..6ee100851d1 100644 --- a/init.lua +++ b/init.lua @@ -290,6 +290,23 @@ require('lazy').setup({ end, }, + -- Oil.nvim for directory manipulation + { + 'stevearc/oil.nvim', + ---@module 'oil' + ---@type oil.SetupOpts + opts = {}, + -- 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, + config = function() + require('oil').setup() + vim.keymap.set('n', '-', 'Oil', { desc = 'Open parent directory' }) + end, + }, + -- 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. From 090b1f54efb94b3d18b28dad3adecc95045fe4e9 Mon Sep 17 00:00:00 2001 From: Simo Soini Date: Thu, 5 Jun 2025 11:36:07 +0300 Subject: [PATCH 09/20] Add configurations for autopairs --- lua/kickstart/plugins/autopairs.lua | 45 ++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/lua/kickstart/plugins/autopairs.lua b/lua/kickstart/plugins/autopairs.lua index 386d392e7ad..9a97cce7852 100644 --- a/lua/kickstart/plugins/autopairs.lua +++ b/lua/kickstart/plugins/autopairs.lua @@ -4,5 +4,48 @@ return { 'windwp/nvim-autopairs', event = 'InsertEnter', - opts = {}, + config = function() + local npairs = require 'nvim-autopairs' + npairs.setup {} + local Rule = require 'nvim-autopairs.rule' + local cond = require 'nvim-autopairs.conds' + + -- INFO: Add 'ins' inside 'a1' and 'a2' for specified language(s) + + local function rule2(a1, ins, a2, lang) + npairs.add_rule(Rule(ins, ins, lang) + :with_pair(function(opts) + return a1 .. a2 == opts.line:sub(opts.col - #a1, opts.col + #a2 - 1) + end) + :with_move(cond.none()) + :with_cr(cond.none()) + :with_del(function(opts) + local col = vim.api.nvim_win_get_cursor(0)[2] + return a1 .. ins .. ins .. a2 == opts.line:sub(col - #a1 - #ins + 1, col + #ins + #a2) -- insert only works for #ins == 1 anyway + end)) + end + + rule2('{', '%', '}', 'html') + rule2('{%', ' ', '%}', 'html') + rule2('(', ' ', ')') + rule2('[', ' ', ']') + rule2('{', ' ', '}') + + -- INFO: Add autopairs <> mainly for rust types and generics + npairs.add_rule(Rule('<', '>', { + -- if you use nvim-ts-autotag, you may want to exclude these filetypes from this rule + -- so that it doesn't conflict with nvim-ts-autotag + '-html', + '-javascriptreact', + '-typescriptreact', + }):with_pair( + -- regex will make it so that it will auto-pair on + -- `a<` but not `a <` + -- The `:?:?` part makes it also + -- work on Rust generics like `some_func::()` + cond.before_regex('%a+:?:?$', 3) + ):with_move(function(opts) + return opts.char == '>' + end)) + end, } From b14e4c60ebe6047bf3e411f5f590614564e07ff4 Mon Sep 17 00:00:00 2001 From: Simo Soini Date: Thu, 5 Jun 2025 12:16:45 +0300 Subject: [PATCH 10/20] Add centering to some vertical move keybinds --- init.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 6ee100851d1..e2b360d3eee 100644 --- a/init.lua +++ b/init.lua @@ -176,8 +176,11 @@ vim.keymap.set('v', 'J', ":m '>+1gv=gv") vim.keymap.set('v', 'K', ":m '>-2gv=gv") -- Center search results -vim.keymap.set('n', 'n', 'nzzzv') -vim.keymap.set('n', 'N', 'Nzzzv') +vim.keymap.set('n', 'n', 'nzz') +vim.keymap.set('n', 'N', 'Nzz') +vim.keymap.set('n', 'G', 'Gzz') +vim.keymap.set('n', '', 'zz') +vim.keymap.set('n', '', 'zz') -- 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 From f2ef8811b66900dfe5da97b7196c9be2cdc498e0 Mon Sep 17 00:00:00 2001 From: Simo Soini Date: Thu, 5 Jun 2025 12:19:12 +0300 Subject: [PATCH 11/20] Fix having two themes at the same time --- init.lua | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/init.lua b/init.lua index e2b360d3eee..3ed1432f909 100644 --- a/init.lua +++ b/init.lua @@ -345,15 +345,6 @@ require('lazy').setup({ }, }, - { - -- Theme - 'nyoom-engineering/oxocarbon.nvim', - config = function() - vim.cmd.colorscheme 'oxocarbon' - vim.opt.background = 'dark' - end, - }, - { -- Set lualine as statusline 'nvim-lualine/lualine.nvim', @@ -964,20 +955,14 @@ 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', + 'nyoom-engineering/oxocarbon.nvim', 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 - }, - } - -- 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 'oxocarbon' + vim.opt.background = 'dark' end, }, From ea5c72636cd013ee862014146042a60a3f1ccf4f Mon Sep 17 00:00:00 2001 From: Simo Soini Date: Thu, 5 Jun 2025 12:24:28 +0300 Subject: [PATCH 12/20] Modularize the config for easier merges from kickstart.nvim --- init.lua | 53 +---------------------------------- lua/custom/plugins/init.lua | 55 ++++++++++++++++++++++++++++++++++++- 2 files changed, 55 insertions(+), 53 deletions(-) diff --git a/init.lua b/init.lua index 3ed1432f909..083d96fde9f 100644 --- a/init.lua +++ b/init.lua @@ -252,18 +252,6 @@ 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 - -- Navigation integration for tmux - -- 'christoomey/vim-tmux-navigator', - - -- Undotree for saving file editing history - 'mbbill/undotree', - - -- Automatic pairs for parentheses etc. - -- 'jiangmiao/auto-pairs', - - -- Github copilot - -- 'github/copilot.vim', - -- Git related plugins 'tpope/vim-fugitive', 'tpope/vim-rhubarb', @@ -271,45 +259,6 @@ require('lazy').setup({ -- Detect tabstop and shiftwidth automatically 'tpope/vim-sleuth', - -- Harpoon for fast navigation within a project - { - 'theprimeagen/harpoon', - config = function() - local mark = require 'harpoon.mark' - local ui = require 'harpoon.ui' - - vim.keymap.set('n', '', mark.add_file) - vim.keymap.set('n', '', ui.toggle_quick_menu) - - vim.keymap.set('n', '', function() - ui.nav_file(1) - end) - vim.keymap.set('n', '', function() - ui.nav_file(2) - end) - vim.keymap.set('n', '', function() - ui.nav_file(3) - end) - end, - }, - - -- Oil.nvim for directory manipulation - { - 'stevearc/oil.nvim', - ---@module 'oil' - ---@type oil.SetupOpts - opts = {}, - -- 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, - config = function() - require('oil').setup() - vim.keymap.set('n', '-', 'Oil', { desc = 'Open parent directory' }) - end, - }, - -- 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. @@ -1052,7 +1001,7 @@ require('lazy').setup({ -- This is the easiest way to modularize your config. -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, -- -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` -- Or use telescope! diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index be0eb9d8d7a..0696ffa5379 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -2,4 +2,57 @@ -- I promise not to create any merge conflicts in this directory :) -- -- See the kickstart.nvim README for more information -return {} +return { + -- Undotree for saving file editing history + 'mbbill/undotree', + + -- TS Autotag for html auto tag close + 'windwp/nvim-ts-autotag', + + -- Harpoon for fast navigation within a project + { + 'theprimeagen/harpoon', + config = function() + local mark = require 'harpoon.mark' + local ui = require 'harpoon.ui' + + vim.keymap.set('n', '', mark.add_file) + vim.keymap.set('n', '', ui.toggle_quick_menu) + + vim.keymap.set('n', '', function() + ui.nav_file(1) + end) + vim.keymap.set('n', '', function() + ui.nav_file(2) + end) + vim.keymap.set('n', '', function() + ui.nav_file(3) + end) + end, + }, + + -- Oil.nvim for directory manipulation + { + 'stevearc/oil.nvim', + ---@module 'oil' + ---@type oil.SetupOpts + opts = {}, + -- 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, + config = function() + require('oil').setup() + vim.keymap.set('n', '-', 'Oil', { desc = 'Open parent directory' }) + end, + }, + + -- INFO: Previously used, now disabled plugins + + -- Navigation integration for tmux + -- 'christoomey/vim-tmux-navigator', + + -- Github copilot + -- 'github/copilot.vim', +} From b719c4d2ac3bfd44d58d224d763188148e88466d Mon Sep 17 00:00:00 2001 From: Simo Soini Date: Thu, 5 Jun 2025 16:37:38 +0300 Subject: [PATCH 13/20] Add neorg plugin --- lua/custom/plugins/init.lua | 26 ++++++++++++++++++++++++++ lua/kickstart/plugins/autopairs.lua | 1 + 2 files changed, 27 insertions(+) diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 0696ffa5379..2c17828530b 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -48,6 +48,32 @@ return { end, }, + { + 'nvim-neorg/neorg', + lazy = false, + version = '*', + config = function() + require('neorg').setup { + load = { + ['core.defaults'] = {}, + ['core.concealer'] = {}, + ['core.dirman'] = { + config = { + workspaces = { + notes = '~/notes', + }, + default_workspace = 'notes', + }, + }, + ['core.summary'] = {}, + }, + } + + vim.wo.foldlevel = 99 + vim.wo.conceallevel = 2 + end, + }, + -- INFO: Previously used, now disabled plugins -- Navigation integration for tmux diff --git a/lua/kickstart/plugins/autopairs.lua b/lua/kickstart/plugins/autopairs.lua index 9a97cce7852..a4772591b47 100644 --- a/lua/kickstart/plugins/autopairs.lua +++ b/lua/kickstart/plugins/autopairs.lua @@ -27,6 +27,7 @@ return { rule2('{', '%', '}', 'html') rule2('{%', ' ', '%}', 'html') + rule2('{', ':', '}', 'norg') rule2('(', ' ', ')') rule2('[', ' ', ']') rule2('{', ' ', '}') From b6bf66be6c5ffb8e178e26b771982b755f5fda12 Mon Sep 17 00:00:00 2001 From: Simo Soini Date: Thu, 12 Jun 2025 11:03:20 +0300 Subject: [PATCH 14/20] Remove plugin duplicate --- init.lua | 3 --- 1 file changed, 3 deletions(-) diff --git a/init.lua b/init.lua index 083d96fde9f..1a282d428b9 100644 --- a/init.lua +++ b/init.lua @@ -256,9 +256,6 @@ require('lazy').setup({ 'tpope/vim-fugitive', 'tpope/vim-rhubarb', - -- Detect tabstop and shiftwidth automatically - 'tpope/vim-sleuth', - -- 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. From bda928c413c97d72b2cb4bd5d934f2da6f5e92fa Mon Sep 17 00:00:00 2001 From: Simo Soini Date: Thu, 12 Jun 2025 11:04:04 +0300 Subject: [PATCH 15/20] Enable virtual lines for nicer error messages --- init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init.lua b/init.lua index 1a282d428b9..b62c7206e36 100644 --- a/init.lua +++ b/init.lua @@ -673,6 +673,9 @@ require('lazy').setup({ return diagnostic_message[diagnostic.severity] end, }, + virtual_lines = { + current_line = true, + }, } -- LSP servers and clients are able to communicate to each other what features they support. From 6e17425c2cf68ca77c8b4f94a65878d54d1b3f37 Mon Sep 17 00:00:00 2001 From: Simo Soini Date: Thu, 12 Jun 2025 11:04:45 +0300 Subject: [PATCH 16/20] Add some plugins --- lua/custom/plugins/init.lua | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 2c17828530b..47ccad7a367 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -9,6 +9,31 @@ return { -- TS Autotag for html auto tag close 'windwp/nvim-ts-autotag', + -- Better jinja2 support + 'HiPhish/jinja.vim', + + -- Navigation integration for tmux + 'christoomey/vim-tmux-navigator', + + -- More convenient way to use terminal from neovim + { + 'akinsho/toggleterm.nvim', + config = function() + require('toggleterm').setup { + size = function(term) + if term.direction == 'horizontal' then + return 15 + elseif term.direction == 'vertical' then + return vim.o.columns * 0.4 + end + end, + open_mapping = 'tt', + direction = 'float', + shell = '/usr/bin/fish', + } + end, + }, + -- Harpoon for fast navigation within a project { 'theprimeagen/harpoon', @@ -76,9 +101,6 @@ return { -- INFO: Previously used, now disabled plugins - -- Navigation integration for tmux - -- 'christoomey/vim-tmux-navigator', - -- Github copilot -- 'github/copilot.vim', } From 83f447d445aecabe03e5e83513e52f0b27647643 Mon Sep 17 00:00:00 2001 From: Simo Soini Date: Thu, 12 Jun 2025 12:10:15 +0300 Subject: [PATCH 17/20] Disable tt in insert mode --- lua/custom/plugins/init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 47ccad7a367..ae5f397e0c3 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -28,6 +28,7 @@ return { end end, open_mapping = 'tt', + insert_mappings = false, direction = 'float', shell = '/usr/bin/fish', } From 563f568bd028a9024b85a5457e36a6e244b810d6 Mon Sep 17 00:00:00 2001 From: Simo Soini Date: Tue, 17 Jun 2025 11:28:37 +0300 Subject: [PATCH 18/20] Add more filetypes for some autopairs --- lua/kickstart/plugins/autopairs.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/kickstart/plugins/autopairs.lua b/lua/kickstart/plugins/autopairs.lua index a4772591b47..bbdbd3fef04 100644 --- a/lua/kickstart/plugins/autopairs.lua +++ b/lua/kickstart/plugins/autopairs.lua @@ -25,8 +25,8 @@ return { end)) end - rule2('{', '%', '}', 'html') - rule2('{%', ' ', '%}', 'html') + rule2('{', '%', '}', { 'html', 'htmldjango', 'jinja' }) + rule2('{%', ' ', '%}', { 'html', 'htmldjango', 'jinja' }) rule2('{', ':', '}', 'norg') rule2('(', ' ', ')') rule2('[', ' ', ']') From 84841a24ce62b9520f19abffbf3b62bcc4f33a59 Mon Sep 17 00:00:00 2001 From: Simo Soini Date: Tue, 17 Jun 2025 11:29:18 +0300 Subject: [PATCH 19/20] Comment out the unused neo-tree plugin --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index b62c7206e36..ef438e0ffac 100644 --- a/init.lua +++ b/init.lua @@ -994,7 +994,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 1fce6c5c18dbcd896efef6a789d195e64a76b781 Mon Sep 17 00:00:00 2001 From: Simo Soini Date: Wed, 25 Jun 2025 14:18:26 +0300 Subject: [PATCH 20/20] Added rustaceanvim plugin --- lua/custom/plugins/rustaceanvim.lua | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 lua/custom/plugins/rustaceanvim.lua diff --git a/lua/custom/plugins/rustaceanvim.lua b/lua/custom/plugins/rustaceanvim.lua new file mode 100644 index 00000000000..385c03de152 --- /dev/null +++ b/lua/custom/plugins/rustaceanvim.lua @@ -0,0 +1,5 @@ +return { + 'mrcjkb/rustaceanvim', + version = '^6', + lazy = false, +}