From d210bdede051fc9936afc68cc41abda119e1d8ad Mon Sep 17 00:00:00 2001 From: John Hoffmann Date: Sun, 11 Aug 2024 00:57:27 -0600 Subject: [PATCH] custom plugins --- lua/custom/plugins/autopairs.lua | 12 +++++++++++ lua/custom/plugins/barbecue.lua | 12 +++++++++++ lua/custom/plugins/colors.lua | 28 +++++++++++++++++++++++++ lua/custom/plugins/grapple.lua | 18 ++++++++++++++++ lua/custom/plugins/neogit.lua | 10 +++++++++ lua/custom/plugins/neotree.lua | 35 +++++++++++++++++++++++++++++++ lua/custom/plugins/project.lua | 25 ++++++++++++++++++++++ lua/custom/plugins/toggleterm.lua | 19 +++++++++++++++++ lua/lazy-plugins.lua | 5 ++--- lua/options.lua | 2 +- 10 files changed, 162 insertions(+), 4 deletions(-) create mode 100644 lua/custom/plugins/autopairs.lua create mode 100644 lua/custom/plugins/barbecue.lua create mode 100644 lua/custom/plugins/colors.lua create mode 100644 lua/custom/plugins/grapple.lua create mode 100644 lua/custom/plugins/neogit.lua create mode 100644 lua/custom/plugins/neotree.lua create mode 100644 lua/custom/plugins/project.lua create mode 100644 lua/custom/plugins/toggleterm.lua diff --git a/lua/custom/plugins/autopairs.lua b/lua/custom/plugins/autopairs.lua new file mode 100644 index 00000000000..73ba7a070a6 --- /dev/null +++ b/lua/custom/plugins/autopairs.lua @@ -0,0 +1,12 @@ +return { + { + 'windwp/nvim-autopairs', + event = 'InsertEnter', + config = true, + opts = { + map_c_w = true, + }, + -- use opts = {} for passing setup options + -- this is equalent to setup({}) function + }, +} diff --git a/lua/custom/plugins/barbecue.lua b/lua/custom/plugins/barbecue.lua new file mode 100644 index 00000000000..ccbbd379e09 --- /dev/null +++ b/lua/custom/plugins/barbecue.lua @@ -0,0 +1,12 @@ +return { + 'utilyre/barbecue.nvim', + name = 'barbecue', + version = '*', + dependencies = { + 'SmiteshP/nvim-navic', + 'nvim-tree/nvim-web-devicons', -- optional dependency + }, + opts = { + -- configurations go here + }, +} diff --git a/lua/custom/plugins/colors.lua b/lua/custom/plugins/colors.lua new file mode 100644 index 00000000000..8d05abd6962 --- /dev/null +++ b/lua/custom/plugins/colors.lua @@ -0,0 +1,28 @@ +return { + { + 'rose-pine/neovim', + name = 'rose-pine', + config = function() + require('rose-pine').setup { + variant = 'main', + dark_variant = 'main', + dim_inactive_windows = false, + styles = { + transparency = true, + }, + } + -- local theme = require 'lualine.themes.rose-pine' + -- local modes = { 'normal', 'insert', 'visual', 'replace', 'command', 'inactive' } + -- for _, mode in ipairs(modes) do + -- theme[mode].c.bg = 'NONE' + -- end + + -- require('lualine').setup { + -- options = { + -- theme = theme, + -- }, + -- } + vim.cmd 'colorscheme rose-pine' + end, + }, +} diff --git a/lua/custom/plugins/grapple.lua b/lua/custom/plugins/grapple.lua new file mode 100644 index 00000000000..ddc475ffc1c --- /dev/null +++ b/lua/custom/plugins/grapple.lua @@ -0,0 +1,18 @@ +return { + { + 'cbochs/grapple.nvim', + opts = { + scope = 'git_branch', + }, + keys = { + { '', 'Grapple toggle', desc = 'T[a]g a file' }, + { ';', 'Grapple toggle_tags', desc = 'Show tags menu' }, + -- { '', 'Grapple cycle_tags next', desc = 'Cycle next tag' }, + -- { '', 'Grapple cycle_tags prev', desc = 'Cycle previous tag' }, + -- { '', 'Grapple select index=1', desc = 'Select first tag' }, + -- { '', 'Grapple select index=2', desc = 'Select second tag' }, + -- { '', 'Grapple select index=3', desc = 'Select third tag' }, + -- { '', 'Grapple select index=4', desc = 'Select fourth tag' }, + }, + }, +} diff --git a/lua/custom/plugins/neogit.lua b/lua/custom/plugins/neogit.lua new file mode 100644 index 00000000000..4b06987fcf2 --- /dev/null +++ b/lua/custom/plugins/neogit.lua @@ -0,0 +1,10 @@ +return { + 'NeogitOrg/neogit', + dependencies = { + 'nvim-lua/plenary.nvim', + 'sindrets/diffview.nvim', + + 'nvim-telescope/telescope.nvim', + }, + config = true, +} diff --git a/lua/custom/plugins/neotree.lua b/lua/custom/plugins/neotree.lua new file mode 100644 index 00000000000..f522516e9d3 --- /dev/null +++ b/lua/custom/plugins/neotree.lua @@ -0,0 +1,35 @@ +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 + }, + config = function() + require('neo-tree').setup { + close_if_last_window = true, + window = { + mappings = { + ['s'] = 'open_split', + ['S'] = 'open_vsplit', + }, + width = 40, + }, + filesystem = { + filtered_items = { + visible = true, + }, + follow_current_file = { + enabled = true, + }, + }, + } + end, + }, + + vim.keymap.set('n', '\\f', 'Neotree left filesystem', { desc = '[F]ile explorer' }), + vim.keymap.set('n', '\\b', 'Neotree float buffers', { desc = 'List open [B]uffers' }), +} diff --git a/lua/custom/plugins/project.lua b/lua/custom/plugins/project.lua new file mode 100644 index 00000000000..3051e311c47 --- /dev/null +++ b/lua/custom/plugins/project.lua @@ -0,0 +1,25 @@ +return { + { + 'coffebar/neovim-project', + opts = { + projects = { -- define project roots + '/mnt/Data/src/kprofiles/*', + '/mnt/Data/src/*', + '/mnt/Data/code/*', + '~/.config/*', + }, + dashboard_mode = true, + }, + init = function() + -- enable saving the state of plugins in the session + vim.opt.sessionoptions:append 'globals' -- save global variables that start with an uppercase letter and contain at least one lowercase letter. + end, + dependencies = { + { 'nvim-lua/plenary.nvim' }, + { 'nvim-telescope/telescope.nvim', tag = '0.1.4' }, + { 'Shatur/neovim-session-manager' }, + }, + lazy = false, + priority = 100, + }, +} diff --git a/lua/custom/plugins/toggleterm.lua b/lua/custom/plugins/toggleterm.lua new file mode 100644 index 00000000000..c779af2700b --- /dev/null +++ b/lua/custom/plugins/toggleterm.lua @@ -0,0 +1,19 @@ +return { + { + 'akinsho/toggleterm.nvim', + version = '*', + config = true, + opts = { + size = 20, + float_opts = { + border = 'curved', + width = 120, + height = 40, + title_pos = 'left', + }, + }, + }, + + vim.keymap.set('n', '', 'ToggleTerm direction=horizontal', { desc = 'Toggle a split terminal' }), + vim.keymap.set('n', '', 'ToggleTerm direction=float', { desc = 'Toggle a floating terminal' }), +} diff --git a/lua/lazy-plugins.lua b/lua/lazy-plugins.lua index f601d395e2a..19780a4e785 100644 --- a/lua/lazy-plugins.lua +++ b/lua/lazy-plugins.lua @@ -20,7 +20,6 @@ require('lazy').setup({ -- Use `opts = {}` to force a plugin to be loaded. -- - -- modular approach: using `require 'path/name'` will -- include a plugin definition from file lua/path/name.lua @@ -36,7 +35,7 @@ require('lazy').setup({ require 'kickstart/plugins/cmp', - require 'kickstart/plugins/tokyonight', + -- require 'kickstart/plugins/tokyonight', require 'kickstart/plugins/todo-comments', @@ -64,7 +63,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/options.lua b/lua/options.lua index 94ee2ed6364..bb843ad3641 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -7,7 +7,7 @@ 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'