From 42a8b0ff06a56057b46fd8fe576c8ac9d2c701ec Mon Sep 17 00:00:00 2001 From: Dynocoder Date: Thu, 6 Jun 2024 22:22:10 -0400 Subject: [PATCH] added plugins --- init.lua | 111 ++++++++-------------- lua/custom/plugins/autopairs.lua | 13 +++ lua/custom/plugins/colorizer.lua | 7 ++ lua/custom/plugins/diffview.lua | 5 + lua/custom/plugins/flash.lua | 14 +++ lua/custom/plugins/flutter-tools.lua | 9 ++ lua/custom/plugins/git-blame.lua | 12 +++ lua/custom/plugins/harpoon.lua | 33 +++++++ lua/custom/plugins/incline.lua | 29 ++++++ lua/custom/plugins/init.lua | 4 - lua/custom/plugins/lazygit.lua | 12 +++ lua/custom/plugins/mini-surround.lua | 19 ++++ lua/custom/plugins/notify.lua | 6 ++ lua/custom/plugins/oil.lua | 9 ++ lua/custom/plugins/spectre.lua | 20 ++++ lua/custom/plugins/treesitter-context.lua | 7 ++ lua/custom/plugins/trouble.lua | 39 ++++++++ lua/custom/plugins/vim-illuminate.lua | 37 ++++++++ lua/custom/plugins/vim-tmux-navigator.lua | 10 ++ 19 files changed, 322 insertions(+), 74 deletions(-) create mode 100644 lua/custom/plugins/autopairs.lua create mode 100644 lua/custom/plugins/colorizer.lua create mode 100644 lua/custom/plugins/diffview.lua create mode 100644 lua/custom/plugins/flash.lua create mode 100644 lua/custom/plugins/flutter-tools.lua create mode 100644 lua/custom/plugins/git-blame.lua create mode 100644 lua/custom/plugins/harpoon.lua create mode 100644 lua/custom/plugins/incline.lua create mode 100644 lua/custom/plugins/lazygit.lua create mode 100644 lua/custom/plugins/mini-surround.lua create mode 100644 lua/custom/plugins/notify.lua create mode 100644 lua/custom/plugins/oil.lua create mode 100644 lua/custom/plugins/spectre.lua create mode 100644 lua/custom/plugins/treesitter-context.lua create mode 100644 lua/custom/plugins/trouble.lua create mode 100644 lua/custom/plugins/vim-illuminate.lua create mode 100644 lua/custom/plugins/vim-tmux-navigator.lua diff --git a/init.lua b/init.lua index 88658ef3..5b74c834 100644 --- a/init.lua +++ b/init.lua @@ -20,49 +20,6 @@ ===================================================================== ===================================================================== -What is Kickstart? - - Kickstart.nvim is *not* a distribution. - - Kickstart.nvim is a starting point for your own configuration. - The goal is that you can read every line of code, top-to-bottom, understand - what your configuration is doing, and modify it to suit your needs. - - Once you've done that, you can start exploring, configuring and tinkering to - make Neovim your own! That might mean leaving Kickstart just the way it is for a while - or immediately breaking it into modular pieces. It's up to you! - - If you don't know anything about Lua, I recommend taking some time to read through - a guide. One possible example which will only take 10-15 minutes: - - https://learnxinyminutes.com/docs/lua/ - - After understanding a bit more about Lua, you can use `:help lua-guide` as a - reference for how Neovim integrates Lua. - - :help lua-guide - - (or HTML version): https://neovim.io/doc/user/lua-guide.html - -Kickstart Guide: - - TODO: The very first thing you should do is to run the command `:Tutor` in Neovim. - - If you don't know what this means, type the following: - - - - : - - Tutor - - - - (If you already know the Neovim basics, you can skip this step.) - - Once you've completed that, you can continue working through **AND READING** the rest - of the kickstart init.lua. - - Next, run AND READ `:help`. - This will open up a help window with some basic information - about reading, navigating and searching the builtin help documentation. - - This should be the first place you go to look when you're stuck or confused - with something. It's one of my favorite Neovim features. - MOST IMPORTANTLY, we provide a keymap "sh" to [s]earch the [h]elp documentation, which is very useful when you're not exactly sure of what you're looking for. @@ -91,7 +48,7 @@ vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = false +vim.g.have_nerd_font = true -- [[ Setting options ]] -- See `:help vim.opt` @@ -102,7 +59,7 @@ vim.g.have_nerd_font = false vim.opt.number = true -- You can also add relative line numbers, to help with jumping. -- Experiment for yourself to see if you like it! --- vim.opt.relativenumber = true +vim.opt.relativenumber = true -- Enable mouse mode, can be useful for resizing splits for example! vim.opt.mouse = 'a' @@ -129,7 +86,7 @@ vim.opt.smartcase = true vim.opt.signcolumn = 'yes' -- Decrease update time -vim.opt.updatetime = 250 +vim.opt.updatetime = 50 -- Decrease mapped sequence wait time -- Displays which-key popup sooner @@ -152,7 +109,7 @@ vim.opt.inccommand = 'split' vim.opt.cursorline = true -- Minimal number of screen lines to keep above and below the cursor. -vim.opt.scrolloff = 10 +vim.opt.scrolloff = 999 -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` @@ -161,10 +118,21 @@ vim.opt.scrolloff = 10 vim.opt.hlsearch = true vim.keymap.set('n', '', 'nohlsearch') --- Diagnostic keymaps +-- vim move line commands +vim.keymap.set('v', 'J', ":m '>+1gv=gv") +vim.keymap.set('v', 'K', ":m '<-2gv=gv") + +-- setup command for ctrl-backspace - delete whole word +-- vim.api.nvim_set_keymap('i', '', '', { noremap = true, silent = true }) +vim.keymap.set('i', '', '', { noremap = true, silent = false }) + +-- replace the current word +vim.keymap.set('n', 'rw', [[:%s/\<\>//gI]]) + +-- Diagnostic keymaps(look) 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', 'de', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' }) vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier @@ -185,10 +153,10 @@ vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' } -- Use CTRL+ to switch between windows -- -- See `:help wincmd` for a list of all window commands -vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) +-- vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) +-- vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) +-- vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) +-- vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` @@ -372,25 +340,27 @@ require('lazy').setup({ -- See `:help telescope.builtin` local builtin = require 'telescope.builtin' - vim.keymap.set('n', 'sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) - vim.keymap.set('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) - vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) vim.keymap.set('n', 'ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' }) + vim.keymap.set('n', '', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' }) + vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) + vim.keymap.set('n', 'sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) 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', '/', builtin.live_grep, { desc = '[S]earch by [G]rep' }) + vim.keymap.set('n', 'sG', ':LiveGrepGitRoot', { desc = '[S]earch by [G]rep on Git Root' }) 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', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) + vim.keymap.set('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) + vim.keymap.set('n', 'sb', builtin.buffers, { desc = '[ ] Find existing buffers' }) -- Slightly advanced example of overriding default behavior and theme - vim.keymap.set('n', '/', function() + vim.keymap.set('n', 'c/', function() -- You can pass additional configuration to Telescope to change the theme, layout, etc. builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { winblend = 10, previewer = false, }) - end, { desc = '[/] Fuzzily search in current buffer' }) + end, { desc = 'Fuzzily search in [c]urrent buffer [/] ' }) -- It's also possible to pass additional configuration options. -- See `:help telescope.builtin.live_grep()` for information about particular keys @@ -565,7 +535,7 @@ require('lazy').setup({ -- - 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 = { - -- clangd = {}, + clangd = {}, -- gopls = {}, -- pyright = {}, -- rust_analyzer = {}, @@ -575,7 +545,7 @@ require('lazy').setup({ -- https://github.com/pmizio/typescript-tools.nvim -- -- But for many setups, the LSP (`tsserver`) will work just fine - -- tsserver = {}, + tsserver = {}, -- lua_ls = { @@ -682,12 +652,12 @@ require('lazy').setup({ -- `friendly-snippets` contains a variety of premade snippets. -- See the README about individual language/framework/plugin snippets: -- https://github.com/rafamadriz/friendly-snippets - -- { - -- 'rafamadriz/friendly-snippets', - -- config = function() - -- require('luasnip.loaders.from_vscode').lazy_load() - -- end, - -- }, + { + 'rafamadriz/friendly-snippets', + config = function() + require('luasnip.loaders.from_vscode').lazy_load() + end, + }, }, }, 'saadparwaiz1/cmp_luasnip', @@ -710,6 +680,7 @@ require('lazy').setup({ luasnip.lsp_expand(args.body) end, }, + -- NOTE: probably better to also have 'noselect' to get so that the first suggestion is not selecte, then I can probably skip noinsert. (custom). completion = { completeopt = 'menu,menuone,noinsert' }, -- For an understanding of why these mappings were @@ -792,7 +763,7 @@ require('lazy').setup({ }, -- Highlight todo, notes, etc in comments - { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, + { 'folke/todo-comments.nvim', event = 'VeryLazy', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, { -- Collection of various small independent plugins/modules 'echasnovski/mini.nvim', @@ -885,7 +856,7 @@ require('lazy').setup({ -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, }, { ui = { -- If you are using a Nerd Font: set icons to an empty table which will use the diff --git a/lua/custom/plugins/autopairs.lua b/lua/custom/plugins/autopairs.lua new file mode 100644 index 00000000..3807819d --- /dev/null +++ b/lua/custom/plugins/autopairs.lua @@ -0,0 +1,13 @@ +return { + 'windwp/nvim-autopairs', + event = 'InsertEnter', + -- Optional dependency + dependencies = { 'hrsh7th/nvim-cmp' }, + config = function() + require('nvim-autopairs').setup {} + -- If you want to automatically add `(` after selecting a function or method + local cmp_autopairs = require 'nvim-autopairs.completion.cmp' + local cmp = require 'cmp' + cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done()) + end, +} diff --git a/lua/custom/plugins/colorizer.lua b/lua/custom/plugins/colorizer.lua new file mode 100644 index 00000000..9bc9f46f --- /dev/null +++ b/lua/custom/plugins/colorizer.lua @@ -0,0 +1,7 @@ +return { + 'NvChad/nvim-colorizer.lua', + event = 'UIEnter', + config = function() + require('colorizer').setup {} + end, +} diff --git a/lua/custom/plugins/diffview.lua b/lua/custom/plugins/diffview.lua new file mode 100644 index 00000000..70b1294f --- /dev/null +++ b/lua/custom/plugins/diffview.lua @@ -0,0 +1,5 @@ +return { + 'sindrets/diffview.nvim', + event = 'InsertEnter', + config = function() end, +} diff --git a/lua/custom/plugins/flash.lua b/lua/custom/plugins/flash.lua new file mode 100644 index 00000000..a8d36f4f --- /dev/null +++ b/lua/custom/plugins/flash.lua @@ -0,0 +1,14 @@ +return { + 'folke/flash.nvim', + event = 'VeryLazy', + ---@type Flash.Config + opts = {}, + -- stylua: ignore + keys = { + { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, + { "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, + { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" }, + { "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" }, + { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, + }, +} diff --git a/lua/custom/plugins/flutter-tools.lua b/lua/custom/plugins/flutter-tools.lua new file mode 100644 index 00000000..8125f94a --- /dev/null +++ b/lua/custom/plugins/flutter-tools.lua @@ -0,0 +1,9 @@ +return { + -- 'akinsho/flutter-tools.nvim', + -- event = 'InsertEnter', + -- dependencies = { + -- 'nvim-lua/plenary.nvim', + -- 'stevearc/dressing.nvim', -- optional for vim.ui.select + -- }, + -- config = true, +} diff --git a/lua/custom/plugins/git-blame.lua b/lua/custom/plugins/git-blame.lua new file mode 100644 index 00000000..e19b2b7f --- /dev/null +++ b/lua/custom/plugins/git-blame.lua @@ -0,0 +1,12 @@ +return { + 'f-person/git-blame.nvim', + event = 'UIEnter', + config = function() + require('gitblame').setup { + enabled = false, + } + vim.keymap.set('n', 'gb', ':GitBlameToggle', { desc = 'Toggle Git Blame' }) + vim.keymap.set('n', 'go', ':GitBlameOpenCommitURL', { desc = '[G]it Blame [O]pen Commit URL' }) + vim.keymap.set('n', 'gf', ':GitBlameOpenFileURL', { desc = '[G]it Blame Open [F]ile URL' }) + end, +} diff --git a/lua/custom/plugins/harpoon.lua b/lua/custom/plugins/harpoon.lua new file mode 100644 index 00000000..e4a083ec --- /dev/null +++ b/lua/custom/plugins/harpoon.lua @@ -0,0 +1,33 @@ +return { + 'ThePrimeagen/harpoon', + branch = 'harpoon2', + dependencies = { 'nvim-lua/plenary.nvim' }, + config = function() + local harpoon = require 'harpoon' + harpoon:setup() + + vim.keymap.set('n', 'ha', function() + harpoon:list():append() + end, { desc = '[h]arpoon [a]ppend' }) + vim.keymap.set('n', 'hm', function() + harpoon.ui:toggle_quick_menu(harpoon:list()) + end, { + noremap = true, + desc = 'Open [H]arpoon [M]enu', + }) + + for i = 1, 9 do + vim.keymap.set('n', '' .. i, function() + harpoon:list():select(i) + end, { desc = 'Goto [' .. i .. ']th buffer' }) + end + + -- Toggle previous & next buffers stored within Harpoon list + vim.keymap.set('n', '', function() + harpoon:list():prev() + end, { desc = 'Goto [P]revious buffer' }) + vim.keymap.set('n', '', function() + harpoon:list():next() + end, { desc = 'Goto [N]ext buffer' }) + end, +} diff --git a/lua/custom/plugins/incline.lua b/lua/custom/plugins/incline.lua new file mode 100644 index 00000000..f1fb2805 --- /dev/null +++ b/lua/custom/plugins/incline.lua @@ -0,0 +1,29 @@ +return { + 'b0o/incline.nvim', + config = function() + local helper = require 'incline.helpers' + local devicons = require 'nvim-web-devicons' + + require('incline').setup { + window = { + padding = 0, + margin = { horizontal = 0 }, + }, + render = function(props) + local filename = vim.fn.fnamemodify(vim.api.nvim_buf_get_name(props.buf), ':p:.') + if filename == '' then + filename = '[No Name]' + end + local ft_icon, ft_color = devicons.get_icon_color(filename) + local modified = vim.bo[props.buf].modified + return { + ft_icon and { ' ', ft_icon, ' ', guibg = ft_color, guifg = helper.contrast_color(ft_color) } or '', + ' ', + { filename, gui = modified and 'bold,italic' or 'bold' }, + ' ', + guibg = '#44406e', + } + end, + } + end, +} diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index be0eb9d8..a5647075 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -1,5 +1 @@ --- You can add your own plugins here or in other files in this directory! --- I promise not to create any merge conflicts in this directory :) --- --- See the kickstart.nvim README for more information return {} diff --git a/lua/custom/plugins/lazygit.lua b/lua/custom/plugins/lazygit.lua new file mode 100644 index 00000000..a62568cd --- /dev/null +++ b/lua/custom/plugins/lazygit.lua @@ -0,0 +1,12 @@ +return { + 'kdheepak/lazygit.nvim', + -- optional for floating window border decoration + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-telescope/telescope.nvim', + }, + config = function() + require('telescope').load_extension 'lazygit' + vim.keymap.set('n', 'gg', ':LazyGit', { desc = 'open lazygit' }) + end, +} diff --git a/lua/custom/plugins/mini-surround.lua b/lua/custom/plugins/mini-surround.lua new file mode 100644 index 00000000..8bff9ab0 --- /dev/null +++ b/lua/custom/plugins/mini-surround.lua @@ -0,0 +1,19 @@ +return { + -- 'echasnovski/mini.surround', + -- config = function() + -- require('mini.surround').setup { + -- mappings = { + -- add = 'ysa', -- Add surrounding in Normal and Visual modes + -- delete = 'ysd', -- Delete surrounding + -- find = 'ysf', -- Find surrounding (to the right) + -- find_left = 'ysF', -- Find surrounding (to the left) + -- highlight = 'ysh', -- Highlight surrounding + -- replace = 'ysr', -- Replace surrounding + -- update_n_lines = 'ysn', -- Update `n_lines` + -- + -- suffix_last = 'yl', -- Suffix to search with "prev" method + -- suffix_next = 'yn', -- Suffix to search wwth "next" method + -- }, + -- } + -- end, +} diff --git a/lua/custom/plugins/notify.lua b/lua/custom/plugins/notify.lua new file mode 100644 index 00000000..d4917239 --- /dev/null +++ b/lua/custom/plugins/notify.lua @@ -0,0 +1,6 @@ +return { + -- "rcarriga/nvim-notify", + -- config = function () + -- vim.notify = require("notify") + -- end +} diff --git a/lua/custom/plugins/oil.lua b/lua/custom/plugins/oil.lua new file mode 100644 index 00000000..935e5ab7 --- /dev/null +++ b/lua/custom/plugins/oil.lua @@ -0,0 +1,9 @@ +return { + 'stevearc/oil.nvim', + opts = {}, + dependencies = { 'nvim-tree/nvim-web-devicons' }, + config = function() + require('oil').setup() + vim.keymap.set('n', 'e', 'Oil', { desc = 'Open parent directory' }) + end, +} diff --git a/lua/custom/plugins/spectre.lua b/lua/custom/plugins/spectre.lua new file mode 100644 index 00000000..fbe19a9e --- /dev/null +++ b/lua/custom/plugins/spectre.lua @@ -0,0 +1,20 @@ +return { + 'nvim-pack/nvim-spectre', + dependencies = { + 'nvim-lua/plenary.nvim', + }, + config = function() + vim.keymap.set('n', 'S', 'lua require("spectre").toggle()', { + desc = 'Toggle Spectre', + }) + vim.keymap.set('n', 'scw', 'lua require("spectre").open_visual({select_word=true})', { + desc = 'Search current word', + }) + vim.keymap.set('v', 'scww', 'lua require("spectre").open_visual()', { + desc = 'Search current word', + }) + vim.keymap.set('n', 'socf', 'lua require("spectre").open_file_search({select_word=true})', { + desc = 'Search on current file', + }) + end, +} diff --git a/lua/custom/plugins/treesitter-context.lua b/lua/custom/plugins/treesitter-context.lua new file mode 100644 index 00000000..7bb18e4b --- /dev/null +++ b/lua/custom/plugins/treesitter-context.lua @@ -0,0 +1,7 @@ +return { + 'nvim-treesitter/nvim-treesitter-context', + -- event = 'VimEnter', + enabled = true, + opts = { mode = 'cursor', max_lines = 3 }, + config = function() end, +} diff --git a/lua/custom/plugins/trouble.lua b/lua/custom/plugins/trouble.lua new file mode 100644 index 00000000..837902f7 --- /dev/null +++ b/lua/custom/plugins/trouble.lua @@ -0,0 +1,39 @@ +return { + 'folke/trouble.nvim', + cmd = { 'TroubleToggle', 'Trouble' }, + opts = { use_diagnostic_signs = true }, + keys = { + { 'xx', 'TroubleToggle document_diagnostics', desc = 'Document Diagnostics (Trouble)' }, + { 'X', 'TroubleToggle workspace_diagnostics', desc = 'Workspace Diagnostics (Trouble)' }, + { 'xL', 'TroubleToggle loclist', desc = 'Location List (Trouble)' }, + { 'xq', 'TroubleToggle quickfix', desc = 'Quickfix List (Trouble)' }, + { + '[q', + function() + if require('trouble').is_open() then + require('trouble').previous { skip_groups = true, jump = true } + else + local ok, err = pcall(vim.cmd.cprev) + if not ok then + vim.notify(err, vim.log.levels.ERROR) + end + end + end, + desc = 'Previous trouble/quickfix item', + }, + { + ']q', + function() + if require('trouble').is_open() then + require('trouble').next { skip_groups = true, jump = true } + else + local ok, err = pcall(vim.cmd.cnext) + if not ok then + vim.notify(err, vim.log.levels.ERROR) + end + end + end, + desc = 'Next trouble/quickfix item', + }, + }, +} diff --git a/lua/custom/plugins/vim-illuminate.lua b/lua/custom/plugins/vim-illuminate.lua new file mode 100644 index 00000000..cd9f87ad --- /dev/null +++ b/lua/custom/plugins/vim-illuminate.lua @@ -0,0 +1,37 @@ +return { + -- 'RRethy/vim-illuminate', + -- event = 'UIEnter', + -- opts = { + -- keys = {}, + -- delay = 200, + -- large_file_cutoff = 2000, + -- large_file_overrides = { + -- providers = { 'lsp' }, + -- }, + -- }, + -- config = function(_, opts) + -- require('illuminate').configure(opts) + -- + -- local function map(key, dir, buffer) + -- vim.keymap.set('n', key, function() + -- require('illuminate')['goto_' .. dir .. '_reference'](false) + -- end, { desc = dir:sub(1, 1):upper() .. dir:sub(2) .. ' Reference', buffer = buffer }) + -- end + -- + -- -- map("]]", "next") + -- -- map("[[", "prev") + -- + -- -- also set it after loading ftplugins, since a lot overwrite [[ and ]] + -- vim.api.nvim_create_autocmd('FileType', { + -- callback = function() + -- local buffer = vim.api.nvim_get_current_buf() + -- -- map("]]", "next", buffer) + -- -- map("[[", "prev", buffer) + -- end, + -- }) + -- end, + -- keys = { + -- -- { "]]", desc = "Next Reference" }, + -- -- { "[[", desc = "Prev Reference" }, + -- }, +} diff --git a/lua/custom/plugins/vim-tmux-navigator.lua b/lua/custom/plugins/vim-tmux-navigator.lua new file mode 100644 index 00000000..acb3d0c7 --- /dev/null +++ b/lua/custom/plugins/vim-tmux-navigator.lua @@ -0,0 +1,10 @@ +return { + 'alexghergh/nvim-tmux-navigation', + config = function() + require('nvim-tmux-navigation').setup {} + vim.keymap.set('n', '', 'NvimTmuxNavigateLeft', {}) + vim.keymap.set('n', '', 'NvimTmuxNavigateDown', {}) + vim.keymap.set('n', '', 'NvimTmuxNavigateUp', {}) + vim.keymap.set('n', '', 'NvimTmuxNavigateRight', {}) + end, +}