Initial plugin setup (#1)

This adds a basic layer of plugins. But more language and workflow specific plugins are to follow possibly.
This commit is contained in:
Aditya Ravichandran 2025-03-30 19:23:37 +05:30
parent 3338d39206
commit 4803eec76b
6 changed files with 109 additions and 16 deletions

View File

@ -91,7 +91,7 @@ vim.g.mapleader = ' '
vim.g.maplocalleader = ' ' vim.g.maplocalleader = ' '
-- Set to true if you have a Nerd Font installed and selected in the terminal -- 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 ]] -- [[ Setting options ]]
-- See `:help vim.o` -- See `:help vim.o`
@ -102,7 +102,7 @@ vim.g.have_nerd_font = false
vim.o.number = true vim.o.number = true
-- You can also add relative line numbers, to help with jumping. -- You can also add relative line numbers, to help with jumping.
-- Experiment for yourself to see if you like it! -- Experiment for yourself to see if you like it!
-- vim.o.relativenumber = true vim.o.relativenumber = true
-- Enable mouse mode, can be useful for resizing splits for example! -- Enable mouse mode, can be useful for resizing splits for example!
vim.o.mouse = 'a' vim.o.mouse = 'a'
@ -173,6 +173,9 @@ vim.o.confirm = true
-- See `:help hlsearch` -- See `:help hlsearch`
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>') vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
-- Shortcut to open Lazy menu
vim.keymap.set('n', '<leader>l', '<cmd>Lazy<CR>')
-- Diagnostic keymaps -- Diagnostic keymaps
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
@ -459,6 +462,11 @@ require('lazy').setup({
vim.keymap.set('n', '<leader>sn', function() vim.keymap.set('n', '<leader>sn', function()
builtin.find_files { cwd = vim.fn.stdpath 'config' } builtin.find_files { cwd = vim.fn.stdpath 'config' }
end, { desc = '[S]earch [N]eovim files' }) end, { desc = '[S]earch [N]eovim files' })
-- Shortcut to open neo-tree explorer
vim.keymap.set('n', '<leader>e', function()
vim.cmd ':Neotree'
end, { desc = 'Open file explorer' })
end, end,
}, },
@ -977,14 +985,14 @@ require('lazy').setup({
-- 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!

View File

@ -0,0 +1,30 @@
-- File navigation using neo-tree
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", opts = {}}, -- Optional image support in preview window: See `# Preview Mode` for more information
},
lazy = false, -- neo-tree will lazily load itself
---@module "neo-tree"
---@type neotree.Config?
config = function()
require('neo-tree').setup {
event_handlers = {
{
event = 'file_open_requested',
handler = function()
-- auto close
vim.cmd 'Neotree close'
end,
},
},
}
end,
opts = {
-- fill any relevant options here
},
}

View File

@ -0,0 +1,21 @@
-- lazygit integration into nvim
return {
'kdheepak/lazygit.nvim',
lazy = true,
cmd = {
'LazyGit',
'LazyGitConfig',
'LazyGitCurrentFile',
'LazyGitFilter',
'LazyGitFilterCurrentFile',
},
-- optional for floating window border decoration
dependencies = {
'nvim-lua/plenary.nvim',
},
-- setting the keybinding for LazyGit with 'keys' is recommended in
-- order to load the plugin when the command is run for the first time
keys = {
{ '<leader>gg', '<cmd>LazyGit<cr>', desc = 'LazyGit' },
},
}

View File

@ -0,0 +1,9 @@
return {
'MeanderingProgrammer/render-markdown.nvim',
dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' }, -- if you use the mini.nvim suite
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons
---@module 'render-markdown'
---@type render.md.UserConfig
opts = {},
}

View File

@ -0,0 +1,25 @@
return {
{
'goolord/alpha-nvim',
config = function()
local dashboard = require 'alpha.themes.dashboard'
local title = {
'███╗░░░███╗░█████╗░███████╗░█████╗░██╗░░░██╗░░░███╗░░██╗██╗░░░██╗██╗███╗░░░███╗',
'████╗░████║██╔══██╗╚════██║██╔══██╗██║░░░██║░░░████╗░██║██║░░░██║██║████╗░████║',
'██╔████╔██║███████║░░███╔═╝██║░░██║╚██╗░██╔╝░░░██╔██╗██║╚██╗░██╔╝██║██╔████╔██║',
'██║╚██╔╝██║██╔══██║██╔══╝░░██║░░██║░╚████╔╝░░░░██║╚████║░╚████╔╝░██║██║╚██╔╝██║',
'██║░╚═╝░██║██║░░██║███████╗╚█████╔╝░░╚██╔╝░░██╗██║░╚███║░░╚██╔╝░░██║██║░╚═╝░██║',
'╚═╝░░░░░╚═╝╚═╝░░╚═╝╚══════╝░╚════╝░░░░╚═╝░░░╚═╝╚═╝░░╚══╝░░░╚═╝░░░╚═╝╚═╝░░░░░╚═╝',
}
dashboard.section.header.val = title
require('alpha').setup(dashboard.opts)
end,
},
{
'echansnovski/mini.nvim',
version = false,
},
{
'tpope/vim-repeat',
},
}

View File

@ -34,22 +34,22 @@ return {
-- Actions -- Actions
-- visual mode -- visual mode
map('v', '<leader>hs', function() map('v', '<leader>gs', function()
gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' }
end, { desc = 'git [s]tage hunk' }) end, { desc = 'git [s]tage hunk' })
map('v', '<leader>hr', function() map('v', '<leader>gr', function()
gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' }
end, { desc = 'git [r]eset hunk' }) end, { desc = 'git [r]eset hunk' })
-- normal mode -- normal mode
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' }) map('n', '<leader>gs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' }) map('n', '<leader>gr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' }) map('n', '<leader>gS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
map('n', '<leader>hu', gitsigns.stage_hunk, { desc = 'git [u]ndo stage hunk' }) map('n', '<leader>gu', gitsigns.stage_hunk, { desc = 'git [u]ndo stage hunk' })
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' }) map('n', '<leader>gR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' }) map('n', '<leader>gp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' }) map('n', '<leader>gb', gitsigns.blame_line, { desc = 'git [b]lame line' })
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' }) map('n', '<leader>gd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
map('n', '<leader>hD', function() map('n', '<leader>gD', function()
gitsigns.diffthis '@' gitsigns.diffthis '@'
end, { desc = 'git [D]iff against last commit' }) end, { desc = 'git [D]iff against last commit' })
-- Toggles -- Toggles