diff --git a/init.lua b/init.lua index 410231cf..e33cae35 100644 --- a/init.lua +++ b/init.lua @@ -86,25 +86,12 @@ vim.opt.rtp:prepend(lazypath) -- -- You can press `?` in this menu for help. Use `:q` to close the window -- --- To update plugins, you can run --- :Lazy update -- -- NOTE: Here is where you install your plugins. require('lazy').setup { { import = 'Judokasarin.plugins' }, - -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). - 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically + 'tpope/vim-sleuth', - -- NOTE: Plugins can also be added by using a table, - -- with the first argument being the link and the following - -- keys can be used to configure plugin behavior/loading/etc. - -- - -- Use `opts = {}` to force a plugin to be loaded. - -- - -- This is equivalent to: - -- require('Comment').setup({}) - - -- "gc" to comment visual regions/lines { 'numToStr/Comment.nvim', opts = {} }, -- Here is a more advanced example where we pass configuration @@ -133,29 +120,6 @@ require('lazy').setup { -- For example, in the following configuration, we use: -- event = 'VeryLazy' -- - -- which loads which-key after all the UI elements are loaded. Events can be - -- normal autocommands events (`:help autocmd-events`). - -- - -- Then, because we use the `config` key, the configuration only runs - -- after the plugin has been loaded: - -- config = function() ... end - - { -- Useful plugin to show you pending keybinds. - 'folke/which-key.nvim', - event = 'VeryLazy', -- Sets the loading event to 'VeryLazy' - config = function() -- This is the function that runs, AFTER loading - require('which-key').setup() - - -- Document existing key chains - require('which-key').register { - ['c'] = { name = '[C]ode', _ = 'which_key_ignore' }, - ['d'] = { name = '[D]ocument', _ = 'which_key_ignore' }, - ['r'] = { name = '[R]ename', _ = 'which_key_ignore' }, - ['s'] = { name = '[S]earch', _ = 'which_key_ignore' }, - ['w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, - } - end, - }, -- NOTE: Plugins can specify dependencies. -- diff --git a/lua/Judokasarin/keymaps.lua b/lua/Judokasarin/keymaps.lua index eef2d017..e1b2776a 100644 --- a/lua/Judokasarin/keymaps.lua +++ b/lua/Judokasarin/keymaps.lua @@ -3,7 +3,6 @@ vim.keymap.set('n', '', 'nohlsearch') -- Diagnostic keymaps 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' }) -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier @@ -28,7 +27,16 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the left wind 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' }) - +-- +-- +-- [[ Neo-Tree ]] +vim.keymap.set('n', 'ee', 'Neotree toggle show reveal_force_cwd', { desc = '[e]xplorer' }) +vim.keymap.set('n', 'eg', 'Neotree toggle show git_status', { desc = '[e]xplorer [g]it status' }) +vim.keymap.set('n', 'eb', 'Neotree toggle show buffers', { desc = '[e]xplorer [b]uffers' }) +vim.keymap.set('n', 'ec', 'Neotree close', { desc = '[e]xplorer [b]uffers' }) +-- +-- +-- -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` @@ -42,4 +50,3 @@ vim.api.nvim_create_autocmd('TextYankPost', { vim.highlight.on_yank() end, }) - diff --git a/lua/Judokasarin/plugins/bufferline.lua b/lua/Judokasarin/plugins/bufferline.lua index 262d076d..acf3ec8d 100644 --- a/lua/Judokasarin/plugins/bufferline.lua +++ b/lua/Judokasarin/plugins/bufferline.lua @@ -1,11 +1,11 @@ --- return { --- 'akinsho/bufferline.nvim', --- version = "*", --- dependencies = 'nvim-tree/nvim-web-devicons', --- opts = { --- options = { --- mode = "buffers", --- separator_style = "slant", --- } --- } --- } +return { + -- 'akinsho/bufferline.nvim', + -- version = "*", + -- dependencies = 'nvim-tree/nvim-web-devicons', + -- opts = { + -- options = { + -- mode = "buffers", + -- separator_style = "slant", + -- } + -- } +} diff --git a/lua/Judokasarin/plugins/gitsigns.lua b/lua/Judokasarin/plugins/gitsigns.lua new file mode 100644 index 00000000..98b17498 --- /dev/null +++ b/lua/Judokasarin/plugins/gitsigns.lua @@ -0,0 +1,17 @@ +-- Here is a more advanced example where we pass configuration +-- options to `gitsigns.nvim`. This is equivalent to the following lua: +-- require('gitsigns').setup({ ... }) +-- +-- See `:help gitsigns` to understand what the configuration keys do +return { -- Adds git related signs to the gutter, as well as utilities for managing changes + 'lewis6991/gitsigns.nvim', + opts = { + signs = { + add = { text = '+' }, + change = { text = '~' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, + changedelete = { text = '~' }, + }, + }, +} diff --git a/lua/Judokasarin/plugins/neogit.lua b/lua/Judokasarin/plugins/neogit.lua new file mode 100644 index 00000000..f8d6426f --- /dev/null +++ b/lua/Judokasarin/plugins/neogit.lua @@ -0,0 +1,12 @@ +return +{ + "NeogitOrg/neogit", + dependencies = { + "nvim-lua/plenary.nvim", -- required + "sindrets/diffview.nvim", -- optional - Diff integration + + -- Only one of these is needed, not both. + "nvim-telescope/telescope.nvim", -- optional + }, + config = true +} diff --git a/lua/Judokasarin/plugins/neotree.lua b/lua/Judokasarin/plugins/neotree.lua index b853dc82..3ecef40f 100644 --- a/lua/Judokasarin/plugins/neotree.lua +++ b/lua/Judokasarin/plugins/neotree.lua @@ -1,10 +1,9 @@ -return { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended - "MunifTanjim/nui.nvim", - -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information - } -} \ No newline at end of file +return { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", + } +} diff --git a/lua/Judokasarin/plugins/telescope.lua b/lua/Judokasarin/plugins/telescope.lua index 45e9f00c..ee5d9892 100644 --- a/lua/Judokasarin/plugins/telescope.lua +++ b/lua/Judokasarin/plugins/telescope.lua @@ -4,7 +4,7 @@ return { -- Fuzzy Finder (files, lsp, etc) branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim', - { -- If encountering errors, see telescope-fzf-native README for install instructions + { -- If encountering errors, see telescope-fzf-native README for install instructions 'nvim-telescope/telescope-fzf-native.nvim', -- `build` is used to run some command when the plugin is installed/updated. @@ -66,9 +66,11 @@ return { -- Fuzzy Finder (files, lsp, etc) -- Enable telescope extensions, if they are installed pcall(require('telescope').load_extension, 'fzf') pcall(require('telescope').load_extension, 'ui-select') - - -- See `:help telescope.builtin` local builtin = require 'telescope.builtin' + + -- [[Telescope Keymaps]] + -- + -- -- See `:help 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' }) @@ -102,5 +104,7 @@ return { -- Fuzzy Finder (files, lsp, etc) vim.keymap.set('n', 'sn', function() builtin.find_files { cwd = vim.fn.stdpath 'config' } end, { desc = '[S]earch [N]eovim files' }) + + -- end, } diff --git a/lua/Judokasarin/plugins/which.lua b/lua/Judokasarin/plugins/which.lua new file mode 100644 index 00000000..d7ae0ed3 --- /dev/null +++ b/lua/Judokasarin/plugins/which.lua @@ -0,0 +1,17 @@ +return { -- Useful plugin to show you pending keybinds. + 'folke/which-key.nvim', + event = 'VeryLazy', -- Sets the loading event to 'VeryLazy' + config = function() -- This is the function that runs, AFTER loading + require('which-key').setup() + + -- Document existing key chains + require('which-key').register { + ['c'] = { name = '[C]ode', _ = 'which_key_ignore' }, + ['d'] = { name = '[D]ocument', _ = 'which_key_ignore' }, + ['r'] = { name = '[R]ename', _ = 'which_key_ignore' }, + ['s'] = { name = '[S]earch', _ = 'which_key_ignore' }, + ['w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, + [''] = { name = '[E]xplorer', _ = 'which_key_ignore' }, + } + end, +}