From 78dc0868c7fffab2d62df8e4481b51ac7ecaa791 Mon Sep 17 00:00:00 2001 From: LeoSM_07 <69401930+LeoSM-07@users.noreply.github.com> Date: Tue, 6 May 2025 16:04:58 -0400 Subject: [PATCH] Refactor Plugins --- init.lua | 168 +++------------------ lazy-lock.json | 11 ++ lua/colorscheme.lua | 1 + lua/custom/plugins/github-theme.lua | 4 + lua/custom/plugins/nvterm.lua | 10 ++ lua/custom/plugins/ts-autotag.lua | 5 + lua/custom/plugins/{init.lua => vauge.lua} | 5 +- lua/kickstart/plugins/neo-tree.lua | 3 +- 8 files changed, 57 insertions(+), 150 deletions(-) create mode 100644 lua/colorscheme.lua create mode 100644 lua/custom/plugins/github-theme.lua create mode 100644 lua/custom/plugins/nvterm.lua create mode 100644 lua/custom/plugins/ts-autotag.lua rename lua/custom/plugins/{init.lua => vauge.lua} (76%) diff --git a/init.lua b/init.lua index b8626bae..e2c75ca2 100644 --- a/init.lua +++ b/init.lua @@ -1,91 +1,3 @@ ---[[ - -===================================================================== -==================== READ THIS BEFORE CONTINUING ==================== -===================================================================== -======== .-----. ======== -======== .----------------------. | === | ======== -======== |.-""""""""""""""""""-.| |-----| ======== -======== || || | === | ======== -======== || KICKSTART.NVIM || |-----| ======== -======== || || | === | ======== -======== || || |-----| ======== -======== ||:Tutor || |:::::| ======== -======== |'-..................-'| |____o| ======== -======== `"")----------------(""` ___________ ======== -======== /::::::::::| |::::::::::\ \ no mouse \ ======== -======== /:::========| |==hjkl==:::\ \ required \ ======== -======== '""""""""""""' '""""""""""""' '""""""""""' ======== -======== ======== -===================================================================== -===================================================================== - -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. - - I have left several `:help X` comments throughout the init.lua - These are hints about where to find more information about the relevant settings, - plugins or Neovim features used in Kickstart. - - NOTE: Look for lines like this - - Throughout the file. These are for you, the reader, to help you understand what is happening. - Feel free to delete them once you know what you're doing, but they should serve as a guide - for when you are first encountering a few different constructs in your Neovim config. - -If you experience any errors while trying to install kickstart, run `:checkhealth` for more info. - -I hope you enjoy your Neovim journey, -- TJ - -P.S. You can delete this when you're done too. It's your config now! :) ---]] - --- Set as the leader key --- See `:help mapleader` -- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' @@ -206,15 +118,6 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the right win vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) --- Keybinds for custom plugins --- NvimTree -vim.api.nvim_set_keymap('n', '', ':NvimTreeToggle', { silent = true, noremap = true }) - --- NvTerm -vim.keymap.set('n', 'tt', function() - require('nvterm.terminal').toggle 'horizontal' -end, { desc = '[T]oggle [T]erminal' }) - -- NOTE: Some terminals have coliding keymaps or are not able to send distinct keycodes -- vim.keymap.set("n", "", "H", { desc = "Move window to the left" }) -- vim.keymap.set("n", "", "L", { desc = "Move window to the right" }) @@ -395,7 +298,7 @@ require('lazy').setup({ end, }, { 'nvim-telescope/telescope-ui-select.nvim' }, - + { 'andrew-george/telescope-themes' }, -- Useful for getting pretty icons, but requires a Nerd Font. { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, }, @@ -435,12 +338,22 @@ require('lazy').setup({ ['ui-select'] = { require('telescope.themes').get_dropdown(), }, + themes = { + persist = { + -- enable persisting last theme choice + enabled = true, + + -- override path to file that execute colorscheme command + path = vim.fn.stdpath 'config' .. '/lua/colorscheme.lua', + }, + }, }, } -- Enable Telescope extensions if they are installed pcall(require('telescope').load_extension, 'fzf') pcall(require('telescope').load_extension, 'ui-select') + pcall(require('telescope').load_extension, 'themes') -- See `:help telescope.builtin` local builtin = require 'telescope.builtin' @@ -454,6 +367,7 @@ require('lazy').setup({ 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', 'ts', ':Telescope themes', { noremap = true, silent = true, desc = '[T]heme [S]witcher' }) -- Slightly advanced example of overriding default behavior and theme vim.keymap.set('n', '/', function() @@ -933,8 +847,6 @@ require('lazy').setup({ { name = 'nvim_lsp_signature_help' }, }, } - local cmp_autopairs = require 'nvim-autopairs.completion.cmp' - cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done()) end, }, @@ -956,7 +868,7 @@ require('lazy').setup({ -- Load the colorscheme here. -- Like many other themes, this one has different styles, and you could load -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. - vim.cmd.colorscheme 'tokyonight-night' + -- vim.cmd.colorscheme 'tokyonight-moon' end, }, @@ -1000,40 +912,6 @@ require('lazy').setup({ -- Check out: https://github.com/echasnovski/mini.nvim end, }, - { - 'nvim-tree/nvim-tree.lua', - version = '*', - lazy = false, - dependencies = { - 'nvim-tree/nvim-web-devicons', - }, - config = function() - require('nvim-tree').setup {} - end, - }, - { - 'NvChad/nvterm', - config = function() - require('nvterm').setup() - end, - }, - { - 'davidmh/mdx.nvim', - config = true, - dependencies = { 'nvim-treesitter/nvim-treesitter' }, - }, - { - 'windwp/nvim-autopairs', - event = 'InsertEnter', - config = true, - -- use opts = {} for passing setup options - -- this is equivalent to setup({}) function - }, - { - 'windwp/nvim-ts-autotag', - lazy = false, - config = true, - }, { -- Highlight, edit, and navigate code 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', @@ -1060,27 +938,20 @@ require('lazy').setup({ -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects }, - -- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the - -- init.lua. If you want these files, they are in the repository, so you can just download them and - -- place them in the correct locations. - -- NOTE: Next step on your Neovim journey: Add/Configure additional plugins for Kickstart -- - -- 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.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.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! @@ -1108,4 +979,5 @@ require('lazy').setup({ }, }) +require 'colorscheme' -- The line beneath this is called `modeline`. See `:help modeline` diff --git a/lazy-lock.json b/lazy-lock.json index ee6687dc..67ba8c23 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -6,18 +6,27 @@ "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "conform.nvim": { "branch": "master", "commit": "f9ef25a7ef00267b7d13bfc00b0dea22d78702d5" }, "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, + "github-nvim-theme": { "branch": "main", "commit": "c106c9472154d6b2c74b74565616b877ae8ed31d" }, "gitsigns.nvim": { "branch": "main", "commit": "7010000889bfb6c26065e0b0f7f1e6aa9163edd9" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "4c2cdc69d69fe00c15ae8648f7e954d99e5de3ea" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "98767d37f8e5255a5111fc1e3163232d4dc07bda" }, "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, "mdx.nvim": { "branch": "main", "commit": "464a74be368dce212cff02f6305845dc7f209ab3" }, "mini.nvim": { "branch": "main", "commit": "3ad46cdb7a51281e0024416023b56cf5c7909ae7" }, + "neo-tree.nvim": { "branch": "main", "commit": "1ef260eb4f54515fe121a2267b477efb054d108a" }, + "nui.nvim": { "branch": "main", "commit": "f535005e6ad1016383f24e39559833759453564e" }, "nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" }, "nvim-cmp": { "branch": "main", "commit": "1e1900b0769324a9675ef85b38f99cca29e203b3" }, + "nvim-dap": { "branch": "master", "commit": "8df427aeba0a06c6577dc3ab82de3076964e3b8d" }, + "nvim-dap-go": { "branch": "main", "commit": "8763ced35b19c8dc526e04a70ab07c34e11ad064" }, + "nvim-dap-ui": { "branch": "master", "commit": "73a26abf4941aa27da59820fd6b028ebcdbcf932" }, "nvim-highlight-colors": { "branch": "main", "commit": "982543ec460199de5bdc491745dc9faa6bcc19b6" }, + "nvim-lint": { "branch": "master", "commit": "9dfb77ef6c5092a19502883c02dc5a02ec648729" }, "nvim-lspconfig": { "branch": "master", "commit": "200280dab91a7df2ca42fd2ab3cb4c5fab056666" }, + "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-tree.lua": { "branch": "master", "commit": "6709463b2d18e77f7a946027917aa00d4aaed6f4" }, "nvim-treesitter": { "branch": "master", "commit": "e329e94a6a0a5ccf6ec8bfec1d10faf5eaae665f" }, "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, @@ -25,10 +34,12 @@ "nvterm": { "branch": "main", "commit": "9d7ba3b6e368243175d38e1ec956e0476fd86ed9" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, + "telescope-themes": { "branch": "main", "commit": "9b7c368b83b82b53c0a6e9e977f8329e5f1fe269" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, + "vague.nvim": { "branch": "main", "commit": "9f1ae62d2522f75f3cc857a23a4b87125edce1ad" }, "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } } diff --git a/lua/colorscheme.lua b/lua/colorscheme.lua new file mode 100644 index 00000000..8e00839f --- /dev/null +++ b/lua/colorscheme.lua @@ -0,0 +1 @@ +vim.cmd("colorscheme vague") \ No newline at end of file diff --git a/lua/custom/plugins/github-theme.lua b/lua/custom/plugins/github-theme.lua new file mode 100644 index 00000000..7d77425a --- /dev/null +++ b/lua/custom/plugins/github-theme.lua @@ -0,0 +1,4 @@ +return { + 'projekt0n/github-nvim-theme', + config = function() end, +} diff --git a/lua/custom/plugins/nvterm.lua b/lua/custom/plugins/nvterm.lua new file mode 100644 index 00000000..8352c210 --- /dev/null +++ b/lua/custom/plugins/nvterm.lua @@ -0,0 +1,10 @@ +return { + 'NvChad/nvterm', + config = function() + require('nvterm').setup() + + vim.keymap.set('n', 'tt', function() + require('nvterm.terminal').toggle 'horizontal' + end, { desc = '[T]oggle [T]erminal' }) + end, +} diff --git a/lua/custom/plugins/ts-autotag.lua b/lua/custom/plugins/ts-autotag.lua new file mode 100644 index 00000000..9d6914a4 --- /dev/null +++ b/lua/custom/plugins/ts-autotag.lua @@ -0,0 +1,5 @@ +return { + 'windwp/nvim-ts-autotag', + lazy = false, + config = true, +} diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/vauge.lua similarity index 76% rename from lua/custom/plugins/init.lua rename to lua/custom/plugins/vauge.lua index be0eb9d8..c8efe416 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/vauge.lua @@ -2,4 +2,7 @@ -- I promise not to create any merge conflicts in this directory :) -- -- See the kickstart.nvim README for more information -return {} +return { + 'vague2k/vague.nvim', + config = function() end, +} diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua index bd442269..8638e76c 100644 --- a/lua/kickstart/plugins/neo-tree.lua +++ b/lua/kickstart/plugins/neo-tree.lua @@ -11,7 +11,8 @@ return { }, cmd = 'Neotree', keys = { - { '\\', ':Neotree reveal', desc = 'NeoTree reveal', silent = true }, + { '\\', ':Neotree toggle', desc = 'NeoTree reveal', silent = true }, + { '', ':Neotree toggle', silent = true, noremap = true }, }, opts = { filesystem = {