diff options
| author | Kyren223 <ulmliad223@gmail.com> | 2024-07-23 17:04:16 +0300 |
|---|---|---|
| committer | Kyren223 <ulmliad223@gmail.com> | 2024-07-23 17:04:16 +0300 |
| commit | 9f36c9e319c3f62d2cc5fcc13888bb1c52549dd5 (patch) | |
| tree | fcb9e06a5618d957cda5f1e63cbec0dc0a5ce4d6 /.config/nvim | |
| parent | bcd20b2cb1836bc8e5baa34d8b0e1a96f3c2f788 (diff) | |
refactor(neovim): minor changes and splited most plugins to their own file
Diffstat (limited to '.config/nvim')
29 files changed, 282 insertions, 278 deletions
diff --git a/.config/nvim/TODO.md b/.config/nvim/TODO.md index 85b67d7..96213ee 100644 --- a/.config/nvim/TODO.md +++ b/.config/nvim/TODO.md @@ -1,7 +1,6 @@ # Plans for the future -- TODO: Look into bufferline.nvim for "tabs" - TODO: Look at configuring Noice.nvim and decide if u like it or not - TODO: Look at buffer-management plugins that automatically delete old buffers (and also ways to close buffers without exiting nvim, and be able to exit nvim with 1 keypress) - TODO: Replace obsidian with Neorg diff --git a/.config/nvim/after/ftplugin/markdown.lua b/.config/nvim/after/ftplugin/markdown.lua index 792a1ae..fdcb94f 100644 --- a/.config/nvim/after/ftplugin/markdown.lua +++ b/.config/nvim/after/ftplugin/markdown.lua @@ -1,7 +1,5 @@ vim.opt.wrap = true vim.opt.breakindent = true vim.opt.linebreak = true -vim.opt.spelllang = 'en_us' -vim.opt.spell = true vim.keymap.set('n', 'j', 'gj') vim.keymap.set('n', 'k', 'gk') diff --git a/.config/nvim/lua/custom/plugins/auto-save.lua b/.config/nvim/lua/custom/plugins/auto-save.lua new file mode 100644 index 0000000..4299d0d --- /dev/null +++ b/.config/nvim/lua/custom/plugins/auto-save.lua @@ -0,0 +1,11 @@ +return { + 'okuuva/auto-save.nvim', + cmd = 'ASToggle', + event = { 'InsertLeave', 'TextChanged' }, + opts = { + execution_message = { enabled = false }, + condition = function(buf) + return vim.fn.getbufvar(buf, '&buftype') == '' + end, + }, +} diff --git a/.config/nvim/lua/custom/plugins/auto-session.lua b/.config/nvim/lua/custom/plugins/auto-session.lua new file mode 100644 index 0000000..2668a4a --- /dev/null +++ b/.config/nvim/lua/custom/plugins/auto-session.lua @@ -0,0 +1,27 @@ +return { + 'rmagatti/auto-session', + lazy = false, + config = function() + vim.opt.sessionoptions = 'blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions' + require('auto-session').setup({ + log_level = 'error', + auto_session_suppress_dirs = { '~/', '/' }, + session_lens = { load_on_setup = false }, + no_restore_cmds = { + function() + vim.cmd('Alpha') + end, + }, + }) + + local session_lens_setup_done = false + local function search_session() + if not session_lens_setup_done then + require('auto-session').setup_session_lens() + session_lens_setup_done = true + end + require('auto-session.session-lens').search_session() + end + vim.keymap.set('n', '<C-s>', search_session, { desc = '[S]ession Manager' }) + end, +} diff --git a/.config/nvim/lua/custom/plugins/buffer-manager.lua b/.config/nvim/lua/custom/plugins/buffer-manager.lua new file mode 100644 index 0000000..9d50a7f --- /dev/null +++ b/.config/nvim/lua/custom/plugins/buffer-manager.lua @@ -0,0 +1,12 @@ +return { + 'j-morano/buffer_manager.nvim', + dependencies = { 'nvim-lua/plenary.nvim' }, + keys = { + { + '<leader>e', + function() + require('buffer_manager.ui').toggle_quick_menu() + end, + }, + }, +} diff --git a/.config/nvim/lua/custom/plugins/ccc.lua b/.config/nvim/lua/custom/plugins/ccc.lua new file mode 100644 index 0000000..98090f1 --- /dev/null +++ b/.config/nvim/lua/custom/plugins/ccc.lua @@ -0,0 +1,9 @@ +return { + 'uga-rosa/ccc.nvim', + opts = { highlighter = { auto_enable = true } }, + event = 'VeryLazy', + keys = { + { '<leader>cp', '<cmd>CccPick<cr>', desc = '[C]olor [P]icker' }, + { '<leader>ct', '<cmd>CccHighlighterToggle<cr>', desc = '[C]olor [T]oggle' }, + }, +} diff --git a/.config/nvim/lua/custom/plugins/colorschemes.lua b/.config/nvim/lua/custom/plugins/colorscheme.lua index e3dc5bd..e3dc5bd 100644 --- a/.config/nvim/lua/custom/plugins/colorschemes.lua +++ b/.config/nvim/lua/custom/plugins/colorscheme.lua diff --git a/.config/nvim/lua/custom/plugins/comment.lua b/.config/nvim/lua/custom/plugins/comment.lua new file mode 100644 index 0000000..b61675a --- /dev/null +++ b/.config/nvim/lua/custom/plugins/comment.lua @@ -0,0 +1,25 @@ +return { + -- 'numToStr/Comment.nvim', + 'os-mey/Comment.nvim', + branch = 'fix-inline-visual-linewise-comment', + keys = { + { 'gc', mode = { 'n', 'v' } }, + { 'gb', mode = { 'n', 'v' } }, + { '<C-_>', mode = { 'n', 'v' } }, + { 'gcc', mode = 'n' }, + { 'gcb', mode = 'n' }, + }, + config = function() + require('Comment').setup() + local api = require('Comment.api') + local esc = vim.api.nvim_replace_termcodes('<ESC>', true, false, true) + local toggle_linewise_selection = function() + vim.api.nvim_feedkeys(esc, 'nx', false) + api.toggle.linewise(vim.fn.visualmode()) + end + + -- <C-_> means Ctrl slash, `_` is a `/` + vim.keymap.set('n', '<C-_>', api.toggle.linewise.current, { noremap = true, silent = true }) + vim.keymap.set('v', '<C-_>', toggle_linewise_selection, { noremap = true, silent = true }) + end, +} diff --git a/.config/nvim/lua/custom/plugins/git.lua b/.config/nvim/lua/custom/plugins/git.lua index f94852d..6c8cc2f 100644 --- a/.config/nvim/lua/custom/plugins/git.lua +++ b/.config/nvim/lua/custom/plugins/git.lua @@ -82,7 +82,7 @@ vim.keymap.set('n', '<leader>hu', '<cmd>Gitsigns undo_stage_hunk<cr>', { desc = return { { 'NeogitOrg/neogit', opts = neogit_opts, cmd = 'Neogit' }, { 'pwntester/octo.nvim', config = octo_config, cmd = 'Octo' }, - { 'lewis6991/gitsigns.nvim', config = true, cmd = 'Gitsigns', event = 'BufWinEnter' }, + { 'lewis6991/gitsigns.nvim', config = true, cmd = 'Gitsigns', event = 'VeryLazy' }, { 'sindrets/diffview.nvim', opts = diffview_opts, diff --git a/.config/nvim/lua/custom/plugins/indent-blankline.lua b/.config/nvim/lua/custom/plugins/indent-blankline.lua new file mode 100644 index 0000000..591355e --- /dev/null +++ b/.config/nvim/lua/custom/plugins/indent-blankline.lua @@ -0,0 +1,11 @@ +return { + 'lukas-reineke/indent-blankline.nvim', + main = 'ibl', + event = 'BufEnter', + opts = { + scope = { + show_start = false, + show_end = false, + }, + }, +} diff --git a/.config/nvim/lua/custom/plugins/lazydev.lua b/.config/nvim/lua/custom/plugins/lazydev.lua new file mode 100644 index 0000000..35963b3 --- /dev/null +++ b/.config/nvim/lua/custom/plugins/lazydev.lua @@ -0,0 +1,9 @@ +return { + 'folke/lazydev.nvim', + ft = 'lua', + opts = { + library = { + { path = 'luvit-meta/library', words = { 'vim%.uv' } }, + }, + }, +} diff --git a/.config/nvim/lua/custom/plugins/leap.lua b/.config/nvim/lua/custom/plugins/leap.lua new file mode 100644 index 0000000..7eae0c3 --- /dev/null +++ b/.config/nvim/lua/custom/plugins/leap.lua @@ -0,0 +1,18 @@ +return { + 'ggandor/leap.nvim', + dependencies = { 'tpope/vim-repeat' }, + keys = { + { 's', '<Plug>(leap)', mode = { 'n', 'x', 'o' } }, + { 'S', '<Plug>(leap-from-window)' }, + { + 'gs', + function() + require('leap.remote').action() + end, + }, + }, + config = function() + require('leap').opts.equivalence_classes = { ' \t\r\n', '([{', ')]}', '\'"`' } + vim.api.nvim_set_hl(0, 'LeapBackdrop', { fg = '#777777' }) + end, +} diff --git a/.config/nvim/lua/custom/plugins/lsp-lines.lua b/.config/nvim/lua/custom/plugins/lsp-lines.lua new file mode 100644 index 0000000..da138a1 --- /dev/null +++ b/.config/nvim/lua/custom/plugins/lsp-lines.lua @@ -0,0 +1,10 @@ +return { + -- NOTE: [Good alternative](https://github.com/rachartier/tiny-inline-diagnostic.nvim) + -- although, this plugin is amazing, so I wouldn't switch it most likely + 'https://git.sr.ht/~whynothugo/lsp_lines.nvim', + event = 'BufEnter', + config = function() + require('lsp_lines').setup() + vim.keymap.set('n', '<Leader>dt', require('lsp_lines').toggle, { desc = '[D]iagnostics [T]oggle inline' }) + end, +} diff --git a/.config/nvim/lua/custom/plugins/lsp-plugins.lua b/.config/nvim/lua/custom/plugins/lsp-plugins.lua deleted file mode 100644 index 0e77085..0000000 --- a/.config/nvim/lua/custom/plugins/lsp-plugins.lua +++ /dev/null @@ -1,73 +0,0 @@ -return { - { - 'nvimtools/none-ls.nvim', - event = 'LspAttach', - config = function() - local null_ls = require('null-ls') - null_ls.setup({ - sources = { - null_ls.builtins.formatting.stylua, - }, - }) - end, - }, - -- NOTE: [Good alternative](https://github.com/rachartier/tiny-inline-diagnostic.nvim) - -- although, this plugin is amazing, so I wouldn't switch it most likely - { - 'https://git.sr.ht/~whynothugo/lsp_lines.nvim', - event = 'BufEnter', - config = function() - require('lsp_lines').setup() - vim.keymap.set('n', '<Leader>dt', require('lsp_lines').toggle, { desc = '[D]iagnostics [T]oggle inline' }) - end, - }, - { - -- FIXME: fork the repo and fix the following issues - -- Make both insert and normal be toggelable rather than insert always showing and normal toggleable - 'ray-x/lsp_signature.nvim', - event = 'LspAttach', - opts = { - bind = true, -- This is mandatory, otherwise border config won't get registered. - handler_opts = { border = 'single' }, - doc_lines = 0, - hint_enable = false, - }, - }, - { - 'folke/lazydev.nvim', - ft = 'lua', - opts = { library = { { path = 'luvit-meta/library', words = { 'vim%.uv' } } } }, - }, - { - 'nvimdev/lspsaga.nvim', - dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, - event = 'LspAttach', - opts = { - lightbulb = { - enable = false, - sign = false, - virtual_text = true, - }, - implement = { - sign = false, - virtual_text = true, - }, - floaterm = { - height = 0.7, - width = 0.7, - }, - outline = { - layout = 'float', - }, - -- TODO: Change <C-k> in rename to smthing else - -- bcz I am using <C-k> for moving between windows - -- Maybe <C-c> for abort, <cr> for confirm - }, - }, - - -- AUtoformatting - -- 'stevear/conform.nvim', - - -- Schema info - -- 'b0o/SchemaStore.nvim', -} diff --git a/.config/nvim/lua/custom/plugins/lsp-signature.lua b/.config/nvim/lua/custom/plugins/lsp-signature.lua new file mode 100644 index 0000000..718cd62 --- /dev/null +++ b/.config/nvim/lua/custom/plugins/lsp-signature.lua @@ -0,0 +1,12 @@ +return { + -- FIXME: fork the repo and fix the following issues + -- Make both insert and normal be toggelable rather than insert always showing and normal toggleable + 'ray-x/lsp_signature.nvim', + event = 'LspAttach', + opts = { + bind = true, -- This is mandatory, otherwise border config won't get registered. + handler_opts = { border = 'single' }, + doc_lines = 0, + hint_enable = false, + }, +} diff --git a/.config/nvim/lua/custom/plugins/lsp.lua b/.config/nvim/lua/custom/plugins/lspconfig.lua index f6b8b28..c6b85b5 100644 --- a/.config/nvim/lua/custom/plugins/lsp.lua +++ b/.config/nvim/lua/custom/plugins/lspconfig.lua @@ -14,11 +14,11 @@ return { }, build = ':MasonUpdate', config = function() - require('custom.configs.mason') + require('lua.custom.configs.mason') end, }, }, config = function() - require('custom.configs.lsp') + require('lua.custom.configs.lsp') end, } diff --git a/.config/nvim/lua/custom/plugins/lspsaga.lua b/.config/nvim/lua/custom/plugins/lspsaga.lua new file mode 100644 index 0000000..e9d307d --- /dev/null +++ b/.config/nvim/lua/custom/plugins/lspsaga.lua @@ -0,0 +1,26 @@ +return { + -- TODO: Change <C-k> in rename to smthing else + -- bcz I am using <C-k> for moving between windows + -- Maybe <C-c> for abort, <cr> for confirm + 'nvimdev/lspsaga.nvim', + dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, + event = 'LspAttach', + opts = { + lightbulb = { + enable = false, + sign = false, + virtual_text = true, + }, + implement = { + sign = false, + virtual_text = true, + }, + floaterm = { + height = 0.7, + width = 0.7, + }, + outline = { + layout = 'float', + }, + }, +} diff --git a/.config/nvim/lua/custom/plugins/statusline.lua b/.config/nvim/lua/custom/plugins/lualine.lua index 8d3b4ac..8d3b4ac 100644 --- a/.config/nvim/lua/custom/plugins/statusline.lua +++ b/.config/nvim/lua/custom/plugins/lualine.lua diff --git a/.config/nvim/lua/custom/plugins/mini.lua b/.config/nvim/lua/custom/plugins/mini.lua new file mode 100644 index 0000000..61d04b6 --- /dev/null +++ b/.config/nvim/lua/custom/plugins/mini.lua @@ -0,0 +1,16 @@ +return { + 'echasnovski/mini.nvim', + version = false, + keys = { + { + 'Q', + function() + if vim.bo.modified then + vim.cmd.write() + end + require('mini.bufremove').delete(0) + end, + desc = '[Q]uit Buffer', + }, + }, +} diff --git a/.config/nvim/lua/custom/plugins/none-ls.lua b/.config/nvim/lua/custom/plugins/none-ls.lua new file mode 100644 index 0000000..763172f --- /dev/null +++ b/.config/nvim/lua/custom/plugins/none-ls.lua @@ -0,0 +1,12 @@ +return { + 'nvimtools/none-ls.nvim', + event = 'LspAttach', + config = function() + local null_ls = require('null-ls') + null_ls.setup({ + sources = { + null_ls.builtins.formatting.stylua, + }, + }) + end, +} diff --git a/.config/nvim/lua/custom/plugins/nvim-autopairs.lua b/.config/nvim/lua/custom/plugins/nvim-autopairs.lua new file mode 100644 index 0000000..c51bf19 --- /dev/null +++ b/.config/nvim/lua/custom/plugins/nvim-autopairs.lua @@ -0,0 +1,5 @@ +return { + 'windwp/nvim-autopairs', + event = 'InsertEnter', + config = true, +} diff --git a/.config/nvim/lua/custom/plugins/completion.lua b/.config/nvim/lua/custom/plugins/nvim-cmp.lua index be7ba17..317c088 100644 --- a/.config/nvim/lua/custom/plugins/completion.lua +++ b/.config/nvim/lua/custom/plugins/nvim-cmp.lua @@ -9,6 +9,6 @@ return { { 'L3MON4D3/LuaSnip', build = 'make install_jsregexp' }, -- snippets plugin }, config = function() - require('custom.configs.completion') + require('lua.custom.configs.completion') end, } diff --git a/.config/nvim/lua/custom/plugins/nvim-spectre.lua b/.config/nvim/lua/custom/plugins/nvim-spectre.lua new file mode 100644 index 0000000..df58de9 --- /dev/null +++ b/.config/nvim/lua/custom/plugins/nvim-spectre.lua @@ -0,0 +1,7 @@ +return { + -- NOTE: No keybindings, use `:Spectre` or `:Spectre <file>` + -- Spectre has no undo, so it should be rarely used, which is why no keybindings are defined + 'nvim-pack/nvim-spectre', + cmd = 'Spectre', + config = true, +} diff --git a/.config/nvim/lua/custom/plugins/nvim-surround.lua b/.config/nvim/lua/custom/plugins/nvim-surround.lua new file mode 100644 index 0000000..a0b35ca --- /dev/null +++ b/.config/nvim/lua/custom/plugins/nvim-surround.lua @@ -0,0 +1,32 @@ +return { + 'kylechui/nvim-surround', + version = '*', + keys = { + { 'yS', '<Plug>(nvim-surround-normal)' }, + { 'ySS', '<Plug>(nvim-surround-normal-cur)' }, + { 'S', '<Plug>(nvim-surround-visual)', mode = 'v' }, + { 'cS', '<Plug>(nvim-surround-change)' }, + { 'dS', '<Plug>(nvim-surround-delete)' }, + { '(', '<Plug>(nvim-surround-visual)(', mode = 'v' }, + { '{', '<Plug>(nvim-surround-visual){', mode = 'v' }, + { '[', '<Plug>(nvim-surround-visual)[', mode = 'v' }, + { '`', '<Plug>(nvim-surround-visual)`', mode = 'v' }, + { '"', '<Plug>(nvim-surround-visual)"', mode = 'v' }, + { "'", "<Plug>(nvim-surround-visual)'", mode = 'v' }, + }, + opts = { + keymaps = { + insert = false, + insert_line = false, + normal_line = false, + normal_cur_line = false, + visual_line = false, + normal = false, + normal_cur = false, + visual = false, + delete = false, + change = false, + change_line = false, + }, + }, +} diff --git a/.config/nvim/lua/custom/plugins/undotree.lua b/.config/nvim/lua/custom/plugins/undotree.lua new file mode 100644 index 0000000..cbbeffb --- /dev/null +++ b/.config/nvim/lua/custom/plugins/undotree.lua @@ -0,0 +1,14 @@ +return { + 'mbbill/undotree', + keys = { { '<leader>ut', vim.cmd.UndotreeToggle } }, + config = function() + vim.g.undotree_DiffAutoOpen = false + vim.g.undotree_DiffpanelHeight = 0 + vim.g.undotree_SetFocusWhenToggle = false + vim.g.undotree_HelpLine = false + vim.g.undotree_TreeNodeShape = '' + vim.g.undotree_TreeVertShape = '│' + vim.g.undotree_TreeSplitShape = '─┘' + vim.g.undotree_TreeReturnShape = '─┐' + end, +} diff --git a/.config/nvim/lua/custom/plugins/utility.lua b/.config/nvim/lua/custom/plugins/utility.lua deleted file mode 100644 index 9c122ba..0000000 --- a/.config/nvim/lua/custom/plugins/utility.lua +++ /dev/null @@ -1,198 +0,0 @@ -return { - { - 'uga-rosa/ccc.nvim', - opts = { highlighter = { auto_enable = true } }, - event = 'VeryLazy', - keys = { - { '<leader>cp', '<cmd>CccPick<cr>', desc = '[C]olor [P]icker' }, - { '<leader>ct', '<cmd>CccHighlighterToggle<cr>', desc = '[C]olor [T]oggle' }, - }, - }, - { - 'okuuva/auto-save.nvim', - cmd = 'ASToggle', - event = { 'InsertLeave', 'TextChanged' }, - opts = { - execution_message = { enabled = false }, - condition = function(buf) - return vim.fn.getbufvar(buf, '&buftype') == '' - end, - }, - }, - { - 'rmagatti/auto-session', - lazy = false, - config = function() - vim.opt.sessionoptions = 'blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions' - require('auto-session').setup({ - log_level = 'error', - auto_session_suppress_dirs = { '~/', '/' }, - session_lens = { load_on_setup = false }, - no_restore_cmds = { - function() - vim.cmd('Alpha') - end, - }, - }) - - local session_lens_setup_done = false - local function search_session() - if not session_lens_setup_done then - require('auto-session').setup_session_lens() - session_lens_setup_done = true - end - require('auto-session.session-lens').search_session() - end - vim.keymap.set('n', '<C-s>', search_session, { desc = '[S]ession Manager' }) - end, - }, - { 'wakatime/vim-wakatime', lazy = false }, - { - 'mbbill/undotree', - keys = { { '<leader>ut', vim.cmd.UndotreeToggle } }, - config = function() - vim.g.undotree_DiffAutoOpen = false - vim.g.undotree_DiffpanelHeight = 0 - vim.g.undotree_SetFocusWhenToggle = false - vim.g.undotree_HelpLine = false - vim.g.undotree_TreeNodeShape = '' - vim.g.undotree_TreeVertShape = '│' - vim.g.undotree_TreeSplitShape = '─┘' - vim.g.undotree_TreeReturnShape = '─┐' - end, - }, - -- NOTE: No keybindings, use `:Spectre` or `:Spectre <file>` - -- Spectre has no undo, so it should be rarely used, which is why no keybindings are defined - { 'nvim-pack/nvim-spectre', cmd = 'Spectre', config = true }, - { - 'echasnovski/mini.nvim', - version = false, - keys = { - { - 'Q', - function() - if vim.bo.modified then - vim.cmd.write() - end - require('mini.bufremove').delete(0) - end, - desc = '[Q]uit Buffer', - }, - }, - }, - { - 'kylechui/nvim-surround', - version = '*', - keys = { - { 'yS', '<Plug>(nvim-surround-normal)' }, - { 'ySS', '<Plug>(nvim-surround-normal-cur)' }, - { 'S', '<Plug>(nvim-surround-visual)', mode = 'v' }, - { 'cS', '<Plug>(nvim-surround-change)' }, - { 'dS', '<Plug>(nvim-surround-delete)' }, - { '(', '<Plug>(nvim-surround-visual)(', mode = 'v' }, - { '{', '<Plug>(nvim-surround-visual){', mode = 'v' }, - { '[', '<Plug>(nvim-surround-visual)[', mode = 'v' }, - { '`', '<Plug>(nvim-surround-visual)`', mode = 'v' }, - { '"', '<Plug>(nvim-surround-visual)"', mode = 'v' }, - { "'", "<Plug>(nvim-surround-visual)'", mode = 'v' }, - }, - opts = { - keymaps = { - insert = false, - insert_line = false, - normal_line = false, - normal_cur_line = false, - visual_line = false, - normal = false, - normal_cur = false, - visual = false, - delete = false, - change = false, - change_line = false, - }, - }, - }, - { - -- TODO: Make sure it uses a diff color - -- the color rn is too similar to visual mode - 'RRethy/vim-illuminate', - event = 'LspAttach', - keys = { { '<leader>it', '<cmd>IlluminateToggle<cr>', desc = '[I]lluminate [Tloggle]' } }, - }, - { - 'lukas-reineke/indent-blankline.nvim', - main = 'ibl', - event = 'BufEnter', - opts = { - scope = { - show_start = false, - show_end = false, - }, - }, - }, - { - 'christoomey/vim-tmux-navigator', - keys = { - { '<C-h>', '<cmd>TmuxNavigateLeft<cr>' }, - { '<C-j>', '<cmd>TmuxNavigateDown<cr>' }, - { '<C-k>', '<cmd>TmuxNavigateUp<cr>' }, - { '<C-l>', '<cmd>TmuxNavigateRight<cr>' }, - }, - }, - { - 'ggandor/leap.nvim', - dependencies = { 'tpope/vim-repeat' }, - keys = { - { 's', '<Plug>(leap)', mode = { 'n', 'x', 'o' } }, - { 'S', '<Plug>(leap-from-window)' }, - { - 'gs', - function() - require('leap.remote').action() - end, - }, - }, - config = function() - require('leap').opts.equivalence_classes = { ' \t\r\n', '([{', ')]}', '\'"`' } - vim.api.nvim_set_hl(0, 'LeapBackdrop', { fg = '#777777' }) - end, - }, - { 'windwp/nvim-autopairs', event = 'InsertEnter', config = true }, - { - -- 'numToStr/Comment.nvim', - 'os-mey/Comment.nvim', - branch = 'fix-inline-visual-linewise-comment', - keys = { - { 'gc', mode = { 'n', 'v' } }, - { 'gb', mode = { 'n', 'v' } }, - { '<C-_>', mode = { 'n', 'v' } }, - { 'gcc', mode = 'n' }, - { 'gcb', mode = 'n' }, - }, - config = function() - require('Comment').setup() - local api = require('Comment.api') - local esc = vim.api.nvim_replace_termcodes('<ESC>', true, false, true) - local toggle_linewise_selection = function() - vim.api.nvim_feedkeys(esc, 'nx', false) - api.toggle.linewise(vim.fn.visualmode()) - end - - -- <C-_> means Ctrl slash, `_` is a `/` - vim.keymap.set('n', '<C-_>', api.toggle.linewise.current, { noremap = true, silent = true }) - vim.keymap.set('v', '<C-_>', toggle_linewise_selection, { noremap = true, silent = true }) - end, - }, - { - 'j-morano/buffer_manager.nvim', - dependencies = { 'nvim-lua/plenary.nvim' }, - keys = { - { - '<leader>e', - function() - require('buffer_manager.ui').toggle_quick_menu() - end, - }, - }, - }, -} diff --git a/.config/nvim/lua/custom/plugins/vim-illuminate.lua b/.config/nvim/lua/custom/plugins/vim-illuminate.lua new file mode 100644 index 0000000..82cfe96 --- /dev/null +++ b/.config/nvim/lua/custom/plugins/vim-illuminate.lua @@ -0,0 +1,9 @@ +return { + -- TODO: Make sure it uses a diff color + -- the color rn is too similar to visual mode + 'RRethy/vim-illuminate', + event = 'LspAttach', + keys = { + { '<leader>it', '<cmd>IlluminateToggle<cr>', desc = '[I]lluminate [Tloggle]' }, + }, +} diff --git a/.config/nvim/lua/custom/plugins/vim-tmux-navigator.lua b/.config/nvim/lua/custom/plugins/vim-tmux-navigator.lua new file mode 100644 index 0000000..65f063d --- /dev/null +++ b/.config/nvim/lua/custom/plugins/vim-tmux-navigator.lua @@ -0,0 +1,9 @@ +return { + 'christoomey/vim-tmux-navigator', + keys = { + { '<C-h>', '<cmd>TmuxNavigateLeft<cr>' }, + { '<C-j>', '<cmd>TmuxNavigateDown<cr>' }, + { '<C-k>', '<cmd>TmuxNavigateUp<cr>' }, + { '<C-l>', '<cmd>TmuxNavigateRight<cr>' }, + }, +} diff --git a/.config/nvim/lua/custom/plugins/vim-wakatime.lua b/.config/nvim/lua/custom/plugins/vim-wakatime.lua new file mode 100644 index 0000000..515c6d0 --- /dev/null +++ b/.config/nvim/lua/custom/plugins/vim-wakatime.lua @@ -0,0 +1,4 @@ +return { + 'wakatime/vim-wakatime', + event = 'VeryLazy', +} |
