Refactor Plugins

This commit is contained in:
LeoSM_07 2025-05-06 16:04:58 -04:00
parent b3f3fc70f0
commit 78dc0868c7
No known key found for this signature in database
8 changed files with 57 additions and 150 deletions

168
init.lua
View File

@ -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:
- <escape key>
- :
- Tutor
- <enter key>
(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 "<space>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 <space> as the leader key
-- See `:help mapleader`
-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) -- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)
vim.g.mapleader = ' ' vim.g.mapleader = ' '
vim.g.maplocalleader = ' ' vim.g.maplocalleader = ' '
@ -206,15 +118,6 @@ vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right win
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' }) vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' }) vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
-- Keybinds for custom plugins
-- NvimTree
vim.api.nvim_set_keymap('n', '<C-n>', ':NvimTreeToggle<cr>', { silent = true, noremap = true })
-- NvTerm
vim.keymap.set('n', '<leader>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 -- NOTE: Some terminals have coliding keymaps or are not able to send distinct keycodes
-- vim.keymap.set("n", "<C-S-h>", "<C-w>H", { desc = "Move window to the left" }) -- vim.keymap.set("n", "<C-S-h>", "<C-w>H", { desc = "Move window to the left" })
-- vim.keymap.set("n", "<C-S-l>", "<C-w>L", { desc = "Move window to the right" }) -- vim.keymap.set("n", "<C-S-l>", "<C-w>L", { desc = "Move window to the right" })
@ -395,7 +298,7 @@ require('lazy').setup({
end, end,
}, },
{ 'nvim-telescope/telescope-ui-select.nvim' }, { 'nvim-telescope/telescope-ui-select.nvim' },
{ 'andrew-george/telescope-themes' },
-- Useful for getting pretty icons, but requires a Nerd Font. -- Useful for getting pretty icons, but requires a Nerd Font.
{ 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font },
}, },
@ -435,12 +338,22 @@ require('lazy').setup({
['ui-select'] = { ['ui-select'] = {
require('telescope.themes').get_dropdown(), 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 -- Enable Telescope extensions if they are installed
pcall(require('telescope').load_extension, 'fzf') pcall(require('telescope').load_extension, 'fzf')
pcall(require('telescope').load_extension, 'ui-select') pcall(require('telescope').load_extension, 'ui-select')
pcall(require('telescope').load_extension, 'themes')
-- See `:help telescope.builtin` -- See `:help telescope.builtin`
local builtin = require 'telescope.builtin' local builtin = require 'telescope.builtin'
@ -454,6 +367,7 @@ require('lazy').setup({
vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' }) vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' })
vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' }) vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
vim.keymap.set('n', '<leader>ts', ':Telescope themes<CR>', { noremap = true, silent = true, desc = '[T]heme [S]witcher' })
-- Slightly advanced example of overriding default behavior and theme -- Slightly advanced example of overriding default behavior and theme
vim.keymap.set('n', '<leader>/', function() vim.keymap.set('n', '<leader>/', function()
@ -933,8 +847,6 @@ require('lazy').setup({
{ name = 'nvim_lsp_signature_help' }, { name = 'nvim_lsp_signature_help' },
}, },
} }
local cmp_autopairs = require 'nvim-autopairs.completion.cmp'
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done())
end, end,
}, },
@ -956,7 +868,7 @@ require('lazy').setup({
-- Load the colorscheme here. -- Load the colorscheme here.
-- Like many other themes, this one has different styles, and you could load -- Like many other themes, this one has different styles, and you could load
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
vim.cmd.colorscheme 'tokyonight-night' -- vim.cmd.colorscheme 'tokyonight-moon'
end, end,
}, },
@ -1000,40 +912,6 @@ require('lazy').setup({
-- Check out: https://github.com/echasnovski/mini.nvim -- Check out: https://github.com/echasnovski/mini.nvim
end, 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 { -- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate', build = ':TSUpdate',
@ -1060,27 +938,20 @@ require('lazy').setup({
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects -- - 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 -- 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. require 'kickstart.plugins.debug',
-- 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.indent_line',
-- require 'kickstart.plugins.lint', require 'kickstart.plugins.lint',
-- require 'kickstart.plugins.autopairs', require 'kickstart.plugins.autopairs',
-- require 'kickstart.plugins.neo-tree', require 'kickstart.plugins.neo-tree',
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps 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` -- 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. -- 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. -- 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` -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
-- Or use telescope! -- Or use telescope!
@ -1108,4 +979,5 @@ require('lazy').setup({
}, },
}) })
require 'colorscheme'
-- The line beneath this is called `modeline`. See `:help modeline` -- The line beneath this is called `modeline`. See `:help modeline`

View File

@ -6,18 +6,27 @@
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"conform.nvim": { "branch": "master", "commit": "f9ef25a7ef00267b7d13bfc00b0dea22d78702d5" }, "conform.nvim": { "branch": "master", "commit": "f9ef25a7ef00267b7d13bfc00b0dea22d78702d5" },
"fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" },
"github-nvim-theme": { "branch": "main", "commit": "c106c9472154d6b2c74b74565616b877ae8ed31d" },
"gitsigns.nvim": { "branch": "main", "commit": "7010000889bfb6c26065e0b0f7f1e6aa9163edd9" }, "gitsigns.nvim": { "branch": "main", "commit": "7010000889bfb6c26065e0b0f7f1e6aa9163edd9" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
"mason-nvim-dap.nvim": { "branch": "main", "commit": "4c2cdc69d69fe00c15ae8648f7e954d99e5de3ea" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "98767d37f8e5255a5111fc1e3163232d4dc07bda" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "98767d37f8e5255a5111fc1e3163232d4dc07bda" },
"mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" },
"mdx.nvim": { "branch": "main", "commit": "464a74be368dce212cff02f6305845dc7f209ab3" }, "mdx.nvim": { "branch": "main", "commit": "464a74be368dce212cff02f6305845dc7f209ab3" },
"mini.nvim": { "branch": "main", "commit": "3ad46cdb7a51281e0024416023b56cf5c7909ae7" }, "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-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" },
"nvim-cmp": { "branch": "main", "commit": "1e1900b0769324a9675ef85b38f99cca29e203b3" }, "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-highlight-colors": { "branch": "main", "commit": "982543ec460199de5bdc491745dc9faa6bcc19b6" },
"nvim-lint": { "branch": "master", "commit": "9dfb77ef6c5092a19502883c02dc5a02ec648729" },
"nvim-lspconfig": { "branch": "master", "commit": "200280dab91a7df2ca42fd2ab3cb4c5fab056666" }, "nvim-lspconfig": { "branch": "master", "commit": "200280dab91a7df2ca42fd2ab3cb4c5fab056666" },
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
"nvim-tree.lua": { "branch": "master", "commit": "6709463b2d18e77f7a946027917aa00d4aaed6f4" }, "nvim-tree.lua": { "branch": "master", "commit": "6709463b2d18e77f7a946027917aa00d4aaed6f4" },
"nvim-treesitter": { "branch": "master", "commit": "e329e94a6a0a5ccf6ec8bfec1d10faf5eaae665f" }, "nvim-treesitter": { "branch": "master", "commit": "e329e94a6a0a5ccf6ec8bfec1d10faf5eaae665f" },
"nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" },
@ -25,10 +34,12 @@
"nvterm": { "branch": "main", "commit": "9d7ba3b6e368243175d38e1ec956e0476fd86ed9" }, "nvterm": { "branch": "main", "commit": "9d7ba3b6e368243175d38e1ec956e0476fd86ed9" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
"telescope-themes": { "branch": "main", "commit": "9b7c368b83b82b53c0a6e9e977f8329e5f1fe269" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
"tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" },
"vague.nvim": { "branch": "main", "commit": "9f1ae62d2522f75f3cc857a23a4b87125edce1ad" },
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
} }

1
lua/colorscheme.lua Normal file
View File

@ -0,0 +1 @@
vim.cmd("colorscheme vague")

View File

@ -0,0 +1,4 @@
return {
'projekt0n/github-nvim-theme',
config = function() end,
}

View File

@ -0,0 +1,10 @@
return {
'NvChad/nvterm',
config = function()
require('nvterm').setup()
vim.keymap.set('n', '<leader>tt', function()
require('nvterm.terminal').toggle 'horizontal'
end, { desc = '[T]oggle [T]erminal' })
end,
}

View File

@ -0,0 +1,5 @@
return {
'windwp/nvim-ts-autotag',
lazy = false,
config = true,
}

View File

@ -2,4 +2,7 @@
-- I promise not to create any merge conflicts in this directory :) -- I promise not to create any merge conflicts in this directory :)
-- --
-- See the kickstart.nvim README for more information -- See the kickstart.nvim README for more information
return {} return {
'vague2k/vague.nvim',
config = function() end,
}

View File

@ -11,7 +11,8 @@ return {
}, },
cmd = 'Neotree', cmd = 'Neotree',
keys = { keys = {
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true }, { '\\', ':Neotree toggle<CR>', desc = 'NeoTree reveal', silent = true },
{ '<C-n>', ':Neotree toggle<CR>', silent = true, noremap = true },
}, },
opts = { opts = {
filesystem = { filesystem = {