From f75dec9a879188a4075ade0b22e7fdb6942338aa Mon Sep 17 00:00:00 2001 From: Michal Date: Wed, 26 Mar 2025 07:02:30 +0100 Subject: [PATCH 01/25] Enable neo-tree --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index cbf9ff65..a26dd4ba 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 871c21471a15b782154844d8768f10ba16f3d9b6 Mon Sep 17 00:00:00 2001 From: Michal Date: Wed, 26 Mar 2025 07:02:48 +0100 Subject: [PATCH 02/25] Add custom options --- init.lua | 2 ++ lua/custom/core/options.lua | 43 +++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 lua/custom/core/options.lua diff --git a/init.lua b/init.lua index a26dd4ba..485233b1 100644 --- a/init.lua +++ b/init.lua @@ -1,3 +1,5 @@ +require 'custom.core.options' + --[[ ===================================================================== diff --git a/lua/custom/core/options.lua b/lua/custom/core/options.lua new file mode 100644 index 00000000..a2357edd --- /dev/null +++ b/lua/custom/core/options.lua @@ -0,0 +1,43 @@ +vim.o.hlsearch = false -- Set highlight on search +vim.wo.number = true -- Make line numbers default +vim.o.mouse = 'a' -- Enable mouse mode +vim.o.clipboard = 'unnamedplus' -- Sync clipboard between OS and Neovim. +vim.o.breakindent = true -- Enable break indent +vim.o.undofile = true -- Save undo history +vim.o.ignorecase = true -- Case-insensitive searching UNLESS \C or capital in search +vim.o.smartcase = true -- smart case +vim.wo.signcolumn = 'yes' -- Keep signcolumn on by default +vim.o.updatetime = 250 -- Decrease update time +vim.o.timeoutlen = 300 -- time to wait for a mapped sequence to complete (in milliseconds) +vim.o.backup = false -- creates a backup file +vim.o.writebackup = false -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited +vim.o.completeopt = 'menuone,noselect' -- Set completeopt to have a better completion experience +vim.opt.termguicolors = true -- set termguicolors to enable highlight groups +vim.o.whichwrap = 'bs<>[]hl' -- which "horizontal" keys are allowed to travel to prev/next line +vim.o.wrap = false -- display lines as one long line +vim.o.linebreak = true -- companion to wrap don't split words +vim.o.scrolloff = 4 -- minimal number of screen lines to keep above and below the cursor +vim.o.sidescrolloff = 8 -- minimal number of screen columns either side of cursor if wrap is `false` +vim.o.relativenumber = true -- set relative numbered lines +vim.o.numberwidth = 4 -- set number column width to 2 {default 4} +vim.o.shiftwidth = 4 -- the number of spaces inserted for each indentation +vim.o.tabstop = 4 -- insert n spaces for a tab +vim.o.softtabstop = 4 -- Number of spaces that a tab counts for while performing editing operations +vim.o.expandtab = true -- convert tabs to spaces +vim.o.cursorline = false -- highlight the current line +vim.o.splitbelow = true -- force all horizontal splits to go below current window +vim.o.splitright = true -- force all vertical splits to go to the right of current window +vim.o.swapfile = false -- creates a swapfile +vim.o.smartindent = true -- make indenting smarter again +vim.o.showmode = false -- we don't need to see things like -- INSERT -- anymore +vim.o.showtabline = 2 -- always show tabs +vim.o.backspace = 'indent,eol,start' -- allow backspace on +vim.o.pumheight = 10 -- pop up menu height +vim.o.conceallevel = 0 -- so that `` is visible in markdown files +vim.o.fileencoding = 'utf-8' -- the encoding written to a file +vim.o.cmdheight = 1 -- more space in the neovim command line for displaying messages +vim.o.autoindent = true -- copy indent from current line when starting new one +vim.opt.shortmess:append 'c' -- don't give |ins-completion-menu| messages +vim.opt.iskeyword:append '-' -- hyphenated words recognized by searches +vim.opt.formatoptions:remove { 'c', 'r', 'o' } -- don't insert the current comment leader automatically for auto-wrapping comments using 'textwidth', hitting in insert mode, or hitting 'o' or 'O' in normal mode. +vim.opt.runtimepath:remove '/usr/share/vim/vimfiles' -- separate vim plugins from neovim in case vim still in use From 8a8de4cc68b9c569578010b91d662a699795d542 Mon Sep 17 00:00:00 2001 From: Michal Date: Wed, 26 Mar 2025 07:25:53 +0100 Subject: [PATCH 03/25] Enable nerd font --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 485233b1..97d4ea05 100644 --- a/init.lua +++ b/init.lua @@ -93,7 +93,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` From 4672cef3f5017989f85c318f5a2b98138f22176f Mon Sep 17 00:00:00 2001 From: Michal Date: Wed, 26 Mar 2025 07:26:00 +0100 Subject: [PATCH 04/25] Add custom keymaps --- init.lua | 1 + lua/custom/core/keymaps.lua | 120 ++++++++++++++++++++++++++++++++++++ 2 files changed, 121 insertions(+) create mode 100644 lua/custom/core/keymaps.lua diff --git a/init.lua b/init.lua index 97d4ea05..948349ba 100644 --- a/init.lua +++ b/init.lua @@ -1,4 +1,5 @@ require 'custom.core.options' +require 'custom.core.keymaps' --[[ diff --git a/lua/custom/core/keymaps.lua b/lua/custom/core/keymaps.lua new file mode 100644 index 00000000..e41892ad --- /dev/null +++ b/lua/custom/core/keymaps.lua @@ -0,0 +1,120 @@ +-- Keymaps for better default experience + +-- Set leader key +vim.g.mapleader = ' ' +vim.g.maplocalleader = ' ' + +-- For conciseness +local opts = { noremap = true, silent = true } + +-- Disable the spacebar key's default behavior in Normal and Visual modes +vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) + +-- Allow moving the cursor through wrapped lines with j, k +vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) +vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) + +-- clear highlights +vim.keymap.set('n', '', ':noh', opts) + +-- save file +vim.keymap.set('n', '', ' w ', opts) + +-- save file without auto-formatting +vim.keymap.set('n', 'sn', 'noautocmd w ', opts) + +-- quit file +vim.keymap.set('n', '', ' q ', opts) + +-- delete single character without copying into register +vim.keymap.set('n', 'x', '"_x', opts) + +-- Vertical scroll and center +vim.keymap.set('n', '', 'zz', opts) +vim.keymap.set('n', '', 'zz', opts) + +-- Find and center +vim.keymap.set('n', 'n', 'nzzzv') +vim.keymap.set('n', 'N', 'Nzzzv') + +-- Resize with arrows +vim.keymap.set('n', '', ':resize -2', opts) +vim.keymap.set('n', '', ':resize +2', opts) +vim.keymap.set('n', '', ':vertical resize -2', opts) +vim.keymap.set('n', '', ':vertical resize +2', opts) + +-- Buffers +vim.keymap.set('n', '', ':bnext', opts) +vim.keymap.set('n', '', ':bprevious', opts) +vim.keymap.set('n', 'x', ':Bdelete!', opts) -- close buffer +vim.keymap.set('n', 'b', ' enew ', opts) -- new buffer + +-- Increment/decrement numbers +vim.keymap.set('n', '+', '', opts) -- increment +vim.keymap.set('n', '-', '', opts) -- decrement + +-- Window management +vim.keymap.set('n', 'v', 'v', opts) -- split window vertically +vim.keymap.set('n', 'h', 's', opts) -- split window horizontally +vim.keymap.set('n', 'se', '=', opts) -- make split windows equal width & height +vim.keymap.set('n', 'xs', ':close', opts) -- close current split window + +-- Navigate between splits +vim.keymap.set('n', '', ':wincmd k', opts) +vim.keymap.set('n', '', ':wincmd j', opts) +vim.keymap.set('n', '', ':wincmd h', opts) +vim.keymap.set('n', '', ':wincmd l', opts) + +-- Tabs +vim.keymap.set('n', 'to', ':tabnew', opts) -- open new tab +vim.keymap.set('n', 'tx', ':tabclose', opts) -- close current tab +vim.keymap.set('n', 'tn', ':tabn', opts) -- go to next tab +vim.keymap.set('n', 'tp', ':tabp', opts) -- go to previous tab + +-- Toggle line wrapping +vim.keymap.set('n', 'lw', 'set wrap!', opts) + +-- Press jk fast to exit insert mode +vim.keymap.set('i', 'jk', '', opts) +vim.keymap.set('i', 'kj', '', opts) + +-- Stay in indent mode +vim.keymap.set('v', '<', '', '>gv', opts) + +-- Move text up and down +vim.keymap.set('v', '', ':m .+1==', opts) +vim.keymap.set('v', '', ':m .-2==', opts) + +-- Keep last yanked when pasting +vim.keymap.set('v', 'p', '"_dP', opts) + +-- Replace word under cursor +vim.keymap.set('n', 'j', '*``cgn', opts) + +-- Explicitly yank to system clipboard (highlighted and entire row) +vim.keymap.set({ 'n', 'v' }, 'y', [["+y]]) +vim.keymap.set('n', 'Y', [["+Y]]) + +-- Toggle diagnostics +local diagnostics_active = true + +vim.keymap.set('n', 'do', function() + diagnostics_active = not diagnostics_active + + if diagnostics_active then + vim.diagnostic.enable(0) + else + vim.diagnostic.disable(0) + end +end) + +-- Diagnostic keymaps +vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' }) +vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' }) +vim.keymap.set('n', 'd', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) +vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) + +-- Save and load session +vim.keymap.set('n', 'ss', ':mksession! .session.vim', { noremap = true, silent = false }) +vim.keymap.set('n', 'sl', ':source .session.vim', { noremap = true, silent = false }) From 213a1a61e415fada4e2da36ee0772f31b62acbae Mon Sep 17 00:00:00 2001 From: Michal Date: Wed, 26 Mar 2025 16:39:00 +0100 Subject: [PATCH 05/25] Add bufferline --- init.lua | 1 + lua/custom/plugins/bufferline.lua | 81 +++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 lua/custom/plugins/bufferline.lua diff --git a/init.lua b/init.lua index 948349ba..461911c5 100644 --- a/init.lua +++ b/init.lua @@ -998,6 +998,7 @@ require('lazy').setup({ -- require 'kickstart.plugins.lint', -- require 'kickstart.plugins.autopairs', require 'kickstart.plugins.neo-tree', + require 'custom.plugins.bufferline', -- 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` diff --git a/lua/custom/plugins/bufferline.lua b/lua/custom/plugins/bufferline.lua new file mode 100644 index 00000000..968096de --- /dev/null +++ b/lua/custom/plugins/bufferline.lua @@ -0,0 +1,81 @@ +return { + 'akinsho/bufferline.nvim', + dependencies = { + 'moll/vim-bbye', + 'nvim-tree/nvim-web-devicons', + }, + config = function() + -- vim.opt.linespace = 8 + + require('bufferline').setup { + options = { + mode = 'buffers', -- set to "tabs" to only show tabpages instead + themable = true, -- allows highlight groups to be overriden i.e. sets highlights as default + numbers = 'none', -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string, + close_command = 'Bdelete! %d', -- can be a string | function, see "Mouse actions" + right_mouse_command = 'Bdelete! %d', -- can be a string | function, see "Mouse actions" + left_mouse_command = 'buffer %d', -- can be a string | function, see "Mouse actions" + middle_mouse_command = nil, -- can be a string | function, see "Mouse actions" + -- buffer_close_icon = '󰅖', + buffer_close_icon = '✗', + -- buffer_close_icon = '✕', + close_icon = '', + path_components = 1, -- Show only the file name without the directory + modified_icon = '●', + left_trunc_marker = '', + right_trunc_marker = '', + max_name_length = 30, + max_prefix_length = 30, -- prefix used when a buffer is de-duplicated + tab_size = 21, + diagnostics = false, + diagnostics_update_in_insert = false, + color_icons = true, + show_buffer_icons = true, + show_buffer_close_icons = true, + show_close_icon = true, + persist_buffer_sort = true, -- whether or not custom sorted buffers should persist + separator_style = { '│', '│' }, -- | "thick" | "thin" | { 'any', 'any' }, + enforce_regular_tabs = true, + always_show_bufferline = true, + show_tab_indicators = false, + indicator = { + -- icon = '▎', -- this should be omitted if indicator style is not 'icon' + style = 'none', -- Options: 'icon', 'underline', 'none' + }, + icon_pinned = '󰐃', + minimum_padding = 1, + maximum_padding = 5, + maximum_length = 15, + sort_by = 'insert_at_end', + }, + highlights = { + separator = { + fg = '#434C5E', + }, + buffer_selected = { + bold = true, + italic = false, + }, + -- separator_selected = {}, + -- tab_selected = {}, + -- background = {}, + -- indicator_selected = {}, + -- fill = {}, + }, + } + + -- Keymaps + local opts = { noremap = true, silent = true, desc = 'Go to Buffer' } + -- vim.keymap.set("n", "", "BufferLineCycleNext", {}) + -- vim.keymap.set("n", "", "BufferLineCyclePrev", {}) + -- vim.keymap.set('n', '1', "lua require('bufferline').go_to_buffer(1)", opts) + -- vim.keymap.set('n', '2', "lua require('bufferline').go_to_buffer(2)", opts) + -- vim.keymap.set('n', '3', "lua require('bufferline').go_to_buffer(3)", opts) + -- vim.keymap.set('n', '4', "lua require('bufferline').go_to_buffer(4)", opts) + -- vim.keymap.set('n', '5', "lua require('bufferline').go_to_buffer(5)", opts) + -- vim.keymap.set('n', '6', "lua require('bufferline').go_to_buffer(6)", opts) + -- vim.keymap.set('n', '7', "lua require('bufferline').go_to_buffer(7)", opts) + -- vim.keymap.set('n', '8', "lua require('bufferline').go_to_buffer(8)", opts) + -- vim.keymap.set('n', '9', "lua require('bufferline').go_to_buffer(9)", opts) + end, +} From b16fb0e183346bd8effb9f7d0ba903ca6f6dd9ed Mon Sep 17 00:00:00 2001 From: Michal Date: Mon, 31 Mar 2025 17:24:20 +0200 Subject: [PATCH 06/25] Add languages to treesiter --- init.lua | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 461911c5..c75fb71f 100644 --- a/init.lua +++ b/init.lua @@ -964,7 +964,34 @@ require('lazy').setup({ main = 'nvim-treesitter.configs', -- Sets main module to use for opts -- [[ Configure Treesitter ]] See `:help nvim-treesitter` opts = { - ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, + ensure_installed = { + 'lua', + 'python', + 'javascript', + 'typescript', + 'vimdoc', + 'vim', + 'regex', + 'terraform', + 'sql', + 'dockerfile', + 'toml', + 'json', + 'java', + 'groovy', + 'go', + 'gitignore', + 'graphql', + 'yaml', + 'make', + 'cmake', + 'markdown', + 'markdown_inline', + 'bash', + 'tsx', + 'css', + 'html', + }, -- Autoinstall languages that are not installed auto_install = true, highlight = { From 1f74e4d793e6373d45fe949fc08d0c35c1729a06 Mon Sep 17 00:00:00 2001 From: Michal Date: Mon, 31 Mar 2025 17:39:38 +0200 Subject: [PATCH 07/25] Add languages to LSP --- init.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index c75fb71f..2db6016f 100644 --- a/init.lua +++ b/init.lua @@ -682,9 +682,16 @@ require('lazy').setup({ -- https://github.com/pmizio/typescript-tools.nvim -- -- But for many setups, the LSP (`ts_ls`) will work just fine - -- ts_ls = {}, -- - + ts_ls = {}, -- tsserver is deprecated + html = { filetypes = { 'html', 'twig', 'hbs' } }, + cssls = {}, + tailwindcss = {}, + dockerls = {}, + sqlls = {}, + terraformls = {}, + jsonls = {}, + yamlls = {}, lua_ls = { -- cmd = { ... }, -- filetypes = { ... }, From 3d8bc6989f1d72e0ed76be776fddc33e021f14e0 Mon Sep 17 00:00:00 2001 From: Michal Date: Mon, 31 Mar 2025 17:49:29 +0200 Subject: [PATCH 08/25] Add friendly snippets for LSP --- init.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/init.lua b/init.lua index 2db6016f..cf489fca 100644 --- a/init.lua +++ b/init.lua @@ -805,12 +805,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', From 98ceb277699e663d5bd8b58be139a72b0a612cb6 Mon Sep 17 00:00:00 2001 From: Michal Date: Mon, 31 Mar 2025 17:49:38 +0200 Subject: [PATCH 09/25] Enable prettier autoformatter --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index cf489fca..95f178bc 100644 --- a/init.lua +++ b/init.lua @@ -780,7 +780,7 @@ require('lazy').setup({ -- python = { "isort", "black" }, -- -- You can use 'stop_after_first' to run the first available formatter from the list - -- javascript = { "prettierd", "prettier", stop_after_first = true }, + javascript = { 'prettierd', 'prettier', stop_after_first = true }, }, }, }, From 0ddd9435b651f152cf06b06753382488863a4c2f Mon Sep 17 00:00:00 2001 From: Michal Date: Mon, 31 Mar 2025 19:13:19 +0200 Subject: [PATCH 10/25] Add rules for prettier formatting --- init.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 95f178bc..529eed3b 100644 --- a/init.lua +++ b/init.lua @@ -780,7 +780,13 @@ require('lazy').setup({ -- python = { "isort", "black" }, -- -- You can use 'stop_after_first' to run the first available formatter from the list - javascript = { 'prettierd', 'prettier', stop_after_first = true }, + typescript = { 'prettierd', 'prettier' }, + typescriptreact = { 'prettierd', 'prettier' }, + javascript = { 'prettierd', 'prettier' }, + javascriptreact = { 'prettierd', 'prettier' }, + json = { 'prettierd', 'prettier' }, + html = { 'prettierd', 'prettier' }, + css = { 'prettierd', 'prettier' }, }, }, }, From 733fae78d4f8fd63c14e5ab40e86ef6650874f27 Mon Sep 17 00:00:00 2001 From: Michal Date: Mon, 31 Mar 2025 22:31:22 +0200 Subject: [PATCH 11/25] Enable autopairs for brackets/parenthesis --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 529eed3b..5ee8b698 100644 --- a/init.lua +++ b/init.lua @@ -1036,7 +1036,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 'custom.plugins.bufferline', -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps From 3410eb095bf7edd96ff83165e1e9eb8f3a13b9c8 Mon Sep 17 00:00:00 2001 From: Michal Date: Tue, 1 Apr 2025 15:17:57 +0200 Subject: [PATCH 12/25] Enable mini move lines --- init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/init.lua b/init.lua index 5ee8b698..ac0d225d 100644 --- a/init.lua +++ b/init.lua @@ -951,6 +951,7 @@ require('lazy').setup({ -- - sd' - [S]urround [D]elete [']quotes -- - sr)' - [S]urround [R]eplace [)] ['] require('mini.surround').setup() + require('mini.move').setup() -- Simple and easy statusline. -- You could remove this setup call if you don't like it, From ed79c419c8eb322cbb64e6126c3d49a3ed3108ba Mon Sep 17 00:00:00 2001 From: Michal Date: Thu, 10 Apr 2025 09:38:32 +0200 Subject: [PATCH 13/25] Add custom mapping for replacing HTML tags without losing attributes --- init.lua | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index ac0d225d..f66fc61b 100644 --- a/init.lua +++ b/init.lua @@ -950,7 +950,22 @@ require('lazy').setup({ -- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren -- - sd' - [S]urround [D]elete [']quotes -- - sr)' - [S]urround [R]eplace [)] ['] - require('mini.surround').setup() + require('mini.surround').setup { + custom_surroundings = { + -- - srTT - [S]urround [R]eplace [T]ag opening [T]ag closing + -- ^ allows to replace the surrounding tag with another one without losing any added attributes + T = { + input = { '<(%w+)[^<>]->.-', '^<()%w+().*$' }, + output = function() + local tag_name = MiniSurround.user_input 'Tag name' + if tag_name == nil then + return nil + end + return { left = tag_name, right = tag_name } + end, + }, + }, + } require('mini.move').setup() -- Simple and easy statusline. From e282ec4d449b671a148e077bfd9bd16a4018d78d Mon Sep 17 00:00:00 2001 From: Michal Date: Thu, 10 Apr 2025 14:49:56 +0200 Subject: [PATCH 14/25] Add autotag --- init.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index f66fc61b..43fb4d91 100644 --- a/init.lua +++ b/init.lua @@ -933,7 +933,13 @@ require('lazy').setup({ -- Highlight todo, notes, etc in comments { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, - + -- Auto close and change HTML tags + { + 'windwp/nvim-ts-autotag', + config = function() + require('nvim-ts-autotag').setup() + end, + }, { -- Collection of various small independent plugins/modules 'echasnovski/mini.nvim', config = function() From 70945bff5d9073519b75373ef20938545a40b91c Mon Sep 17 00:00:00 2001 From: Michal Date: Fri, 11 Apr 2025 10:49:18 +0200 Subject: [PATCH 15/25] Add file operations --- init.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/init.lua b/init.lua index 43fb4d91..355665bc 100644 --- a/init.lua +++ b/init.lua @@ -744,6 +744,20 @@ require('lazy').setup({ end, }, + { -- File operations (rename, move etc...) improvements for auto renaming imports + 'antosha417/nvim-lsp-file-operations', + dependencies = { + 'nvim-lua/plenary.nvim', + -- Uncomment whichever supported plugin(s) you use + -- "nvim-tree/nvim-tree.lua", + 'nvim-neo-tree/neo-tree.nvim', + -- "simonmclean/triptych.nvim" + }, + config = function() + require('lsp-file-operations').setup() + end, + }, + { -- Autoformat 'stevearc/conform.nvim', event = { 'BufWritePre' }, From 5ceb8f37f93d0adacfd58e039a5a049972147f65 Mon Sep 17 00:00:00 2001 From: Michal Date: Mon, 14 Apr 2025 09:14:11 +0200 Subject: [PATCH 16/25] Add refactoring plugin --- init.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/init.lua b/init.lua index 355665bc..9da9863c 100644 --- a/init.lua +++ b/init.lua @@ -758,6 +758,16 @@ require('lazy').setup({ end, }, + { -- Refactoring (extracting/inlining methods and variables) use :Refactor + 'ThePrimeagen/refactoring.nvim', + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-treesitter/nvim-treesitter', + }, + lazy = false, + opts = {}, + }, + { -- Autoformat 'stevearc/conform.nvim', event = { 'BufWritePre' }, From 402956e8c869b7c72802f76295922e52108572fa Mon Sep 17 00:00:00 2001 From: Michal Date: Fri, 18 Apr 2025 10:06:08 +0200 Subject: [PATCH 17/25] Add node_modules folder to be ignored by telescope finder --- init.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 9da9863c..96c9a827 100644 --- a/init.lua +++ b/init.lua @@ -412,7 +412,18 @@ require('lazy').setup({ -- i = { [''] = 'to_fuzzy_refine' }, -- }, -- }, - -- pickers = {} + pickers = { + live_grep = { + file_ignore_patterns = { 'node_modules', '.git', '.venv' }, + additional_args = function(_) + return { '--hidden' } + end, + }, + find_files = { + file_ignore_patterns = { 'node_modules', '.git', '.venv' }, + hidden = true, + }, + }, extensions = { ['ui-select'] = { require('telescope.themes').get_dropdown(), From 79f44ce555d8e83d9a333272804a9269c1aa08b6 Mon Sep 17 00:00:00 2001 From: Michal Date: Fri, 18 Apr 2025 11:03:33 +0200 Subject: [PATCH 18/25] Add follow current file config in Neotree --- lua/kickstart/plugins/neo-tree.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua index bd442269..6c054cf4 100644 --- a/lua/kickstart/plugins/neo-tree.lua +++ b/lua/kickstart/plugins/neo-tree.lua @@ -20,6 +20,11 @@ return { ['\\'] = 'close_window', }, }, + follow_current_file = { + enabled = true, + leave_dirs_open = false, + }, + buffers = { follow_current_file = { enable = true } }, }, }, } From 10b3f5248d5fc644cba50eb6e8461de876bcf632 Mon Sep 17 00:00:00 2001 From: Michal Date: Tue, 13 May 2025 11:07:32 +0200 Subject: [PATCH 19/25] Fix prettier occasional timeout --- init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index eae183b9..c7cbf709 100644 --- a/init.lua +++ b/init.lua @@ -806,8 +806,9 @@ require('lazy').setup({ return nil else return { - timeout_ms = 500, + timeout_ms = 2500, lsp_format = 'fallback', + lsp_fallback = true, } end end, From 22e95d1cc92a56596eeb53a345146194a2b95c45 Mon Sep 17 00:00:00 2001 From: Michal Date: Tue, 13 May 2025 15:33:33 +0200 Subject: [PATCH 20/25] Move custom plugins to separate files --- init.lua | 24 +--------------------- lua/custom/plugins/autotag.lua | 6 ++++++ lua/custom/plugins/lsp-file-operations.lua | 13 ++++++++++++ lua/custom/plugins/refactoring.lua | 9 ++++++++ 4 files changed, 29 insertions(+), 23 deletions(-) create mode 100644 lua/custom/plugins/autotag.lua create mode 100644 lua/custom/plugins/lsp-file-operations.lua create mode 100644 lua/custom/plugins/refactoring.lua diff --git a/init.lua b/init.lua index c7cbf709..aa432b2d 100644 --- a/init.lua +++ b/init.lua @@ -757,20 +757,6 @@ require('lazy').setup({ end, }, - { -- File operations (rename, move etc...) improvements for auto renaming imports - 'antosha417/nvim-lsp-file-operations', - dependencies = { - 'nvim-lua/plenary.nvim', - -- Uncomment whichever supported plugin(s) you use - -- "nvim-tree/nvim-tree.lua", - 'nvim-neo-tree/neo-tree.nvim', - -- "simonmclean/triptych.nvim" - }, - config = function() - require('lsp-file-operations').setup() - end, - }, - { -- Refactoring (extracting/inlining methods and variables) use :Refactor 'ThePrimeagen/refactoring.nvim', dependencies = { @@ -952,13 +938,6 @@ require('lazy').setup({ -- Highlight todo, notes, etc in comments { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, - -- Auto close and change HTML tags - { - 'windwp/nvim-ts-autotag', - config = function() - require('nvim-ts-autotag').setup() - end, - }, { -- Collection of various small independent plugins/modules 'echasnovski/mini.nvim', config = function() @@ -1079,14 +1058,13 @@ require('lazy').setup({ -- require 'kickstart.plugins.lint', require 'kickstart.plugins.autopairs', require 'kickstart.plugins.neo-tree', - require 'custom.plugins.bufferline', -- 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. -- -- 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/autotag.lua b/lua/custom/plugins/autotag.lua new file mode 100644 index 00000000..064fa188 --- /dev/null +++ b/lua/custom/plugins/autotag.lua @@ -0,0 +1,6 @@ +return { -- Auto close and change HTML tags + 'windwp/nvim-ts-autotag', + config = function() + require('nvim-ts-autotag').setup() + end, +} diff --git a/lua/custom/plugins/lsp-file-operations.lua b/lua/custom/plugins/lsp-file-operations.lua new file mode 100644 index 00000000..23391ad6 --- /dev/null +++ b/lua/custom/plugins/lsp-file-operations.lua @@ -0,0 +1,13 @@ +return { -- File operations (rename, move etc...) improvements for auto renaming imports + 'antosha417/nvim-lsp-file-operations', + dependencies = { + 'nvim-lua/plenary.nvim', + -- Uncomment whichever supported plugin(s) you use + -- "nvim-tree/nvim-tree.lua", + 'nvim-neo-tree/neo-tree.nvim', + -- "simonmclean/triptych.nvim" + }, + config = function() + require('lsp-file-operations').setup() + end, +} diff --git a/lua/custom/plugins/refactoring.lua b/lua/custom/plugins/refactoring.lua new file mode 100644 index 00000000..c44a6d82 --- /dev/null +++ b/lua/custom/plugins/refactoring.lua @@ -0,0 +1,9 @@ +return { -- Refactoring (extracting/inlining methods and variables) use :Refactor + 'ThePrimeagen/refactoring.nvim', + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-treesitter/nvim-treesitter', + }, + lazy = false, + opts = {}, +} From 8557ae6f40e8f3f5b65479ddb5d0bbc1ce97114b Mon Sep 17 00:00:00 2001 From: Michal Date: Thu, 4 Sep 2025 17:12:46 +0200 Subject: [PATCH 21/25] Add Github Copilot plugin --- lua/custom/plugins/github-copilot.lua | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 lua/custom/plugins/github-copilot.lua diff --git a/lua/custom/plugins/github-copilot.lua b/lua/custom/plugins/github-copilot.lua new file mode 100644 index 00000000..a623ef7d --- /dev/null +++ b/lua/custom/plugins/github-copilot.lua @@ -0,0 +1,3 @@ +return { -- Github Copilot autosuggestions + 'github/copilot.vim', +} From 0026776f369582305d2e24d1199f4e546e9db357 Mon Sep 17 00:00:00 2001 From: Michal Date: Fri, 5 Sep 2025 08:54:15 +0200 Subject: [PATCH 22/25] Add Copilot Chat plugin --- lua/custom/plugins/copilot-chat.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 lua/custom/plugins/copilot-chat.lua diff --git a/lua/custom/plugins/copilot-chat.lua b/lua/custom/plugins/copilot-chat.lua new file mode 100644 index 00000000..bf7a553d --- /dev/null +++ b/lua/custom/plugins/copilot-chat.lua @@ -0,0 +1,12 @@ +return { -- https://github.com/CopilotC-Nvim/CopilotChat.nvim + { + 'CopilotC-Nvim/CopilotChat.nvim', + dependencies = { + { 'nvim-lua/plenary.nvim', branch = 'master' }, + }, + build = 'make tiktoken', + opts = { + -- See Configuration section for options + }, + }, +} From 35b7550e6a8c3532a83338d1ffb2713c812af545 Mon Sep 17 00:00:00 2001 From: Michal Date: Fri, 5 Sep 2025 09:14:31 +0200 Subject: [PATCH 23/25] Add Tab completion mapping for Copilot Chat --- lua/custom/plugins/copilot-chat.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lua/custom/plugins/copilot-chat.lua b/lua/custom/plugins/copilot-chat.lua index bf7a553d..569ace30 100644 --- a/lua/custom/plugins/copilot-chat.lua +++ b/lua/custom/plugins/copilot-chat.lua @@ -6,7 +6,15 @@ return { -- https://github.com/CopilotC-Nvim/CopilotChat.nvim }, build = 'make tiktoken', opts = { - -- See Configuration section for options + mappings = { + reset = false, + complete = { + insert = '', + }, + show_diff = { + full_diff = true, + }, + }, }, }, } From 5ff419a51b4c5cad3db4aa169acbaf0119f3f9c8 Mon Sep 17 00:00:00 2001 From: Michal Date: Fri, 5 Sep 2025 09:53:12 +0200 Subject: [PATCH 24/25] Fix Tab completion mapping --- lua/custom/plugins/copilot-chat.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/custom/plugins/copilot-chat.lua b/lua/custom/plugins/copilot-chat.lua index 569ace30..fcadf653 100644 --- a/lua/custom/plugins/copilot-chat.lua +++ b/lua/custom/plugins/copilot-chat.lua @@ -7,9 +7,10 @@ return { -- https://github.com/CopilotC-Nvim/CopilotChat.nvim build = 'make tiktoken', opts = { mappings = { - reset = false, + -- Use tab for completion complete = { - insert = '', + detail = 'Use @ or / for options.', + insert = '', }, show_diff = { full_diff = true, From 402aac41d0777137bb35f499111551a3b2458a70 Mon Sep 17 00:00:00 2001 From: Michal Date: Fri, 5 Sep 2025 13:05:55 +0200 Subject: [PATCH 25/25] Add Auto Session plugin Helps with managing previous sessions --- lua/custom/plugins/auto-session.lua | 57 +++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 lua/custom/plugins/auto-session.lua diff --git a/lua/custom/plugins/auto-session.lua b/lua/custom/plugins/auto-session.lua new file mode 100644 index 00000000..c1e2b75d --- /dev/null +++ b/lua/custom/plugins/auto-session.lua @@ -0,0 +1,57 @@ +return { + 'rmagatti/auto-session', + lazy = false, + keys = { + -- Will use Telescope if installed or a vim.ui.select picker otherwise + { 'wr', 'AutoSession search', desc = 'Session search' }, + { 'ws', 'AutoSession save', desc = 'Save session' }, + { 'wa', 'AutoSession toggle', desc = 'Toggle autosave' }, + }, + + ---enables autocomplete for opts + ---@module "auto-session" + ---@type AutoSession.Config + opts = { + -- The following are already the default values, no need to provide them if these are already the settings you want. + session_lens = { + picker = nil, -- "telescope"|"snacks"|"fzf"|"select"|nil Pickers are detected automatically but you can also manually choose one. Falls back to vim.ui.select + mappings = { + -- Mode can be a string or a table, e.g. {"i", "n"} for both insert and normal mode + delete_session = { 'i', '' }, + alternate_session = { 'i', '' }, + copy_session = { 'i', '' }, + }, + + picker_opts = { + -- For Telescope, you can set theme options here, see: + -- https://github.com/nvim-telescope/telescope.nvim/blob/master/doc/telescope.txt#L112 + -- https://github.com/nvim-telescope/telescope.nvim/blob/master/lua/telescope/themes.lua + -- + -- border = true, + -- layout_config = { + -- width = 0.8, -- Can set width and height as percent of window + -- height = 0.5, + -- }, + + -- For Snacks, you can set layout options here, see: + -- https://github.com/folke/snacks.nvim/blob/main/docs/picker.md#%EF%B8%8F-layouts + -- + -- preset = "dropdown", + -- preview = false, + -- layout = { + -- width = 0.4, + -- height = 0.4, + -- }, + + -- For Fzf-Lua, picker_opts just turns into winopts, see: + -- https://github.com/ibhagwan/fzf-lua#customization + -- + -- height = 0.8, + -- width = 0.50, + }, + + -- Telescope only: If load_on_setup is false, make sure you use `:AutoSession search` to open the picker as it will initialize everything first + load_on_setup = true, + }, + }, +}