Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ vim.g.mapleader = ' '
vim.g.maplocalleader = ' '

-- 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 ]]
-- See `:help vim.o`
Expand All @@ -102,7 +102,7 @@ vim.g.have_nerd_font = false
vim.o.number = true
-- You can also add relative line numbers, to help with jumping.
-- 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!
vim.o.mouse = 'a'
Expand Down Expand Up @@ -173,6 +173,9 @@ vim.o.confirm = true
-- See `:help hlsearch`
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')

-- Shortcut to open Lazy menu
vim.keymap.set('n', '<leader>l', '<cmd>Lazy<CR>')

-- Diagnostic keymaps
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })

Expand Down Expand Up @@ -459,6 +462,11 @@ require('lazy').setup({
vim.keymap.set('n', '<leader>sn', function()
builtin.find_files { cwd = vim.fn.stdpath 'config' }
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,
},

Expand Down Expand Up @@ -977,14 +985,14 @@ require('lazy').setup({
-- 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.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!
Expand Down
30 changes: 30 additions & 0 deletions lua/custom/plugins/filesystem.lua
Original file line number Diff line number Diff line change
@@ -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
},
}
21 changes: 21 additions & 0 deletions lua/custom/plugins/git.lua
Original file line number Diff line number Diff line change
@@ -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' },
},
}
9 changes: 9 additions & 0 deletions lua/custom/plugins/markdown.lua
Original file line number Diff line number Diff line change
@@ -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 = {},
}
25 changes: 25 additions & 0 deletions lua/custom/plugins/misc.lua
Original file line number Diff line number Diff line change
@@ -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',
},
}
22 changes: 11 additions & 11 deletions lua/kickstart/plugins/gitsigns.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ return {

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