Skip to content

Commit cea7aa1

Browse files
committed
Custom neovim setup.
1 parent e2bfa0c commit cea7aa1

File tree

1 file changed

+140
-4
lines changed

1 file changed

+140
-4
lines changed

init.lua

Lines changed: 140 additions & 4 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
94-
vim.g.have_nerd_font = false
94+
vim.g.have_nerd_font = true
9595

9696
-- [[ Setting options ]]
9797
-- See `:help vim.opt`
@@ -102,7 +102,7 @@ vim.g.have_nerd_font = false
102102
vim.opt.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.opt.relativenumber = true
105+
vim.opt.relativenumber = true
106106

107107
-- Enable mouse mode, can be useful for resizing splits for example!
108108
vim.opt.mouse = 'a'
@@ -190,6 +190,10 @@ vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right win
190190
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
191191
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
192192

193+
-- Center cursor after moving half page
194+
vim.keymap.set('n', '<C-d>', '<C-d>zz', { desc = 'Center cursor after down half page' })
195+
vim.keymap.set('n', '<C-u>', '<C-u>zz', { desc = 'Center cursor after down half up' })
196+
193197
-- [[ Basic Autocommands ]]
194198
-- See `:help lua-guide-autocommands`
195199

@@ -283,6 +287,8 @@ require('lazy').setup({
283287
require('which-key').register {
284288
['<leader>c'] = { name = '[C]ode', _ = 'which_key_ignore' },
285289
['<leader>d'] = { name = '[D]ocument', _ = 'which_key_ignore' },
290+
['<leader>h'] = { name = '[H]arpoon', _ = 'which_key_ignore' },
291+
['<leader>l'] = { name = '[L]azy Git', _ = 'which_key_ignore' },
286292
['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' },
287293
['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' },
288294
['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' },
@@ -402,6 +408,71 @@ require('lazy').setup({
402408
end,
403409
},
404410

411+
{
412+
'ThePrimeagen/harpoon',
413+
branch = 'harpoon2',
414+
dependencies = { 'nvim-lua/plenary.nvim' },
415+
config = function()
416+
local harpoon = require 'harpoon'
417+
418+
harpoon:setup()
419+
420+
vim.keymap.set('n', '<leader>ha', function()
421+
harpoon:list():add()
422+
end, { desc = '[A]dd to list' })
423+
vim.keymap.set('n', '<leader>he', function()
424+
harpoon.ui:toggle_quick_menu(harpoon:list())
425+
end, { desc = '[E]xplorer' })
426+
427+
vim.keymap.set('n', '<leader>h1', function()
428+
harpoon:list():select(1)
429+
end, { desc = 'Switch to [1] mark' })
430+
vim.keymap.set('n', '<leader>h2', function()
431+
harpoon:list():select(2)
432+
end, { desc = 'Switch to [2] mark' })
433+
vim.keymap.set('n', '<leader>h3', function()
434+
harpoon:list():select(3)
435+
end, { desc = 'Switch to [3] mark' })
436+
vim.keymap.set('n', '<leader>h4', function()
437+
harpoon:list():select(4)
438+
end, { desc = 'Switch to [4] mark' })
439+
440+
-- vim.keymap.set('n', '<leader><C-1>', function()
441+
-- harpoon:list():replace_at(1)
442+
-- end)
443+
-- vim.keymap.set('n', '<leader><C-2>', function()
444+
-- harpoon:list():replace_at(2)
445+
-- end)
446+
-- vim.keymap.set('n', '<leader><C-3>', function()
447+
-- harpoon:list():replace_at(3)
448+
-- end)
449+
-- vim.keymap.set('n', '<leader><C-4>', function()
450+
-- harpoon:list():replace_at(4)
451+
-- end)
452+
end,
453+
},
454+
455+
{
456+
'zbirenbaum/copilot.lua',
457+
cmd = 'Copilot',
458+
event = 'InsertEnter',
459+
config = function()
460+
require('copilot').setup {
461+
suggestion = {
462+
auto_trigger = true,
463+
keymap = {
464+
accept = '<C-y>',
465+
accept_word = false,
466+
accept_line = false,
467+
next = '<C-]>',
468+
prev = '<C-[>',
469+
dismiss = '<C-x>',
470+
},
471+
},
472+
}
473+
end,
474+
},
475+
405476
{ -- LSP Configuration & Plugins
406477
'neovim/nvim-lspconfig',
407478
dependencies = {
@@ -740,18 +811,52 @@ require('lazy').setup({
740811
end,
741812
},
742813

814+
{ 'tjdevries/colorbuddy.nvim' },
815+
816+
{ 'rose-pine/neovim', name = 'rose-pine' },
817+
818+
{
819+
'folke/tokyonight.nvim',
820+
config = function()
821+
require('tokyonight').setup {
822+
-- your configuration comes here
823+
-- or leave it empty to use the default settings
824+
style = 'storm', -- The theme comes in three styles, `storm`, `moon`, a darker variant `night` and `day`
825+
transparent = true, -- Enable this to disable setting the background color
826+
terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim
827+
styles = {
828+
-- Style to be applied to different syntax groups
829+
-- Value is any valid attr-list value for `:help nvim_set_hl`
830+
comments = { italic = false },
831+
keywords = { italic = false },
832+
-- Background styles. Can be "dark", "transparent" or "normal"
833+
sidebars = 'dark', -- style for sidebars, see below
834+
floats = 'dark', -- style for floating windows
835+
},
836+
}
837+
end,
838+
},
839+
743840
{ -- You can easily change to a different colorscheme.
744841
-- Change the name of the colorscheme plugin below, and then
745842
-- change the command in the config to whatever the name of that colorscheme is.
746843
--
747844
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
748-
'folke/tokyonight.nvim',
845+
'catppuccin/nvim',
846+
name = 'catpuccin',
749847
priority = 1000, -- Make sure to load this before all the other start plugins.
750848
init = function()
849+
-- require('rose-pine').setup {
850+
-- disable_background = true,
851+
-- styles = {
852+
-- italic = false,
853+
-- },
854+
-- }
855+
751856
-- Load the colorscheme here.
752857
-- Like many other themes, this one has different styles, and you could load
753858
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
754-
vim.cmd.colorscheme 'tokyonight-night'
859+
vim.cmd.colorscheme 'catppuccin'
755860

756861
-- You can configure highlights by doing something like:
757862
vim.cmd.hi 'Comment gui=none'
@@ -798,6 +903,7 @@ require('lazy').setup({
798903
-- Check out: https://github.com/echasnovski/mini.nvim
799904
end,
800905
},
906+
801907
{ -- Highlight, edit, and navigate code
802908
'nvim-treesitter/nvim-treesitter',
803909
build = ':TSUpdate',
@@ -829,6 +935,36 @@ require('lazy').setup({
829935
end,
830936
},
831937

938+
{
939+
'max397574/better-escape.nvim',
940+
opts = {
941+
mapping = { 'jk', 'kj' },
942+
timeout = vim.o.timeoutlen,
943+
clear_empty_lines = false,
944+
keys = '<Esc>',
945+
},
946+
},
947+
948+
{
949+
'kdheepak/lazygit.nvim',
950+
cmd = {
951+
'LazyGit',
952+
'LazyGitConfig',
953+
'LazyGitCurrentFile',
954+
'LazyGitFilter',
955+
'LazyGitFilterCurrentFile',
956+
},
957+
-- optional for floating window border decoration
958+
dependencies = {
959+
'nvim-lua/plenary.nvim',
960+
},
961+
-- setting the keybinding for LazyGit with 'keys' is recommended in
962+
-- order to load the plugin when the command is run for the first time
963+
keys = {
964+
{ '<leader>lg', '<cmd>LazyGit<cr>', desc = 'LazyGit' },
965+
},
966+
},
967+
832968
-- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the
833969
-- init.lua. If you want these files, they are in the repository, so you can just download them and
834970
-- place them in the correct locations.

0 commit comments

Comments
 (0)