diff --git a/home/private_dot_config/nvim/init.lua b/home/private_dot_config/nvim/init.lua index 3832d77..61fe2f6 100644 --- a/home/private_dot_config/nvim/init.lua +++ b/home/private_dot_config/nvim/init.lua @@ -1 +1,5 @@ require("settings") +require("keymaps") + +-- Plugins +require("lazy-nvim") diff --git a/home/private_dot_config/nvim/lua/keymaps.lua b/home/private_dot_config/nvim/lua/keymaps.lua new file mode 100644 index 0000000..70a5411 --- /dev/null +++ b/home/private_dot_config/nvim/lua/keymaps.lua @@ -0,0 +1,37 @@ +-- Map the leader to space +vim.g.mapleader = " " + +-- Remove search highlight with Esc +vim.keymap.set("n", "", ":noh") + +-- Center the screen whenever I move by a large amount +-- +-- Inspired by ThePrimeagen dotfiles +-- https://github.com/ThePrimeagen/init.lua/blob/e148c2cd/lua/theprimeagen/remap.lua#L9 +vim.keymap.set("n", "", "zz") +vim.keymap.set("n", "", "zz") +vim.keymap.set("n", "n", "nzz") +vim.keymap.set("n", "N", "Nzz") +vim.keymap.set("n", "}", "}zz") +vim.keymap.set("n", "{", "{zz") +vim.keymap.set("n", "%", "%zz") + +-- Navigate splits +vim.keymap.set("n", "", "h", { desc = "Go to the left buffer" }) +vim.keymap.set("n", "", "j", { desc = "Go to the bottom buffer" }) +vim.keymap.set("n", "", "k", { desc = "Go to the top buffer" }) +vim.keymap.set("n", "", "l", { desc = "Go to the right buffer" }) +vim.keymap.set("n", "", "H", { desc = "Move the buffer to the left" }) +vim.keymap.set("n", "", "J", { desc = "Move the buffer to the bottom" }) +vim.keymap.set("n", "", "K", { desc = "Move the buffer to the top" }) +vim.keymap.set("n", "", "L", { desc = "Move the buffer to the right" }) + +-- Move the selection up and down +-- https://github.com/ThePrimeagen/init.lua/blob/e148c2cd/lua/theprimeagen/remap.lua#L5 +vim.keymap.set("v", "J", [[:m ">+1gv=gv]]) +vim.keymap.set("v", "K", [[:m "<-2gv=gv]]) + +-- Don"t move the cursor when I do a `J` +-- https://github.com/ThePrimeagen/init.lua/blob/e148c2cd/lua/theprimeagen/remap.lua#L8 +vim.keymap.set("n", "J", "mzJ`z") + diff --git a/home/private_dot_config/nvim/lua/lazy-nvim.lua b/home/private_dot_config/nvim/lua/lazy-nvim.lua new file mode 100644 index 0000000..4d706da --- /dev/null +++ b/home/private_dot_config/nvim/lua/lazy-nvim.lua @@ -0,0 +1,25 @@ +-- Install lazy.nvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "--branch=stable", + "https://github.com/folke/lazy.nvim.git", + lazypath, + }) +end + +vim.opt.rtp:prepend(lazypath) + +require("lazy").setup({ + -- Import the plugins from the "plugins/" directory + spec = { import = "plugins" }, + + -- Don't notify every time a plugin file changes + change_detection = { notify = false }, + + -- Check for plugins update + checker = { enabled = true }, +}) diff --git a/home/private_dot_config/nvim/lua/plugins/ui.lua b/home/private_dot_config/nvim/lua/plugins/ui.lua new file mode 100644 index 0000000..0f7f2dc --- /dev/null +++ b/home/private_dot_config/nvim/lua/plugins/ui.lua @@ -0,0 +1,12 @@ +return { + -- Color scheme + { + 'catppuccin/nvim', + lazy = false, + priority = 1000, + name = 'catppuccin', + config = function() + vim.cmd.colorscheme('catppuccin-mocha') + end, + }, +}