From f00b2866de46fab6fcac519b70dbec1d0c683f9b Mon Sep 17 00:00:00 2001 From: Arvin Verain Date: Mon, 29 Jul 2024 00:39:54 +0800 Subject: [PATCH 01/52] Remove redundant hlsearch option (#1058) --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 0d380e8..bfbb676 100644 --- a/init.lua +++ b/init.lua @@ -157,8 +157,8 @@ vim.opt.scrolloff = 10 -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` --- Set highlight on search, but clear on pressing in normal mode -vim.opt.hlsearch = true +-- Clear highlights on search when pressing in normal mode +-- See `:help hlsearch` vim.keymap.set('n', '', 'nohlsearch') -- Diagnostic keymaps From 1cef2325e0d28ec99c1d8446be4ea58b73028901 Mon Sep 17 00:00:00 2001 From: Brandon Clark Date: Sun, 28 Jul 2024 12:43:08 -0400 Subject: [PATCH 02/52] Modify conform comments to prevent deprecation warning when used (#1057) --- init.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index bfbb676..d4d7b8c 100644 --- a/init.lua +++ b/init.lua @@ -653,9 +653,8 @@ require('lazy').setup({ -- Conform can also run multiple formatters sequentially -- python = { "isort", "black" }, -- - -- You can use a sub-list to tell conform to run *until* a formatter - -- is found. - -- javascript = { { "prettierd", "prettier" } }, + -- You can use 'stop_after_first' to run the first available formatter from the list + -- javascript = { "prettierd", "prettier", stop_after_first = true }, }, }, }, From fd66454c4a02abb44568159e7447060b962e1b5d Mon Sep 17 00:00:00 2001 From: Ihsan Tonuzi <115842560+iton0@users.noreply.github.com> Date: Sun, 28 Jul 2024 17:39:34 -0400 Subject: [PATCH 03/52] refactor: remove lazydev and luvit-meta as lsp dependencies (#1047) --- init.lua | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/init.lua b/init.lua index d4d7b8c..5f442b6 100644 --- a/init.lua +++ b/init.lua @@ -399,7 +399,22 @@ require('lazy').setup({ end, }, - { -- LSP Configuration & Plugins + -- LSP Plugins + { + -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins + -- used for completion, annotations and signatures of Neovim apis + 'folke/lazydev.nvim', + ft = 'lua', + opts = { + library = { + -- Load luvit types when the `vim.uv` word is found + { path = 'luvit-meta/library', words = { 'vim%.uv' } }, + }, + }, + }, + { 'Bilal2453/luvit-meta', lazy = true }, + { + -- Main LSP Configuration 'neovim/nvim-lspconfig', dependencies = { -- Automatically install LSPs and related tools to stdpath for Neovim @@ -410,20 +425,6 @@ require('lazy').setup({ -- Useful status updates for LSP. -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` { 'j-hui/fidget.nvim', opts = {} }, - - -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins - -- used for completion, annotations and signatures of Neovim apis - { - 'folke/lazydev.nvim', - ft = 'lua', - opts = { - library = { - -- Load luvit types when the `vim.uv` word is found - { path = 'luvit-meta/library', words = { 'vim%.uv' } }, - }, - }, - }, - { 'Bilal2453/luvit-meta', lazy = true }, }, config = function() -- Brief aside: **What is LSP?** From 84cc12354dbe0ebda180d445f54820def8c4638f Mon Sep 17 00:00:00 2001 From: abeldekat <58370433+abeldekat@users.noreply.github.com> Date: Sun, 28 Jul 2024 21:41:34 +0000 Subject: [PATCH 04/52] performance: defer clipboard because xsel and pbcopy can be slow (#1049) --- init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 5f442b6..ee1d3b4 100644 --- a/init.lua +++ b/init.lua @@ -111,9 +111,12 @@ vim.opt.mouse = 'a' vim.opt.showmode = false -- Sync clipboard between OS and Neovim. +-- Schedule the setting after `UiEnter` because it can increase startup-time. -- Remove this option if you want your OS clipboard to remain independent. -- See `:help 'clipboard'` -vim.opt.clipboard = 'unnamedplus' +vim.schedule(function() + vim.opt.clipboard = 'unnamedplus' +end) -- Enable break indent vim.opt.breakindent = true From bb9f84ca8f37c97ae248575680fc73c72ced471d Mon Sep 17 00:00:00 2001 From: jstrot <44594069+jstrot@users.noreply.github.com> Date: Mon, 29 Jul 2024 20:01:19 -0400 Subject: [PATCH 05/52] Remove treesitter prefer_git option (#1061) - It's not safe and can corrupt other git repos - nvim-treesiter maintainers consider `prefer_git` as deprecated and no longer needed. See nvim-treesitter PR for details: https://github.com/nvim-treesitter/nvim-treesitter/pull/6959 --- init.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/init.lua b/init.lua index ee1d3b4..04c5896 100644 --- a/init.lua +++ b/init.lua @@ -856,8 +856,6 @@ require('lazy').setup({ config = function(_, opts) -- [[ Configure Treesitter ]] See `:help nvim-treesitter` - -- Prefer git instead of curl in order to improve connectivity in some environments - require('nvim-treesitter.install').prefer_git = true ---@diagnostic disable-next-line: missing-fields require('nvim-treesitter.configs').setup(opts) From 186018483039b20dc39d7991e4fb28090dd4750e Mon Sep 17 00:00:00 2001 From: jstrot <44594069+jstrot@users.noreply.github.com> Date: Mon, 29 Jul 2024 20:02:37 -0400 Subject: [PATCH 06/52] Add explicit dependency of nvim-lspconfig on cmp-nvim-lsp (#1042) --- init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init.lua b/init.lua index 04c5896..220d304 100644 --- a/init.lua +++ b/init.lua @@ -428,6 +428,9 @@ require('lazy').setup({ -- Useful status updates for LSP. -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` { 'j-hui/fidget.nvim', opts = {} }, + + -- Allows extra capabilities provided by nvim-cmp + 'hrsh7th/cmp-nvim-lsp', }, config = function() -- Brief aside: **What is LSP?** From 5ad7502e8808fcd89e8c2c4af959d9d5cbc4a21b Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Wed, 31 Jul 2024 12:04:05 +0200 Subject: [PATCH 07/52] surround neovide settings with UIEnter event, helps remote connections --- lua/options.lua | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/lua/options.lua b/lua/options.lua index cea6b52..00b5ee8 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -92,12 +92,17 @@ vim.opt.sidescrolloff = 12 -- Set cursor pointer to block vim.opt.guicursor = 'n-v-i-c:block-Cursor' --- Options specifically targeted at Neovide -if vim.g.neovide then - vim.o.guifont = 'CaskaydiaCove Nerd Font Mono:h14' - vim.g.neovide_hide_mouse_when_typing = true - vim.g.neovide_cursor_animation_length = 0 - vim.g.neovide_cursor_trail_length = 0 -end +vim.api.nvim_create_autocmd('UIEnter', { + group = vim.api.nvim_create_augroup('SetGUISettings', { clear = true }), + callback = function() + -- Options specifically targeted at Neovide + if vim.g.neovide then + vim.o.guifont = 'CaskaydiaCove Nerd Font Mono:h14' + vim.g.neovide_hide_mouse_when_typing = true + vim.g.neovide_cursor_animation_length = 0 + vim.g.neovide_cursor_trail_length = 0 + end + end, +}) -- vim: ts=2 sts=2 sw=2 et From 9fb7d5de4bc8a3fe4e76e830bfe034ab1e4f9d5d Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 1 Aug 2024 00:23:53 +0200 Subject: [PATCH 08/52] hover documentation for function in insert mode --- lua/kickstart/plugins/lspconfig.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/kickstart/plugins/lspconfig.lua b/lua/kickstart/plugins/lspconfig.lua index de84c51..de3d856 100644 --- a/lua/kickstart/plugins/lspconfig.lua +++ b/lua/kickstart/plugins/lspconfig.lua @@ -107,6 +107,8 @@ return { -- Opens a popup that displays documentation about the word under your cursor -- See `:help K` for why this keymap. map('K', vim.lsp.buf.hover, 'Hover Documentation') + -- Similar as above, shows hover documentation for current function + vim.keymap.set('i', '', vim.lsp.buf.signature_help, { buffer = event.buf, desc = 'LSP: ' .. 'Hover Signature Information' }) -- WARN: This is not Goto Definition, this is Goto Declaration. -- For example, in C this would take you to the header. From 37ccad6701f8efbc587f18ac4c1bd193e951b5cf Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 1 Aug 2024 10:50:36 +0200 Subject: [PATCH 09/52] show hidden files by default in oil.nvim --- lua/custom/plugins/oil.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lua/custom/plugins/oil.lua b/lua/custom/plugins/oil.lua index ed6ae3a..5da3382 100644 --- a/lua/custom/plugins/oil.lua +++ b/lua/custom/plugins/oil.lua @@ -10,11 +10,14 @@ vim.api.nvim_create_autocmd('BufLeave', { return { 'stevearc/oil.nvim', - opts = {}, -- Optional dependencies dependencies = { 'nvim-tree/nvim-web-devicons' }, config = function() - require('oil').setup() + require('oil').setup({ + view_options = { + show_hidden = true + } + }) vim.keymap.set('n', 'fe', require('oil').open, { desc = '[F]ile [E]xplorer' }) end, } From 12aa2d8a7bfca99c038079343c04aa184be7fcd2 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 1 Aug 2024 10:50:55 +0200 Subject: [PATCH 10/52] delete unused parameter in options --- lua/options.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/options.lua b/lua/options.lua index 00b5ee8..6338d72 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -4,7 +4,7 @@ -- For more options, you can see `:help option-list` -- Set display language -vim.cmd('language en_US', {}) +vim.cmd 'language en_US' -- Shell options -- Sets the shell to use for system() and ! commands in windows From 15d4cfcdf7e2b8ececd07bdaffddad30c891ac98 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 1 Aug 2024 10:58:47 +0200 Subject: [PATCH 11/52] toggle oil.nvim fullscreen window --- lua/custom/plugins/oil.lua | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/lua/custom/plugins/oil.lua b/lua/custom/plugins/oil.lua index 5da3382..4704761 100644 --- a/lua/custom/plugins/oil.lua +++ b/lua/custom/plugins/oil.lua @@ -13,11 +13,19 @@ return { -- Optional dependencies dependencies = { 'nvim-tree/nvim-web-devicons' }, config = function() - require('oil').setup({ + local oil = require 'oil' + oil.setup { view_options = { - show_hidden = true - } - }) - vim.keymap.set('n', 'fe', require('oil').open, { desc = '[F]ile [E]xplorer' }) + show_hidden = true, + }, + } + + vim.keymap.set('n', 'fe', function() + if vim.bo.filetype == 'oil' then + oil.close() + else + oil.open() + end + end, { desc = '[F]ile [E]xplorer' }) end, } From 69c8790f6e60f3743f92ebd7801b3852bba1c4f0 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 1 Aug 2024 11:08:00 +0200 Subject: [PATCH 12/52] configure keymaps during plugin config --- lua/custom/plugins/codeium.lua | 7 ++++--- lua/custom/plugins/fugitive.lua | 23 ++++++++++++----------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/lua/custom/plugins/codeium.lua b/lua/custom/plugins/codeium.lua index 2ffc237..e8d1d58 100644 --- a/lua/custom/plugins/codeium.lua +++ b/lua/custom/plugins/codeium.lua @@ -1,8 +1,9 @@ --- Set keymap to open chat in browser -vim.keymap.set('n', 'cc', ':execute codeium#Chat()', { desc = '[C]odeium [C]hat' }) - return { -- Free Github Copilot alternative 'Exafunction/codeium.vim', event = 'BufEnter', + config = function() + -- Set keymap to open chat in browser + vim.keymap.set('n', 'cc', ':execute codeium#Chat()', { desc = '[C]odeium [C]hat' }) + end, } diff --git a/lua/custom/plugins/fugitive.lua b/lua/custom/plugins/fugitive.lua index 665d462..c6f71a0 100644 --- a/lua/custom/plugins/fugitive.lua +++ b/lua/custom/plugins/fugitive.lua @@ -1,14 +1,3 @@ --- Switch in fugitive.vim status window with the current one -vim.keymap.set('n', 'gs', 'Gedit :', { desc = '[G]it [S]tatus' }) --- Fetch all changes -vim.keymap.set('n', 'gF', 'Git fetch', { desc = '[G]it [F]etch' }) --- Push changes -vim.keymap.set('n', 'gP', 'Git push', { desc = '[G]it [P]ush' }) --- Pull changes -vim.keymap.set('n', 'gp', 'Git pull', { desc = '[G]it [P]ull' }) --- Open history graph -vim.keymap.set('n', 'gl', 'Flogsplitwincmd kq', { desc = '[G]it [L]og' }) - return { -- Git related plugins 'tpope/vim-fugitive', @@ -20,4 +9,16 @@ return { }, 'idanarye/vim-merginal', }, + config = function() + -- Switch in fugitive.vim status window with the current one + vim.keymap.set('n', 'gs', 'Gedit :', { desc = '[G]it [S]tatus' }) + -- Fetch all changes + vim.keymap.set('n', 'gF', 'Git fetch', { desc = '[G]it [F]etch' }) + -- Push changes + vim.keymap.set('n', 'gP', 'Git push', { desc = '[G]it [P]ush' }) + -- Pull changes + vim.keymap.set('n', 'gp', 'Git pull', { desc = '[G]it [P]ull' }) + -- Open history graph + vim.keymap.set('n', 'gl', 'Flogsplitwincmd kq', { desc = '[G]it [L]og' }) + end, } From 9a4a5f31ae40021cd2bf023fcf4e7b1a602d1ea6 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 1 Aug 2024 11:10:08 +0200 Subject: [PATCH 13/52] configure highlighting during plugin config --- lua/custom/plugins/conflictmarker.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lua/custom/plugins/conflictmarker.lua b/lua/custom/plugins/conflictmarker.lua index 4bc246d..896a921 100644 --- a/lua/custom/plugins/conflictmarker.lua +++ b/lua/custom/plugins/conflictmarker.lua @@ -5,17 +5,17 @@ vim.g.conflict_marker_highlight_group = '' vim.g.conflict_marker_begin = '^<<<<<<< .*$' vim.g.conflict_marker_end = '^>>>>>>> .*$' --- Highlight groups -vim.cmd 'highlight ConflictMarkerBegin guibg=#2f7366' -vim.cmd 'highlight ConflictMarkerOurs guibg=#2e5049' -vim.cmd 'highlight ConflictMarkerTheirs guibg=#344f69' -vim.cmd 'highlight ConflictMarkerEnd guibg=#2f628e' -vim.cmd 'highlight ConflictMarkerCommonAncestorsHunk guibg=#754a81' - -- Git conflict marker management plugin return { 'rhysd/conflict-marker.vim', config = function() + -- Highlight groups + vim.cmd 'highlight ConflictMarkerBegin guibg=#2f7366' + vim.cmd 'highlight ConflictMarkerOurs guibg=#2e5049' + vim.cmd 'highlight ConflictMarkerTheirs guibg=#344f69' + vim.cmd 'highlight ConflictMarkerEnd guibg=#2f628e' + vim.cmd 'highlight ConflictMarkerCommonAncestorsHunk guibg=#754a81' + -- Read all lines in buffer, check if there is any conflict marker function git_conflict_detection() local lines = vim.api.nvim_buf_get_lines(0, 0, -1, false) From e95ecf56e6acc55332ba894f7b7628b532aea6c8 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 1 Aug 2024 11:24:59 +0200 Subject: [PATCH 14/52] remove rarely used AI plugin --- lua/custom/plugins/codeium.lua | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 lua/custom/plugins/codeium.lua diff --git a/lua/custom/plugins/codeium.lua b/lua/custom/plugins/codeium.lua deleted file mode 100644 index e8d1d58..0000000 --- a/lua/custom/plugins/codeium.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - -- Free Github Copilot alternative - 'Exafunction/codeium.vim', - event = 'BufEnter', - config = function() - -- Set keymap to open chat in browser - vim.keymap.set('n', 'cc', ':execute codeium#Chat()', { desc = '[C]odeium [C]hat' }) - end, -} From 689f994fbdabd144b019b456a22b2ef70eefe43c Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 1 Aug 2024 11:29:28 +0200 Subject: [PATCH 15/52] unify layz plugin import, allow return multiple plugins per file --- lua/custom/plugins/conflictmarker.lua | 64 +++++++++++---------- lua/custom/plugins/fugitive.lua | 42 +++++++------- lua/custom/plugins/lastplace.lua | 4 +- lua/custom/plugins/lualine.lua | 20 ++++--- lua/custom/plugins/markdown.lua | 16 +++--- lua/custom/plugins/neoscroll.lua | 50 ++++++++-------- lua/custom/plugins/oil.lua | 38 +++++++------ lua/custom/plugins/overseer.lua | 82 ++++++++++++++------------- 8 files changed, 166 insertions(+), 150 deletions(-) diff --git a/lua/custom/plugins/conflictmarker.lua b/lua/custom/plugins/conflictmarker.lua index 896a921..d2c68fe 100644 --- a/lua/custom/plugins/conflictmarker.lua +++ b/lua/custom/plugins/conflictmarker.lua @@ -7,38 +7,40 @@ vim.g.conflict_marker_end = '^>>>>>>> .*$' -- Git conflict marker management plugin return { - 'rhysd/conflict-marker.vim', - config = function() - -- Highlight groups - vim.cmd 'highlight ConflictMarkerBegin guibg=#2f7366' - vim.cmd 'highlight ConflictMarkerOurs guibg=#2e5049' - vim.cmd 'highlight ConflictMarkerTheirs guibg=#344f69' - vim.cmd 'highlight ConflictMarkerEnd guibg=#2f628e' - vim.cmd 'highlight ConflictMarkerCommonAncestorsHunk guibg=#754a81' + { + 'rhysd/conflict-marker.vim', + config = function() + -- Highlight groups + vim.cmd 'highlight ConflictMarkerBegin guibg=#2f7366' + vim.cmd 'highlight ConflictMarkerOurs guibg=#2e5049' + vim.cmd 'highlight ConflictMarkerTheirs guibg=#344f69' + vim.cmd 'highlight ConflictMarkerEnd guibg=#2f628e' + vim.cmd 'highlight ConflictMarkerCommonAncestorsHunk guibg=#754a81' - -- Read all lines in buffer, check if there is any conflict marker - function git_conflict_detection() - local lines = vim.api.nvim_buf_get_lines(0, 0, -1, false) - -- Check if strict regex is contained in any line - local beginning = vim.fn.match(lines, vim.g.conflict_marker_begin) - local ending = vim.fn.match(lines, vim.g.conflict_marker_end) - local enabled = vim.diagnostic.is_enabled() - if (beginning > -1 or ending > -1) and enabled then - vim.diagnostic.enable(false) - elseif not enabled then - vim.diagnostic.enable(true) + -- Read all lines in buffer, check if there is any conflict marker + function git_conflict_detection() + local lines = vim.api.nvim_buf_get_lines(0, 0, -1, false) + -- Check if strict regex is contained in any line + local beginning = vim.fn.match(lines, vim.g.conflict_marker_begin) + local ending = vim.fn.match(lines, vim.g.conflict_marker_end) + local enabled = vim.diagnostic.is_enabled() + if (beginning > -1 or ending > -1) and enabled then + vim.diagnostic.enable(false) + elseif not enabled then + vim.diagnostic.enable(true) + end end - end - -- Autocommand to disable diagnostics on buffer enter - vim.api.nvim_create_autocmd('BufRead', { - group = vim.api.nvim_create_augroup('git-conflict-lsp-disable', { clear = true }), - callback = git_conflict_detection, - }) - -- Autocommand to disable diagnostics on save - vim.api.nvim_create_autocmd('BufWritePre', { - group = vim.api.nvim_create_augroup('git-conflict-lsp-disable', { clear = false }), - callback = git_conflict_detection, - }) - end, + -- Autocommand to disable diagnostics on buffer enter + vim.api.nvim_create_autocmd('BufRead', { + group = vim.api.nvim_create_augroup('git-conflict-lsp-disable', { clear = true }), + callback = git_conflict_detection, + }) + -- Autocommand to disable diagnostics on save + vim.api.nvim_create_autocmd('BufWritePre', { + group = vim.api.nvim_create_augroup('git-conflict-lsp-disable', { clear = false }), + callback = git_conflict_detection, + }) + end, + }, } diff --git a/lua/custom/plugins/fugitive.lua b/lua/custom/plugins/fugitive.lua index c6f71a0..65121d3 100644 --- a/lua/custom/plugins/fugitive.lua +++ b/lua/custom/plugins/fugitive.lua @@ -1,24 +1,26 @@ return { - -- Git related plugins - 'tpope/vim-fugitive', - dependencies = { - { - 'rbong/vim-flog', - lazy = true, - cmd = { 'Flogsplit' }, + { + -- Git related plugins + 'tpope/vim-fugitive', + dependencies = { + { + 'rbong/vim-flog', + lazy = true, + cmd = { 'Flogsplit' }, + }, + 'idanarye/vim-merginal', }, - 'idanarye/vim-merginal', + config = function() + -- Switch in fugitive.vim status window with the current one + vim.keymap.set('n', 'gs', 'Gedit :', { desc = '[G]it [S]tatus' }) + -- Fetch all changes + vim.keymap.set('n', 'gF', 'Git fetch', { desc = '[G]it [F]etch' }) + -- Push changes + vim.keymap.set('n', 'gP', 'Git push', { desc = '[G]it [P]ush' }) + -- Pull changes + vim.keymap.set('n', 'gp', 'Git pull', { desc = '[G]it [P]ull' }) + -- Open history graph + vim.keymap.set('n', 'gl', 'Flogsplitwincmd kq', { desc = '[G]it [L]og' }) + end, }, - config = function() - -- Switch in fugitive.vim status window with the current one - vim.keymap.set('n', 'gs', 'Gedit :', { desc = '[G]it [S]tatus' }) - -- Fetch all changes - vim.keymap.set('n', 'gF', 'Git fetch', { desc = '[G]it [F]etch' }) - -- Push changes - vim.keymap.set('n', 'gP', 'Git push', { desc = '[G]it [P]ush' }) - -- Pull changes - vim.keymap.set('n', 'gp', 'Git pull', { desc = '[G]it [P]ull' }) - -- Open history graph - vim.keymap.set('n', 'gl', 'Flogsplitwincmd kq', { desc = '[G]it [L]og' }) - end, } diff --git a/lua/custom/plugins/lastplace.lua b/lua/custom/plugins/lastplace.lua index 0859311..61e50c4 100644 --- a/lua/custom/plugins/lastplace.lua +++ b/lua/custom/plugins/lastplace.lua @@ -1,4 +1,6 @@ -- Plugin to intelligently reopen files at last edit position return { - 'farmergreg/vim-lastplace', + { + 'farmergreg/vim-lastplace', + }, } diff --git a/lua/custom/plugins/lualine.lua b/lua/custom/plugins/lualine.lua index 59c98e6..070430a 100644 --- a/lua/custom/plugins/lualine.lua +++ b/lua/custom/plugins/lualine.lua @@ -1,13 +1,15 @@ return { - -- Set lualine as statusline - 'nvim-lualine/lualine.nvim', - -- See `:help lualine.txt` - opts = { - options = { - icons_enabled = vim.g.have_nerd_font, - theme = 'catppuccin', - section_separators = { left = '', right = '' }, - component_separators = { left = '', right = '' }, + { + -- Set lualine as statusline + 'nvim-lualine/lualine.nvim', + -- See `:help lualine.txt` + opts = { + options = { + icons_enabled = vim.g.have_nerd_font, + theme = 'catppuccin', + section_separators = { left = '', right = '' }, + component_separators = { left = '', right = '' }, + }, }, }, } diff --git a/lua/custom/plugins/markdown.lua b/lua/custom/plugins/markdown.lua index 53baa36..79e6d9c 100644 --- a/lua/custom/plugins/markdown.lua +++ b/lua/custom/plugins/markdown.lua @@ -1,10 +1,12 @@ -- Markdown preview plugin return { - 'iamcco/markdown-preview.nvim', - cmd = { 'MarkdownPreviewToggle', 'MarkdownPreview', 'MarkdownPreviewStop' }, - build = 'cd app; npm install', - init = function() - vim.g.mkdp_filetypes = { 'markdown' } - end, - ft = { 'markdown' }, + { + 'iamcco/markdown-preview.nvim', + cmd = { 'MarkdownPreviewToggle', 'MarkdownPreview', 'MarkdownPreviewStop' }, + build = 'cd app; npm install', + init = function() + vim.g.mkdp_filetypes = { 'markdown' } + end, + ft = { 'markdown' }, + }, } diff --git a/lua/custom/plugins/neoscroll.lua b/lua/custom/plugins/neoscroll.lua index 61b9ac7..5dfa325 100644 --- a/lua/custom/plugins/neoscroll.lua +++ b/lua/custom/plugins/neoscroll.lua @@ -1,28 +1,30 @@ -- Smooth scroll plugin and keymaps return { - 'karb94/neoscroll.nvim', - enabled = not vim.g.neovide, - config = function() - require('neoscroll').setup { - hide_cursor = false, - easing_function = nil, - respect_scrolloff = true, - } + { + 'karb94/neoscroll.nvim', + enabled = not vim.g.neovide, + config = function() + require('neoscroll').setup { + hide_cursor = false, + easing_function = nil, + respect_scrolloff = true, + } - require('neoscroll.config').set_mappings { - -- Scroll normally - [''] = { 'scroll', { '-vim.wo.scroll', 'true', '50' } }, - [''] = { 'scroll', { 'vim.wo.scroll', 'true', '50' } }, - -- Scroll entire page height - [''] = { 'scroll', { '-vim.api.nvim_win_get_height(0)', 'true', '80' } }, - [''] = { 'scroll', { 'vim.api.nvim_win_get_height(0)', 'true', '80' } }, - -- Scroll 10% at a time - [''] = { 'scroll', { '-0.10', 'false', '25' } }, - [''] = { 'scroll', { '0.10', 'false', '25' } }, - -- Jump to top, bottom and center - ['zt'] = { 'zt', { '40' } }, - ['zz'] = { 'zz', { '50' } }, - ['zb'] = { 'zb', { '40' } }, - } - end, + require('neoscroll.config').set_mappings { + -- Scroll normally + [''] = { 'scroll', { '-vim.wo.scroll', 'true', '50' } }, + [''] = { 'scroll', { 'vim.wo.scroll', 'true', '50' } }, + -- Scroll entire page height + [''] = { 'scroll', { '-vim.api.nvim_win_get_height(0)', 'true', '80' } }, + [''] = { 'scroll', { 'vim.api.nvim_win_get_height(0)', 'true', '80' } }, + -- Scroll 10% at a time + [''] = { 'scroll', { '-0.10', 'false', '25' } }, + [''] = { 'scroll', { '0.10', 'false', '25' } }, + -- Jump to top, bottom and center + ['zt'] = { 'zt', { '40' } }, + ['zz'] = { 'zz', { '50' } }, + ['zb'] = { 'zb', { '40' } }, + } + end, + }, } diff --git a/lua/custom/plugins/oil.lua b/lua/custom/plugins/oil.lua index 4704761..01c9cdf 100644 --- a/lua/custom/plugins/oil.lua +++ b/lua/custom/plugins/oil.lua @@ -9,23 +9,25 @@ vim.api.nvim_create_autocmd('BufLeave', { }) return { - 'stevearc/oil.nvim', - -- Optional dependencies - dependencies = { 'nvim-tree/nvim-web-devicons' }, - config = function() - local oil = require 'oil' - oil.setup { - view_options = { - show_hidden = true, - }, - } + { + 'stevearc/oil.nvim', + -- Optional dependencies + dependencies = { 'nvim-tree/nvim-web-devicons' }, + config = function() + local oil = require 'oil' + oil.setup { + view_options = { + show_hidden = true, + }, + } - vim.keymap.set('n', 'fe', function() - if vim.bo.filetype == 'oil' then - oil.close() - else - oil.open() - end - end, { desc = '[F]ile [E]xplorer' }) - end, + vim.keymap.set('n', 'fe', function() + if vim.bo.filetype == 'oil' then + oil.close() + else + oil.open() + end + end, { desc = '[F]ile [E]xplorer' }) + end, + }, } diff --git a/lua/custom/plugins/overseer.lua b/lua/custom/plugins/overseer.lua index 51946f0..380929a 100644 --- a/lua/custom/plugins/overseer.lua +++ b/lua/custom/plugins/overseer.lua @@ -1,47 +1,49 @@ return { - -- Simple task runner plugin - 'stevearc/overseer.nvim', - opts = {}, - config = function() - local overseer = require 'overseer' - overseer.setup { - templates = { - 'builtin', - 'golang.run_project', - 'golang.run_file', - }, - task_list = { - bindings = { - [''] = false, - [''] = false, - [''] = false, - [''] = false, - ['q'] = false, + { + -- Simple task runner plugin + 'stevearc/overseer.nvim', + opts = {}, + config = function() + local overseer = require 'overseer' + overseer.setup { + templates = { + 'builtin', + 'golang.run_project', + 'golang.run_file', }, - }, - } + task_list = { + bindings = { + [''] = false, + [''] = false, + [''] = false, + [''] = false, + ['q'] = false, + }, + }, + } - -- Reference: overseer.nvim/lua/overseer/window.lua - local function is_open() - for _, winid in ipairs(vim.api.nvim_tabpage_list_wins(0)) do - local bufnr = vim.api.nvim_win_get_buf(winid) - if vim.bo[bufnr].filetype == 'OverseerList' then - return true + -- Reference: overseer.nvim/lua/overseer/window.lua + local function is_open() + for _, winid in ipairs(vim.api.nvim_tabpage_list_wins(0)) do + local bufnr = vim.api.nvim_win_get_buf(winid) + if vim.bo[bufnr].filetype == 'OverseerList' then + return true + end end + return false end - return false - end - -- Display status info about tasks - vim.keymap.set('n', 'ol', function() - overseer.toggle { winid = 0 } - if is_open() then - vim.cmd.winc '_' - else - vim.api.nvim_buf_delete(vim.api.nvim_get_current_buf(), {}) - end - end, { desc = '[O]verseer [L]og' }) - -- Run task by listing all in floating - vim.keymap.set('n', 'or', 'OverseerRun', { desc = '[O]verseer [R]un' }) - end, + -- Display status info about tasks + vim.keymap.set('n', 'ol', function() + overseer.toggle { winid = 0 } + if is_open() then + vim.cmd.winc '_' + else + vim.api.nvim_buf_delete(vim.api.nvim_get_current_buf(), {}) + end + end, { desc = '[O]verseer [L]og' }) + -- Run task by listing all in floating + vim.keymap.set('n', 'or', 'OverseerRun', { desc = '[O]verseer [R]un' }) + end, + }, } From 1d1d8447f736ca08fe226fa98b0ec9c6e020f2a9 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Mon, 5 Aug 2024 16:25:19 +0200 Subject: [PATCH 16/52] added keymap to paste in terminal mode --- lua/keymaps.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/keymaps.lua b/lua/keymaps.lua index bd6f40d..b2035e0 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -137,6 +137,8 @@ if vim.g.neovide then vim.keymap.set({ 'n', 'v' }, '', '"+p', { desc = 'Paste from System clipboard' }) -- Clipboard for command and insert mode vim.keymap.set({ 'c', 'i' }, '', '+', { desc = 'Paste from System clipboard' }) + -- Clipboard for terminal mode + vim.keymap.set({ 't' }, '', '"+pi', { desc = 'Paste from System clipboard' }) end -- [[ Basic Autocommands ]] From 842c704a9943a9557cf399d4545cd9c77df9ca9e Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Wed, 7 Aug 2024 12:16:39 +0200 Subject: [PATCH 17/52] use quickfix instead of locations list for diagnostics --- lua/keymaps.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/keymaps.lua b/lua/keymaps.lua index b2035e0..94295fe 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -9,7 +9,7 @@ vim.keymap.set('n', '', 'nohlsearch') vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' }) 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.keymap.set('n', 'q', vim.diagnostic.setqflist, { desc = 'Open diagnostic [Q]uickfix list' }) -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier -- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping From cfaf706a07e7968efafbeec362dd240f1033d976 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Wed, 7 Aug 2024 12:21:08 +0200 Subject: [PATCH 18/52] delete unused void register keymaps --- lua/keymaps.lua | 5 ----- lua/kickstart/plugins/which-key.lua | 5 +---- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 94295fe..22e0ab4 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -33,11 +33,6 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the right win vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) --- Delete (currently selected) text without yanking it -vim.keymap.set({ 'n', 'v' }, 'dny', '"_d', { desc = '[D]elete [N]o [Y]ank' }) --- Replace currently selected text with default register without yanking it -vim.keymap.set('v', 'pny', '"_dP', { desc = '[P]aste [N]o [Y]ank' }) - -- Populate CMD to prepare for change directory vim.keymap.set('n', 'cd ', ':cd ', { desc = 'Prepare CMD for [C]hange [D]irectory' }) -- Navigate to 'base' directory, the initial dir that nvim was run in diff --git a/lua/kickstart/plugins/which-key.lua b/lua/kickstart/plugins/which-key.lua index a0d711f..66a2b4e 100644 --- a/lua/kickstart/plugins/which-key.lua +++ b/lua/kickstart/plugins/which-key.lua @@ -22,7 +22,7 @@ return { -- Document existing key chains require('which-key').add { { 'c', group = '[C]ode-/[C]hange' }, - { 'd', group = '[D]ocument/[D]elete', mode = { 'n', 'v' } }, + { 'd', group = '[D]ocument' }, { 'r', group = '[R]ename' }, { 's', group = '[S]earch' }, { 'w', group = '[W]orkspace' }, @@ -31,12 +31,9 @@ return { { 'g', group = '[G]it/[G]lobal', mode = { 'n', 'v' } }, { 'b', group = '[B]uffer/[B]reakpoint' }, { 'cd', group = '[D]irectory' }, - { 'dn', group = '[N]o', mode = { 'n', 'v' } }, { 'l', group = '[L]ist', mode = { 'n', 'v' } }, { 'f', group = '[F]ormat/[F]ile', mode = { 'n', 'v' } }, { 'o', group = '[O]verseer', mode = { 'n', 'v' } }, - { 'p', group = '[P]aste', mode = { 'v' } }, - { 'pn', group = '[N]o', mode = { 'v' } }, } end, }, From 2fec155b775213466979ccbdf8362024becbc4e2 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Wed, 7 Aug 2024 12:21:50 +0200 Subject: [PATCH 19/52] bugfix: overseer delete only empty buffer --- lua/custom/plugins/overseer.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/custom/plugins/overseer.lua b/lua/custom/plugins/overseer.lua index 380929a..3c39ef4 100644 --- a/lua/custom/plugins/overseer.lua +++ b/lua/custom/plugins/overseer.lua @@ -36,10 +36,11 @@ return { -- Display status info about tasks vim.keymap.set('n', 'ol', function() overseer.toggle { winid = 0 } + local bufnr = vim.api.nvim_get_current_buf() if is_open() then vim.cmd.winc '_' - else - vim.api.nvim_buf_delete(vim.api.nvim_get_current_buf(), {}) + elseif vim.bo[bufnr].filetype == '' and vim.bo.buftype ~= 'terminal' then + vim.api.nvim_buf_delete(bufnr, {}) end end, { desc = '[O]verseer [L]og' }) -- Run task by listing all in floating From 08f5acc7edf9c03243f74ea6e9d8d1d6241a7535 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Wed, 7 Aug 2024 12:22:43 +0200 Subject: [PATCH 20/52] toggle additional overseer splits if window already split --- lua/custom/plugins/overseer.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/custom/plugins/overseer.lua b/lua/custom/plugins/overseer.lua index 3c39ef4..242d0be 100644 --- a/lua/custom/plugins/overseer.lua +++ b/lua/custom/plugins/overseer.lua @@ -35,6 +35,12 @@ return { -- Display status info about tasks vim.keymap.set('n', 'ol', function() + local curWindows = #vim.api.nvim_tabpage_list_wins(0) + if curWindows ~= (is_open() and 2 or 1) then + vim.cmd 'OverseerToggle' + return + end + overseer.toggle { winid = 0 } local bufnr = vim.api.nvim_get_current_buf() if is_open() then From 57212d3f272bc5f1e48f0476af1fb529cdecac4c Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Wed, 7 Aug 2024 12:23:21 +0200 Subject: [PATCH 21/52] comment longer overseer keymap --- lua/custom/plugins/overseer.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/custom/plugins/overseer.lua b/lua/custom/plugins/overseer.lua index 242d0be..fa23203 100644 --- a/lua/custom/plugins/overseer.lua +++ b/lua/custom/plugins/overseer.lua @@ -35,17 +35,22 @@ return { -- Display status info about tasks vim.keymap.set('n', 'ol', function() + -- Get currently open windows (detects splits) local curWindows = #vim.api.nvim_tabpage_list_wins(0) + -- Use builtin toggle if already using splits if curWindows ~= (is_open() and 2 or 1) then vim.cmd 'OverseerToggle' return end + -- Otherwise, toggle overseer in fullscreen overseer.toggle { winid = 0 } local bufnr = vim.api.nvim_get_current_buf() if is_open() then + -- Maximize height vim.cmd.winc '_' elseif vim.bo[bufnr].filetype == '' and vim.bo.buftype ~= 'terminal' then + -- Delete empty buffer created by overseer vim.api.nvim_buf_delete(bufnr, {}) end end, { desc = '[O]verseer [L]og' }) From 8c712f86f8a60efb9e40456adecf51273d2e3345 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 15 Aug 2024 11:38:54 +0200 Subject: [PATCH 22/52] install powershell_es for lsp and parser in treesitter --- lua/kickstart/plugins/lspconfig.lua | 1 + lua/kickstart/plugins/treesitter.lua | 1 + 2 files changed, 2 insertions(+) diff --git a/lua/kickstart/plugins/lspconfig.lua b/lua/kickstart/plugins/lspconfig.lua index 1f3bee4..c81bca1 100644 --- a/lua/kickstart/plugins/lspconfig.lua +++ b/lua/kickstart/plugins/lspconfig.lua @@ -175,6 +175,7 @@ return { -- - settings (table): Override the default settings passed when initializing the server. -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { + powershell_es = {}, rust_analyzer = {}, tailwindcss = {}, omnisharp = {}, diff --git a/lua/kickstart/plugins/treesitter.lua b/lua/kickstart/plugins/treesitter.lua index 60b3848..e41d336 100644 --- a/lua/kickstart/plugins/treesitter.lua +++ b/lua/kickstart/plugins/treesitter.lua @@ -30,6 +30,7 @@ return { 'rust', 'c_sharp', 'go', + 'powershell', -- git 'gitcommit', 'gitignore', From 2758e420cc42098debc1c419a7f1c2bf2cb6d3e8 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 15 Aug 2024 11:45:50 +0200 Subject: [PATCH 23/52] create keymap to access merginal plugin easier --- lua/custom/plugins/fugitive.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/custom/plugins/fugitive.lua b/lua/custom/plugins/fugitive.lua index 65121d3..1732799 100644 --- a/lua/custom/plugins/fugitive.lua +++ b/lua/custom/plugins/fugitive.lua @@ -21,6 +21,8 @@ return { vim.keymap.set('n', 'gp', 'Git pull', { desc = '[G]it [P]ull' }) -- Open history graph vim.keymap.set('n', 'gl', 'Flogsplitwincmd kq', { desc = '[G]it [L]og' }) + -- Open branch manager + vim.keymap.set('n', 'gm', 'Merginal', { desc = '[G]it [M]erginal' }) end, }, } From bebfb5808f8a63a7b32f97b48a905a18060dab04 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Tue, 20 Aug 2024 08:42:51 +0200 Subject: [PATCH 24/52] bugfix: fix path keymap to lowercase for edgecases --- lua/keymaps.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 22e0ab4..faabbfa 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -120,8 +120,8 @@ vim.keymap.set({ 'n', 'v' }, 'gy', global_cmd_yank, { desc = '[G]lobal c -- Fix filename keymap vim.keymap.set({ 'n', 'v' }, 'fp', function() -- lua print(string.gsub(vim.api.nvim_buf_get_name(0), vim.fn.getcwd(), '')) - local cwd = vim.fn.getcwd() - local path = vim.api.nvim_buf_get_name(0) + local cwd = vim.fn.getcwd():lower() + local path = vim.api.nvim_buf_get_name(0):lower() local file, _ = string.gsub(path, cwd .. '\\', '') vim.cmd('0f | file ' .. file) end, { desc = '[F]ile Fix Relative [P]ath' }) From c1ae9092cbd2b75ee25284a594209a8147609cef Mon Sep 17 00:00:00 2001 From: theoboldalex <44616505+theoboldalex@users.noreply.github.com> Date: Thu, 22 Aug 2024 21:49:25 +0100 Subject: [PATCH 25/52] Update README.md (#1091) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3f19854..0b56eab 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,8 @@ External Requirements: - A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons - if you have it set `vim.g.have_nerd_font` in `init.lua` to true - Language Setup: - - If want to write Typescript, you need `npm` - - If want to write Golang, you will need `go` + - If you want to write Typescript, you need `npm` + - If you want to write Golang, you will need `go` - etc. > **NOTE** From 554a054bf9e0f04b637b7913b17327606f0ec9d0 Mon Sep 17 00:00:00 2001 From: Matt Gallagher <46973220+mattgallagher92@users.noreply.github.com> Date: Thu, 22 Aug 2024 21:53:57 +0100 Subject: [PATCH 26/52] Add note in README about lazy-lock.json (#1090) --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 0b56eab..53ae459 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,10 @@ fork to your machine using one of the commands below, depending on your OS. > Your fork's url will be something like this: > `https://github.com//kickstart.nvim.git` +You likely want to remove `lazy-lock.json` from your fork's `.gitignore` file +too - it's ignored in the kickstart repo to make maintenance easier, but it's +[recommmended to track it in version control](https://lazy.folke.io/usage/lockfile). + #### Clone kickstart.nvim > **NOTE** > If following the recommended step above (i.e., forking the repo), replace From ce0c7340fff68fb45d817478a8c0facb24425149 Mon Sep 17 00:00:00 2001 From: "Michael L." Date: Thu, 22 Aug 2024 22:56:33 +0200 Subject: [PATCH 27/52] Check for loop or uv for lazypath (#1095) --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 220d304..314a05b 100644 --- a/init.lua +++ b/init.lua @@ -207,7 +207,7 @@ vim.api.nvim_create_autocmd('TextYankPost', { -- [[ 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' -if not vim.uv.fs_stat(lazypath) then +if not (vim.uv or vim.loop).fs_stat(lazypath) then local lazyrepo = 'https://github.com/folke/lazy.nvim.git' local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } if vim.v.shell_error ~= 0 then From ac78e7d9e77048fa7d5b0711f85aab93508e71a7 Mon Sep 17 00:00:00 2001 From: Ihsan Tonuzi <115842560+iton0@users.noreply.github.com> Date: Thu, 22 Aug 2024 21:00:39 -0400 Subject: [PATCH 28/52] refactor: update treesitter and which-key config (#1068) --- init.lua | 60 +++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 46 insertions(+), 14 deletions(-) diff --git a/init.lua b/init.lua index 314a05b..41b5a97 100644 --- a/init.lua +++ b/init.lua @@ -275,7 +275,44 @@ require('lazy').setup({ 'folke/which-key.nvim', event = 'VimEnter', -- Sets the loading event to 'VimEnter' config = function() -- This is the function that runs, AFTER loading - require('which-key').setup() + require('which-key').setup { + icons = { + -- set icon mappings to true if you have a Nerd Font + mappings = vim.g.have_nerd_font, + -- If you are using a Nerd Font: set icons.keys to an empty table which will use the + -- default whick-key.nvim defined Nerd Font icons, otherwise define a string table + keys = vim.g.have_nerd_font and {} or { + Up = ' ', + Down = ' ', + Left = ' ', + Right = ' ', + C = ' ', + M = ' ', + D = ' ', + S = ' ', + CR = ' ', + Esc = ' ', + ScrollWheelDown = ' ', + ScrollWheelUp = ' ', + NL = ' ', + BS = ' ', + Space = ' ', + Tab = ' ', + F1 = '', + F2 = '', + F3 = '', + F4 = '', + F5 = '', + F6 = '', + F7 = '', + F8 = '', + F9 = '', + F10 = '', + F11 = '', + F12 = '', + }, + }, + } -- Document existing key chains require('which-key').add { @@ -843,6 +880,8 @@ require('lazy').setup({ { -- Highlight, edit, and navigate code 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', + 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' }, -- Autoinstall languages that are not installed @@ -856,19 +895,12 @@ require('lazy').setup({ }, indent = { enable = true, disable = { 'ruby' } }, }, - config = function(_, opts) - -- [[ Configure Treesitter ]] See `:help nvim-treesitter` - - ---@diagnostic disable-next-line: missing-fields - require('nvim-treesitter.configs').setup(opts) - - -- There are additional nvim-treesitter modules that you can use to interact - -- with nvim-treesitter. You should go explore a few and see what interests you: - -- - -- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod` - -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context - -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects - end, + -- There are additional nvim-treesitter modules that you can use to interact + -- with nvim-treesitter. You should go explore a few and see what interests you: + -- + -- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod` + -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context + -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects }, -- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the From d452633b35d4dd9ada06efeca95750beaf0f584f Mon Sep 17 00:00:00 2001 From: Bayram Kazik <48856944+bayramkzk@users.noreply.github.com> Date: Sun, 25 Aug 2024 00:31:43 +0300 Subject: [PATCH 29/52] Include visual mode in LSP code action keymap (#1060) (#1064) --- init.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 41b5a97..13ea93a 100644 --- a/init.lua +++ b/init.lua @@ -316,7 +316,7 @@ require('lazy').setup({ -- Document existing key chains require('which-key').add { - { 'c', group = '[C]ode' }, + { 'c', group = '[C]ode', mode = { 'n', 'x' } }, { 'd', group = '[D]ocument' }, { 'r', group = '[R]ename' }, { 's', group = '[S]earch' }, @@ -507,8 +507,9 @@ require('lazy').setup({ -- -- In this case, we create a function that lets us more easily define mappings specific -- for LSP related items. It sets the mode, buffer and description for us each time. - local map = function(keys, func, desc) - vim.keymap.set('n', keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) + local map = function(keys, func, desc, mode) + mode = mode or 'n' + vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) end -- Jump to the definition of the word under your cursor. @@ -542,7 +543,7 @@ require('lazy').setup({ -- Execute a code action, usually your cursor needs to be on top of an error -- or a suggestion from your LSP for this to activate. - map('ca', vim.lsp.buf.code_action, '[C]ode [A]ction') + map('ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' }) -- WARN: This is not Goto Definition, this is Goto Declaration. -- For example, in C this would take you to the header. From f49cc6c93525326d6db409191c1c36dcc2e41b6e Mon Sep 17 00:00:00 2001 From: Bayram Kazik <48856944+bayramkzk@users.noreply.github.com> Date: Mon, 26 Aug 2024 06:23:17 +0300 Subject: [PATCH 30/52] Enable silent option for default neo-tree plugin keybinding (#1108) --- lua/kickstart/plugins/neo-tree.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua index f126d68..bd44226 100644 --- a/lua/kickstart/plugins/neo-tree.lua +++ b/lua/kickstart/plugins/neo-tree.lua @@ -11,7 +11,7 @@ return { }, cmd = 'Neotree', keys = { - { '\\', ':Neotree reveal', desc = 'NeoTree reveal' }, + { '\\', ':Neotree reveal', desc = 'NeoTree reveal', silent = true }, }, opts = { filesystem = { From e4a5300bdbdc644a3a265513b386aa30c2337088 Mon Sep 17 00:00:00 2001 From: Harshit Pant <97608579+pantharshit007@users.noreply.github.com> Date: Mon, 26 Aug 2024 08:57:46 +0530 Subject: [PATCH 31/52] Fix: updated the windows installation commands (#1101) * Update README.md * Update README.md * Fix: updated the windows installation commands --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 53ae459..e14cbe2 100644 --- a/README.md +++ b/README.md @@ -81,13 +81,13 @@ git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HO If you're using `cmd.exe`: ``` -git clone https://github.com/nvim-lua/kickstart.nvim.git %localappdata%\nvim\ +git clone https://github.com/nvim-lua/kickstart.nvim.git "%localappdata%\nvim" ``` If you're using `powershell.exe` ``` -git clone https://github.com/nvim-lua/kickstart.nvim.git $env:LOCALAPPDATA\nvim\ +git clone https://github.com/nvim-lua/kickstart.nvim.git "${env:LOCALAPPDATA}\nvim" ``` From c76c323a7cc30186a77e2a68c7ecd8f62973cad9 Mon Sep 17 00:00:00 2001 From: Ihsan Tonuzi <115842560+iton0@users.noreply.github.com> Date: Sun, 25 Aug 2024 23:28:26 -0400 Subject: [PATCH 32/52] fix: remove deprecated opt for conform.nvim (#1070) - changed lsp_fallback -> lsp_format - updated format_on_save function to reflect change above --- init.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 13ea93a..edc4182 100644 --- a/init.lua +++ b/init.lua @@ -675,7 +675,7 @@ require('lazy').setup({ { 'f', function() - require('conform').format { async = true, lsp_fallback = true } + require('conform').format { async = true, lsp_format = 'fallback' } end, mode = '', desc = '[F]ormat buffer', @@ -688,9 +688,15 @@ require('lazy').setup({ -- 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 } + local lsp_format_opt + if disable_filetypes[vim.bo[bufnr].filetype] then + lsp_format_opt = 'never' + else + lsp_format_opt = 'fallback' + end return { timeout_ms = 500, - lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype], + lsp_format = lsp_format_opt, } end, formatters_by_ft = { From 24d368f9ff3a951f9760c3c0e776a52726401f4f Mon Sep 17 00:00:00 2001 From: Ihsan Tonuzi <115842560+iton0@users.noreply.github.com> Date: Mon, 26 Aug 2024 12:17:22 -0400 Subject: [PATCH 33/52] cleanup: refactor which-key configuration for cleaner setup (#1102) - Moved `which-key` configuration from inline `config` to `opts` for better organization. - Updated the key mappings setup to use `spec` for defining existing key chains. - Removed deprecated or unnecessary comments and code. This change aligns with updated `which-key` configuration practices, improving readability and maintainability as recommended by @VlaDexa in #1068. --- init.lua | 96 +++++++++++++++++++++++++++----------------------------- 1 file changed, 47 insertions(+), 49 deletions(-) diff --git a/init.lua b/init.lua index edc4182..2513d53 100644 --- a/init.lua +++ b/init.lua @@ -274,57 +274,55 @@ require('lazy').setup({ { -- Useful plugin to show you pending keybinds. 'folke/which-key.nvim', event = 'VimEnter', -- Sets the loading event to 'VimEnter' - config = function() -- This is the function that runs, AFTER loading - require('which-key').setup { - icons = { - -- set icon mappings to true if you have a Nerd Font - mappings = vim.g.have_nerd_font, - -- If you are using a Nerd Font: set icons.keys to an empty table which will use the - -- default whick-key.nvim defined Nerd Font icons, otherwise define a string table - keys = vim.g.have_nerd_font and {} or { - Up = ' ', - Down = ' ', - Left = ' ', - Right = ' ', - C = ' ', - M = ' ', - D = ' ', - S = ' ', - CR = ' ', - Esc = ' ', - ScrollWheelDown = ' ', - ScrollWheelUp = ' ', - NL = ' ', - BS = ' ', - Space = ' ', - Tab = ' ', - F1 = '', - F2 = '', - F3 = '', - F4 = '', - F5 = '', - F6 = '', - F7 = '', - F8 = '', - F9 = '', - F10 = '', - F11 = '', - F12 = '', - }, + opts = { + icons = { + -- set icon mappings to true if you have a Nerd Font + mappings = vim.g.have_nerd_font, + -- If you are using a Nerd Font: set icons.keys to an empty table which will use the + -- default whick-key.nvim defined Nerd Font icons, otherwise define a string table + keys = vim.g.have_nerd_font and {} or { + Up = ' ', + Down = ' ', + Left = ' ', + Right = ' ', + C = ' ', + M = ' ', + D = ' ', + S = ' ', + CR = ' ', + Esc = ' ', + ScrollWheelDown = ' ', + ScrollWheelUp = ' ', + NL = ' ', + BS = ' ', + Space = ' ', + Tab = ' ', + F1 = '', + F2 = '', + F3 = '', + F4 = '', + F5 = '', + F6 = '', + F7 = '', + F8 = '', + F9 = '', + F10 = '', + F11 = '', + F12 = '', }, - } - -- Document existing key chains - require('which-key').add { - { 'c', group = '[C]ode', mode = { 'n', 'x' } }, - { 'd', group = '[D]ocument' }, - { 'r', group = '[R]ename' }, - { 's', group = '[S]earch' }, - { 'w', group = '[W]orkspace' }, - { 't', group = '[T]oggle' }, - { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, - } - end, + -- Document existing key chains + spec = { + { 'c', group = '[C]ode', mode = { 'n', 'x' } }, + { 'd', group = '[D]ocument' }, + { 'r', group = '[R]ename' }, + { 's', group = '[S]earch' }, + { 'w', group = '[W]orkspace' }, + { 't', group = '[T]oggle' }, + { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, + }, + }, + }, }, -- NOTE: Plugins can specify dependencies. From a22976111e406ec0e4903ae78bf66a1fc0125b8a Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Mon, 26 Aug 2024 22:43:59 +0200 Subject: [PATCH 34/52] Fix the which-key spec issue caused by recent cleanup (#1113) The recent cleanup accidentally broke the leader key specs because the spec block was in the wrong level of braces. That resulted in which-key no longer showing the description of the key chains such as [S]earch and others. --- init.lua | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/init.lua b/init.lua index 2513d53..13c8143 100644 --- a/init.lua +++ b/init.lua @@ -310,17 +310,17 @@ require('lazy').setup({ F11 = '', F12 = '', }, + }, - -- Document existing key chains - spec = { - { 'c', group = '[C]ode', mode = { 'n', 'x' } }, - { 'd', group = '[D]ocument' }, - { 'r', group = '[R]ename' }, - { 's', group = '[S]earch' }, - { 'w', group = '[W]orkspace' }, - { 't', group = '[T]oggle' }, - { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, - }, + -- Document existing key chains + spec = { + { 'c', group = '[C]ode', mode = { 'n', 'x' } }, + { 'd', group = '[D]ocument' }, + { 'r', group = '[R]ename' }, + { 's', group = '[S]earch' }, + { 'w', group = '[W]orkspace' }, + { 't', group = '[T]oggle' }, + { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, }, }, }, From 7201dc480134f41dd1be1f8f9b8f8470aac82a3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Baquero?= <88566759+Cheveniko@users.noreply.github.com> Date: Tue, 10 Sep 2024 15:27:24 -0500 Subject: [PATCH 35/52] feat: update references of tsserver to ts_ls (#1131) --- init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 13c8143..ea86b79 100644 --- a/init.lua +++ b/init.lua @@ -614,8 +614,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 = { @@ -656,7 +656,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, From 4120893b8a1f31a0957f2f891f7fbef73ddfb9b1 Mon Sep 17 00:00:00 2001 From: Bastien Traverse Date: Tue, 24 Sep 2024 17:06:14 +0200 Subject: [PATCH 36/52] fix: update lazy uninstall information link (#1148) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e14cbe2..800ca99 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,7 @@ examples of adding popularly requested plugins. `~/.local/share/nvim-kickstart`. You can apply this approach to any Neovim distribution that you would like to try out. * What if I want to "uninstall" this configuration: - * See [lazy.nvim uninstall](https://github.com/folke/lazy.nvim#-uninstalling) information + * See [lazy.nvim uninstall](https://lazy.folke.io/usage#-uninstalling) information * Why is the kickstart `init.lua` a single file? Wouldn't it make sense to split it into multiple files? * The main purpose of kickstart is to serve as a teaching tool and a reference configuration that someone can easily use to `git clone` as a basis for their own. From 5795aa73ef8cd7ffd5db6debb8d2a049427483d3 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 17 Oct 2024 10:54:10 +0200 Subject: [PATCH 37/52] use alt-file when deleting current buffer --- lua/keymaps.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/keymaps.lua b/lua/keymaps.lua index faabbfa..fb6a6ac 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -47,7 +47,7 @@ vim.keymap.set('n', 'bd', function() -- Get current buffer local buf = vim.api.nvim_get_current_buf() -- Switch to different buffer - vim.cmd 'bp' + vim.cmd 'exe "norm \\"' -- Delete saved buffer vim.api.nvim_buf_delete(buf, {}) end, { desc = '[B]uffer [D]elete' }) From 5febea0f8aaf8e68361a6dc7508c1cd805848f23 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 17 Oct 2024 10:54:36 +0200 Subject: [PATCH 38/52] group conflict-marker.vim autocmds in one --- lua/custom/plugins/conflictmarker.lua | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lua/custom/plugins/conflictmarker.lua b/lua/custom/plugins/conflictmarker.lua index d2c68fe..797b02c 100644 --- a/lua/custom/plugins/conflictmarker.lua +++ b/lua/custom/plugins/conflictmarker.lua @@ -32,15 +32,10 @@ return { end -- Autocommand to disable diagnostics on buffer enter - vim.api.nvim_create_autocmd('BufRead', { + vim.api.nvim_create_autocmd({ 'BufRead', 'BufWritePre' }, { group = vim.api.nvim_create_augroup('git-conflict-lsp-disable', { clear = true }), callback = git_conflict_detection, }) - -- Autocommand to disable diagnostics on save - vim.api.nvim_create_autocmd('BufWritePre', { - group = vim.api.nvim_create_augroup('git-conflict-lsp-disable', { clear = false }), - callback = git_conflict_detection, - }) end, }, } From f19ae0487bdd42eaf884d5203e2ae0ef5be03a5e Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 17 Oct 2024 10:55:18 +0200 Subject: [PATCH 39/52] specify conditions to re-enable diagnostics after git conflict --- lua/custom/plugins/conflictmarker.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/custom/plugins/conflictmarker.lua b/lua/custom/plugins/conflictmarker.lua index 797b02c..9606fc3 100644 --- a/lua/custom/plugins/conflictmarker.lua +++ b/lua/custom/plugins/conflictmarker.lua @@ -24,9 +24,10 @@ return { local beginning = vim.fn.match(lines, vim.g.conflict_marker_begin) local ending = vim.fn.match(lines, vim.g.conflict_marker_end) local enabled = vim.diagnostic.is_enabled() - if (beginning > -1 or ending > -1) and enabled then + local conflict = beginning > -1 or ending > -1 + if conflict and enabled then vim.diagnostic.enable(false) - elseif not enabled then + elseif not conflict and not enabled then vim.diagnostic.enable(true) end end From cbb6693cbf87119719d097424477a57672fcd651 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 17 Oct 2024 11:08:54 +0200 Subject: [PATCH 40/52] add lazy-lock.json to versioning as recommended by kickstart.nvim --- .gitignore | 1 - lazy-lock.json | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 lazy-lock.json diff --git a/.gitignore b/.gitignore index 005b535..8a192ca 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,3 @@ test.sh nvim spell/ -lazy-lock.json diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..17bde58 --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,44 @@ +{ + "LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "conflict-marker.vim": { "branch": "master", "commit": "62742b2ffe7a433988759c67b5c5a22eff74a14b" }, + "conform.nvim": { "branch": "master", "commit": "f5bd8419f8a29451e20bdb1061a54fe13d5c8de3" }, + "fidget.nvim": { "branch": "main", "commit": "d855eed8a06531a7e8fd0684889b2943f373c469" }, + "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" }, + "gitsigns.nvim": { "branch": "main", "commit": "863903631e676b33e8be2acb17512fdc1b80b4fb" }, + "indent-blankline.nvim": { "branch": "master", "commit": "e7a4442e055ec953311e77791546238d1eaae507" }, + "lazy.nvim": { "branch": "main", "commit": "1159bdccd8910a0fd0914b24d6c3d186689023d9" }, + "lazydev.nvim": { "branch": "main", "commit": "491452cf1ca6f029e90ad0d0368848fac717c6d2" }, + "lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" }, + "luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" }, + "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, + "mini.nvim": { "branch": "main", "commit": "d4ce7d025f9c7bb4d55ebc4fd88987651e632893" }, + "nvim": { "branch": "main", "commit": "7be452ee067978cdc8b2c5f3411f0c71ffa612b9" }, + "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, + "nvim-lint": { "branch": "master", "commit": "b3ab4ba88845893663d0b7122ee82921adf28358" }, + "nvim-lspconfig": { "branch": "master", "commit": "541f3a2781de481bb84883889e4d9f0904250a56" }, + "nvim-treesitter": { "branch": "master", "commit": "03452942dfbd998701d4123ccad2090e1bc7e9f1" }, + "nvim-treesitter-context": { "branch": "master", "commit": "78a81c7494e7d1a08dd1200b556933e513fd9f29" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "0d79d169fcd45a8da464727ac893044728f121d4" }, + "nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" }, + "oil.nvim": { "branch": "master", "commit": "39dbf875861449cf09e936fa80073f3413e9439c" }, + "overseer.nvim": { "branch": "master", "commit": "6f8bc37eb729a00e185cdf38b1ed3309a05bfeef" }, + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, + "presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" }, + "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" }, + "vim-flog": { "branch": "master", "commit": "6f80c1ffa7068ca8cc0e29af7af4f6ed0717e65e" }, + "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, + "vim-lastplace": { "branch": "master", "commit": "e58cb0df716d3c88605ae49db5c4741db8b48aa9" }, + "vim-merginal": { "branch": "develop", "commit": "3dca10fd8bce10edbc2024651db4ffb6dd2d89de" }, + "vim-processing": { "branch": "master", "commit": "91aaa18a54f8e507e48353ba87b1eb4ecd82a17c" }, + "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, + "which-key.nvim": { "branch": "main", "commit": "8badb359f7ab8711e2575ef75dfe6fbbd87e4821" } +} From d45de7ce83ec89676e1eccd2e1c3213141323f5c Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 17 Oct 2024 11:16:51 +0200 Subject: [PATCH 41/52] suppress errors on switch to alt-file when deleting buffer --- lua/keymaps.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/keymaps.lua b/lua/keymaps.lua index fb6a6ac..8bd1762 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -47,7 +47,7 @@ vim.keymap.set('n', 'bd', function() -- Get current buffer local buf = vim.api.nvim_get_current_buf() -- Switch to different buffer - vim.cmd 'exe "norm \\"' + vim.cmd 'silent! :exe "norm \\"' -- Delete saved buffer vim.api.nvim_buf_delete(buf, {}) end, { desc = '[B]uffer [D]elete' }) From faca7b63ce271ac835427f8e03e4f51af10f189e Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 17 Oct 2024 11:58:51 +0200 Subject: [PATCH 42/52] better telescope.builtin.oldfiles configuration --- lua/kickstart/plugins/telescope.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lua/kickstart/plugins/telescope.lua b/lua/kickstart/plugins/telescope.lua index 37aa1e4..7e0eb68 100644 --- a/lua/kickstart/plugins/telescope.lua +++ b/lua/kickstart/plugins/telescope.lua @@ -111,8 +111,12 @@ return { 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', 'sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) - vim.keymap.set('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) - vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) + vim.keymap.set('n', 'sr', function() + builtin.oldfiles { + only_cwd = true, + } + end, { desc = '[S]earch [R]ecent Files in CWD' }) + vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Global Files' }) vim.keymap.set('n', 'sc', builtin.command_history, { desc = '[S]earch [C]ommand History' }) vim.keymap.set('n', '', function() builtin.buffers { From 557fe18bb0d41c8421efe199e72cded70fc39436 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Fri, 18 Oct 2024 14:35:52 +0200 Subject: [PATCH 43/52] set global statusline option --- lua/options.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/options.lua b/lua/options.lua index 6338d72..035d00e 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -92,6 +92,10 @@ vim.opt.sidescrolloff = 12 -- Set cursor pointer to block vim.opt.guicursor = 'n-v-i-c:block-Cursor' +-- Set global statusline +vim.o.laststatus = 3 +vim.api.nvim_set_hl(0, 'WinSeparator', { bg = nil }) + vim.api.nvim_create_autocmd('UIEnter', { group = vim.api.nvim_create_augroup('SetGUISettings', { clear = true }), callback = function() From 37bd546ea8c7dd5cd3172b9d65ac4a3f27e7b020 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Mon, 21 Oct 2024 21:09:20 +0200 Subject: [PATCH 44/52] silently try setting language, ignore errors if already english --- lua/options.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/options.lua b/lua/options.lua index 035d00e..7cbe9b6 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -4,7 +4,7 @@ -- For more options, you can see `:help option-list` -- Set display language -vim.cmd 'language en_US' +vim.cmd 'silent! language en_US' -- Shell options -- Sets the shell to use for system() and ! commands in windows From 3c7dfc4a3ee323a4facf31f5fba7a6b50e1f5505 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Tue, 22 Oct 2024 14:49:15 +0200 Subject: [PATCH 45/52] install vim-bbye to delete buffers without losing window layout --- lazy-lock.json | 1 + lua/custom/plugins/vimbbye.lua | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 lua/custom/plugins/vimbbye.lua diff --git a/lazy-lock.json b/lazy-lock.json index 17bde58..518f25e 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -34,6 +34,7 @@ "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, + "vim-bbye": { "branch": "master", "commit": "25ef93ac5a87526111f43e5110675032dbcacf56" }, "vim-flog": { "branch": "master", "commit": "6f80c1ffa7068ca8cc0e29af7af4f6ed0717e65e" }, "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, "vim-lastplace": { "branch": "master", "commit": "e58cb0df716d3c88605ae49db5c4741db8b48aa9" }, diff --git a/lua/custom/plugins/vimbbye.lua b/lua/custom/plugins/vimbbye.lua new file mode 100644 index 0000000..7b9d0f2 --- /dev/null +++ b/lua/custom/plugins/vimbbye.lua @@ -0,0 +1,8 @@ +return { + { + 'moll/vim-bbye', + config = function() + vim.keymap.set('n', 'bd', 'Bdelete', { desc = '[B]uffer [D]elete' }) + end, + }, +} From 8296b55962c9157f7496d993e5666da6e780c90b Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Tue, 22 Oct 2024 14:49:39 +0200 Subject: [PATCH 46/52] move plugin related settings inside plugin config for consistency --- lua/custom/plugins/oil.lua | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lua/custom/plugins/oil.lua b/lua/custom/plugins/oil.lua index 01c9cdf..f9bae0e 100644 --- a/lua/custom/plugins/oil.lua +++ b/lua/custom/plugins/oil.lua @@ -1,19 +1,19 @@ --- Fix oil absolute path to relative path conversion -vim.api.nvim_create_augroup('OilRelPathFix', {}) -vim.api.nvim_create_autocmd('BufLeave', { - group = 'OilRelPathFix', - pattern = 'oil:///*', - callback = function() - vim.cmd 'cd .' - end, -}) - return { { 'stevearc/oil.nvim', -- Optional dependencies dependencies = { 'nvim-tree/nvim-web-devicons' }, config = function() + -- Fix oil absolute path to relative path conversion + vim.api.nvim_create_augroup('OilRelPathFix', {}) + vim.api.nvim_create_autocmd('BufLeave', { + group = 'OilRelPathFix', + pattern = 'oil:///*', + callback = function() + vim.cmd 'cd .' + end, + }) + local oil = require 'oil' oil.setup { view_options = { From 6e8f9931e03317b06debe17879e6f6aed9448231 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Tue, 22 Oct 2024 14:50:59 +0200 Subject: [PATCH 47/52] bugfix: remove old bdelete keymap to be replaced by vim-bbye --- lua/keymaps.lua | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 8bd1762..1e75fd9 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -42,15 +42,6 @@ vim.keymap.set('n', 'cdh', 'cd ' .. vim.env.HOME .. '', { desc -- Automatically navigate to config directory vim.keymap.set('n', 'cdn', 'cd ' .. vim.fn.stdpath 'config' .. '', { desc = '[C]hange [D]irectory to [N]eovim' }) --- Delete current buffer without closing window -vim.keymap.set('n', 'bd', function() - -- Get current buffer - local buf = vim.api.nvim_get_current_buf() - -- Switch to different buffer - vim.cmd 'silent! :exe "norm \\"' - -- Delete saved buffer - vim.api.nvim_buf_delete(buf, {}) -end, { desc = '[B]uffer [D]elete' }) -- Switch to between buffers vim.keymap.set('n', 'bp', 'bp', { desc = '[B]uffer [P]revious' }) vim.keymap.set('n', 'bn', 'bn', { desc = '[B]uffer [N]ext' }) From f7e753013c5b7ee994b11f1159f3c95abe7faecc Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Tue, 22 Oct 2024 14:55:08 +0200 Subject: [PATCH 48/52] using powershell/pwsh for windows/wsl installations --- lua/keymaps.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 1e75fd9..d563a78 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -16,7 +16,10 @@ vim.keymap.set('n', 'q', vim.diagnostic.setqflist, { desc = 'Open diagno vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) -- Open terminal in current window -vim.keymap.set({ 'n', 'v' }, 'to', 'term', { desc = '[T]erminal [O]pen' }) +local use_ps = vim.fn.has 'win32' == 1 or vim.fn.has 'wsl' == 1 +local shellname = vim.fn.executable 'pwsh' == 1 and 'pwsh' or 'powershell' +local cond_str = use_ps and (' ' .. shellname .. '.exe') or '' +vim.keymap.set({ 'n', 'v' }, 'to', 'term' .. cond_str .. '', { desc = '[T]erminal [O]pen' }) -- Disable arrow keys in normal mode vim.keymap.set({ 'n', 'v' }, '', 'echo "Use h to move!!"') From 3efbd7cbd3fb6a618dfce2f50e40508178e3f1d9 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Tue, 22 Oct 2024 15:23:26 +0200 Subject: [PATCH 49/52] added eslint for linting JS in php files --- lua/kickstart/plugins/lint.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua index 7e1a50f..a90725a 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/kickstart/plugins/lint.lua @@ -8,6 +8,7 @@ return { lint.linters_by_ft = { javascript = { 'eslint' }, typescript = { 'eslint' }, + php = { 'eslint' }, markdown = { 'markdownlint' }, } From bb27e773c5cc479de51f318e26e5c1d5168d7dcc Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Tue, 22 Oct 2024 16:01:53 +0200 Subject: [PATCH 50/52] ignore excess errors on nvim-lint try_lint --- lua/kickstart/plugins/lint.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua index a90725a..e559136 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/kickstart/plugins/lint.lua @@ -18,7 +18,7 @@ return { vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, { group = lint_augroup, callback = function() - lint.try_lint() + lint.try_lint(nil, { ignore_errors = true }) end, }) end, From 7404b85ee40bde9bfd13162e369278f0785845e5 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Tue, 22 Oct 2024 16:40:16 +0200 Subject: [PATCH 51/52] bugfix: use pwsh by explicite file extension --- lua/keymaps.lua | 2 +- lua/options.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/keymaps.lua b/lua/keymaps.lua index d563a78..1864baf 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -17,7 +17,7 @@ vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' } -- Open terminal in current window local use_ps = vim.fn.has 'win32' == 1 or vim.fn.has 'wsl' == 1 -local shellname = vim.fn.executable 'pwsh' == 1 and 'pwsh' or 'powershell' +local shellname = vim.fn.executable 'pwsh.exe' == 1 and 'pwsh' or 'powershell' local cond_str = use_ps and (' ' .. shellname .. '.exe') or '' vim.keymap.set({ 'n', 'v' }, 'to', 'term' .. cond_str .. '', { desc = '[T]erminal [O]pen' }) diff --git a/lua/options.lua b/lua/options.lua index 7cbe9b6..aaaaec7 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -9,7 +9,7 @@ vim.cmd 'silent! language en_US' -- Shell options -- Sets the shell to use for system() and ! commands in windows if vim.fn.has 'win32' == 1 and vim.fn.has 'wsl' == 0 then - vim.opt.shell = vim.fn.executable 'pwsh' == 1 and 'pwsh' or 'powershell' + vim.opt.shell = vim.fn.executable 'pwsh.exe' == 1 and 'pwsh' or 'powershell' vim.opt.shellcmdflag = '-NoLogo -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;' vim.opt.shellredir = '-RedirectStandardOutput %s -NoNewWindow -Wait' vim.opt.shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode' From 44b45b7c1154d72e2ee645673b11afb3fc931df2 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 24 Oct 2024 16:42:05 +0200 Subject: [PATCH 52/52] simply apply pwsh as shell for wsl instead of f7e7530 --- lua/keymaps.lua | 5 +---- lua/options.lua | 6 +++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 1864baf..1e75fd9 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -16,10 +16,7 @@ vim.keymap.set('n', 'q', vim.diagnostic.setqflist, { desc = 'Open diagno vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) -- Open terminal in current window -local use_ps = vim.fn.has 'win32' == 1 or vim.fn.has 'wsl' == 1 -local shellname = vim.fn.executable 'pwsh.exe' == 1 and 'pwsh' or 'powershell' -local cond_str = use_ps and (' ' .. shellname .. '.exe') or '' -vim.keymap.set({ 'n', 'v' }, 'to', 'term' .. cond_str .. '', { desc = '[T]erminal [O]pen' }) +vim.keymap.set({ 'n', 'v' }, 'to', 'term', { desc = '[T]erminal [O]pen' }) -- Disable arrow keys in normal mode vim.keymap.set({ 'n', 'v' }, '', 'echo "Use h to move!!"') diff --git a/lua/options.lua b/lua/options.lua index aaaaec7..a43fa62 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -7,9 +7,9 @@ vim.cmd 'silent! language en_US' -- Shell options --- Sets the shell to use for system() and ! commands in windows -if vim.fn.has 'win32' == 1 and vim.fn.has 'wsl' == 0 then - vim.opt.shell = vim.fn.executable 'pwsh.exe' == 1 and 'pwsh' or 'powershell' +-- Sets the shell to use for system() and ! commands in windows and wsl +if vim.fn.has 'win32' == 1 or vim.fn.has 'wsl' == 1 then + vim.opt.shell = vim.fn.executable 'pwsh.exe' == 1 and 'pwsh.exe' or 'powershell.exe' vim.opt.shellcmdflag = '-NoLogo -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;' vim.opt.shellredir = '-RedirectStandardOutput %s -NoNewWindow -Wait' vim.opt.shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'