Skip to content

Commit 4803eec

Browse files
Initial plugin setup (#1)
This adds a basic layer of plugins. But more language and workflow specific plugins are to follow possibly.
1 parent 3338d39 commit 4803eec

File tree

6 files changed

+109
-16
lines changed

6 files changed

+109
-16
lines changed

init.lua

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ vim.g.mapleader = ' '
9191
vim.g.maplocalleader = ' '
9292

9393
-- Set to true if you have a Nerd Font installed and selected in the terminal
94-
vim.g.have_nerd_font = false
94+
vim.g.have_nerd_font = true
9595

9696
-- [[ Setting options ]]
9797
-- See `:help vim.o`
@@ -102,7 +102,7 @@ vim.g.have_nerd_font = false
102102
vim.o.number = true
103103
-- You can also add relative line numbers, to help with jumping.
104104
-- Experiment for yourself to see if you like it!
105-
-- vim.o.relativenumber = true
105+
vim.o.relativenumber = true
106106

107107
-- Enable mouse mode, can be useful for resizing splits for example!
108108
vim.o.mouse = 'a'
@@ -173,6 +173,9 @@ vim.o.confirm = true
173173
-- See `:help hlsearch`
174174
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
175175

176+
-- Shortcut to open Lazy menu
177+
vim.keymap.set('n', '<leader>l', '<cmd>Lazy<CR>')
178+
176179
-- Diagnostic keymaps
177180
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
178181

@@ -459,6 +462,11 @@ require('lazy').setup({
459462
vim.keymap.set('n', '<leader>sn', function()
460463
builtin.find_files { cwd = vim.fn.stdpath 'config' }
461464
end, { desc = '[S]earch [N]eovim files' })
465+
466+
-- Shortcut to open neo-tree explorer
467+
vim.keymap.set('n', '<leader>e', function()
468+
vim.cmd ':Neotree'
469+
end, { desc = 'Open file explorer' })
462470
end,
463471
},
464472

@@ -977,14 +985,14 @@ require('lazy').setup({
977985
-- require 'kickstart.plugins.indent_line',
978986
-- require 'kickstart.plugins.lint',
979987
-- require 'kickstart.plugins.autopairs',
980-
-- require 'kickstart.plugins.neo-tree',
981-
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
988+
require 'kickstart.plugins.neo-tree',
989+
require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
982990

983991
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
984992
-- This is the easiest way to modularize your config.
985993
--
986994
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
987-
-- { import = 'custom.plugins' },
995+
{ import = 'custom.plugins' },
988996
--
989997
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
990998
-- Or use telescope!

lua/custom/plugins/filesystem.lua

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
-- File navigation using neo-tree
2+
return {
3+
'nvim-neo-tree/neo-tree.nvim',
4+
branch = 'v3.x',
5+
dependencies = {
6+
'nvim-lua/plenary.nvim',
7+
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
8+
'MunifTanjim/nui.nvim',
9+
-- {"3rd/image.nvim", opts = {}}, -- Optional image support in preview window: See `# Preview Mode` for more information
10+
},
11+
lazy = false, -- neo-tree will lazily load itself
12+
---@module "neo-tree"
13+
---@type neotree.Config?
14+
config = function()
15+
require('neo-tree').setup {
16+
event_handlers = {
17+
{
18+
event = 'file_open_requested',
19+
handler = function()
20+
-- auto close
21+
vim.cmd 'Neotree close'
22+
end,
23+
},
24+
},
25+
}
26+
end,
27+
opts = {
28+
-- fill any relevant options here
29+
},
30+
}

lua/custom/plugins/git.lua

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
-- lazygit integration into nvim
2+
return {
3+
'kdheepak/lazygit.nvim',
4+
lazy = true,
5+
cmd = {
6+
'LazyGit',
7+
'LazyGitConfig',
8+
'LazyGitCurrentFile',
9+
'LazyGitFilter',
10+
'LazyGitFilterCurrentFile',
11+
},
12+
-- optional for floating window border decoration
13+
dependencies = {
14+
'nvim-lua/plenary.nvim',
15+
},
16+
-- setting the keybinding for LazyGit with 'keys' is recommended in
17+
-- order to load the plugin when the command is run for the first time
18+
keys = {
19+
{ '<leader>gg', '<cmd>LazyGit<cr>', desc = 'LazyGit' },
20+
},
21+
}

lua/custom/plugins/markdown.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
return {
2+
'MeanderingProgrammer/render-markdown.nvim',
3+
dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' }, -- if you use the mini.nvim suite
4+
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins
5+
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons
6+
---@module 'render-markdown'
7+
---@type render.md.UserConfig
8+
opts = {},
9+
}

lua/custom/plugins/misc.lua

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
return {
2+
{
3+
'goolord/alpha-nvim',
4+
config = function()
5+
local dashboard = require 'alpha.themes.dashboard'
6+
local title = {
7+
'███╗░░░███╗░█████╗░███████╗░█████╗░██╗░░░██╗░░░███╗░░██╗██╗░░░██╗██╗███╗░░░███╗',
8+
'████╗░████║██╔══██╗╚════██║██╔══██╗██║░░░██║░░░████╗░██║██║░░░██║██║████╗░████║',
9+
'██╔████╔██║███████║░░███╔═╝██║░░██║╚██╗░██╔╝░░░██╔██╗██║╚██╗░██╔╝██║██╔████╔██║',
10+
'██║╚██╔╝██║██╔══██║██╔══╝░░██║░░██║░╚████╔╝░░░░██║╚████║░╚████╔╝░██║██║╚██╔╝██║',
11+
'██║░╚═╝░██║██║░░██║███████╗╚█████╔╝░░╚██╔╝░░██╗██║░╚███║░░╚██╔╝░░██║██║░╚═╝░██║',
12+
'╚═╝░░░░░╚═╝╚═╝░░╚═╝╚══════╝░╚════╝░░░░╚═╝░░░╚═╝╚═╝░░╚══╝░░░╚═╝░░░╚═╝╚═╝░░░░░╚═╝',
13+
}
14+
dashboard.section.header.val = title
15+
require('alpha').setup(dashboard.opts)
16+
end,
17+
},
18+
{
19+
'echansnovski/mini.nvim',
20+
version = false,
21+
},
22+
{
23+
'tpope/vim-repeat',
24+
},
25+
}

lua/kickstart/plugins/gitsigns.lua

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,22 @@ return {
3434

3535
-- Actions
3636
-- visual mode
37-
map('v', '<leader>hs', function()
37+
map('v', '<leader>gs', function()
3838
gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' }
3939
end, { desc = 'git [s]tage hunk' })
40-
map('v', '<leader>hr', function()
40+
map('v', '<leader>gr', function()
4141
gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' }
4242
end, { desc = 'git [r]eset hunk' })
4343
-- normal mode
44-
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
45-
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
46-
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
47-
map('n', '<leader>hu', gitsigns.stage_hunk, { desc = 'git [u]ndo stage hunk' })
48-
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
49-
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
50-
map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
51-
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
52-
map('n', '<leader>hD', function()
44+
map('n', '<leader>gs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
45+
map('n', '<leader>gr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
46+
map('n', '<leader>gS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
47+
map('n', '<leader>gu', gitsigns.stage_hunk, { desc = 'git [u]ndo stage hunk' })
48+
map('n', '<leader>gR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
49+
map('n', '<leader>gp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
50+
map('n', '<leader>gb', gitsigns.blame_line, { desc = 'git [b]lame line' })
51+
map('n', '<leader>gd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
52+
map('n', '<leader>gD', function()
5353
gitsigns.diffthis '@'
5454
end, { desc = 'git [D]iff against last commit' })
5555
-- Toggles

0 commit comments

Comments
 (0)