From 1459ea94bf17b313aae79b045f54173467b5455a Mon Sep 17 00:00:00 2001 From: Ducky Date: Wed, 1 Jan 2025 20:09:16 +1000 Subject: [PATCH] Enable default plugins, add toggleterm, harpoon and lazygit --- README.md | 2 ++ init.lua | 19 ++++++------ lua/custom/options.lua | 0 lua/custom/plugins/harpoon.lua | 50 ++++++++++++++++++++++++++++++ lua/custom/plugins/lazygit.lua | 7 +++++ lua/custom/plugins/toggleterm.lua | 27 ++++++++++++++++ lua/kickstart/plugins/neo-tree.lua | 2 +- 7 files changed, 96 insertions(+), 11 deletions(-) create mode 100644 lua/custom/options.lua create mode 100644 lua/custom/plugins/harpoon.lua create mode 100644 lua/custom/plugins/lazygit.lua create mode 100644 lua/custom/plugins/toggleterm.lua diff --git a/README.md b/README.md index aa5f4fc..5805e9a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # kickstart.nvim +This fork of kickstart.nvim has a few plugins added and is used a general base though just cloning it will get you 90% of the way through most of your development in various languages. + ## Introduction A starting point for Neovim that is: diff --git a/init.lua b/init.lua index 7758df9..1b92787 100644 --- a/init.lua +++ b/init.lua @@ -91,7 +91,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 +102,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' @@ -928,18 +928,17 @@ require('lazy').setup({ -- Here are some example plugins that I've included in the Kickstart repository. -- Uncomment any of the lines below to enable them (you will need to restart nvim). -- - -- require 'kickstart.plugins.debug', - -- require 'kickstart.plugins.indent_line', - -- require 'kickstart.plugins.lint', - -- require 'kickstart.plugins.autopairs', - -- require 'kickstart.plugins.neo-tree', - -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps - + require 'kickstart.plugins.debug', + require 'kickstart.plugins.indent_line', + require 'kickstart.plugins.lint', + require 'kickstart.plugins.autopairs', + require 'kickstart.plugins.neo-tree', + require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- This is the easiest way to modularize your config. -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, -- -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` -- Or use telescope! diff --git a/lua/custom/options.lua b/lua/custom/options.lua new file mode 100644 index 0000000..e69de29 diff --git a/lua/custom/plugins/harpoon.lua b/lua/custom/plugins/harpoon.lua new file mode 100644 index 0000000..2a1a1c4 --- /dev/null +++ b/lua/custom/plugins/harpoon.lua @@ -0,0 +1,50 @@ +return { + 'ThePrimeagen/harpoon', + branch = 'harpoon2', + requires = { { 'nvim-lua/plenary.nvim' } }, + config = function() + local harpoon = require 'harpoon' + harpoon:setup() + -- Harpoon remaps + vim.keymap.set('n', 'bm', function() + harpoon:list():append() + end, { desc = 'Add buffer to Harpoon list' }) + vim.keymap.set('n', '', function() + harpoon.ui:toggle_quick_menu(harpoon:list()) + end) + + vim.keymap.set('n', '', function() + harpoon:list():select(1) + end) + vim.keymap.set('n', '', function() + harpoon:list():select(2) + end) + vim.keymap.set('n', '', function() + harpoon:list():select(3) + end) + + -- Toggle previous & next buffers stored within Harpoon list + vim.keymap.set('n', '', function() + harpoon:list():prev() + end) + vim.keymap.set('n', '', function() + harpoon:list():next() + end) + + harpoon:extend { + UI_CREATE = function(cx) + vim.keymap.set('n', '', function() + harpoon.ui:select_menu_item { vsplit = true } + end, { buffer = cx.bufnr }) + + vim.keymap.set('n', '', function() + harpoon.ui:select_menu_item { split = true } + end, { buffer = cx.bufnr }) + + vim.keymap.set('n', '', function() + harpoon.ui:select_menu_item { tabedit = true } + end, { buffer = cx.bufnr }) + end, + } + end, +} diff --git a/lua/custom/plugins/lazygit.lua b/lua/custom/plugins/lazygit.lua new file mode 100644 index 0000000..09077b9 --- /dev/null +++ b/lua/custom/plugins/lazygit.lua @@ -0,0 +1,7 @@ +return { + 'kdheepak/lazygit.nvim', + -- optional for floating window border decoration + dependencies = { + 'nvim-lua/plenary.nvim', + }, +} diff --git a/lua/custom/plugins/toggleterm.lua b/lua/custom/plugins/toggleterm.lua new file mode 100644 index 0000000..482c3a8 --- /dev/null +++ b/lua/custom/plugins/toggleterm.lua @@ -0,0 +1,27 @@ +return { + { + 'akinsho/toggleterm.nvim', + -- [[ cmd = { "toggleterm", "termexec" }, ]] + opts = { + highlights = { + normal = { link = 'normal' }, + normalnc = { link = 'normalnc' }, + normalfloat = { link = 'normalfloat' }, + floatborder = { link = 'floatborder' }, + statusline = { link = 'statusline' }, + statuslinenc = { link = 'statuslinenc' }, + winbar = { link = 'winbar' }, + winbarnc = { link = 'winbarnc' }, + }, + size = 10, + on_create = function() + vim.opt.foldcolumn = '0' + vim.opt.signcolumn = 'no' + end, + open_mapping = [[]], + shading_factor = 2, + direction = 'float', + float_opts = { border = 'rounded' }, + }, + }, +} diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua index bd44226..d8521df 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', silent = true }, + { '\\', ':Neotree reveal right', desc = 'NeoTree reveal', silent = true }, }, opts = { filesystem = {