From b66e4efa7caae614335c694275133ef42384a98a Mon Sep 17 00:00:00 2001 From: Nicholas Moore Date: Tue, 13 May 2025 16:59:19 -0500 Subject: Refactor neovim config into multiple files --- alacritty/alacritty.toml | 16 +++++ hypr/conf/monitor.conf | 2 +- nvim/init.lua | 114 +++----------------------------- nvim/lazy-lock.json | 26 ++++---- nvim/lua/custom/plugins/filetypes.lua | 15 +++++ nvim/lua/custom/plugins/harppon.lua | 37 +++++++++++ nvim/lua/custom/plugins/remap.lua | 5 ++ nvim/lua/custom/plugins/toggleterm.lua | 21 ++++++ nvim/lua/custom/plugins/vim-be-good.lua | 5 ++ nvim/lua/custom/plugins/vim-sleuth.lua | 3 + nvim/lua/custom/plugins/which-key.lua | 3 + waybar/modules.jsonc | 4 +- waybar/style.css | 2 +- 13 files changed, 131 insertions(+), 122 deletions(-) create mode 100644 alacritty/alacritty.toml create mode 100644 nvim/lua/custom/plugins/filetypes.lua create mode 100644 nvim/lua/custom/plugins/harppon.lua create mode 100644 nvim/lua/custom/plugins/remap.lua create mode 100644 nvim/lua/custom/plugins/toggleterm.lua create mode 100644 nvim/lua/custom/plugins/vim-be-good.lua create mode 100644 nvim/lua/custom/plugins/vim-sleuth.lua create mode 100644 nvim/lua/custom/plugins/which-key.lua diff --git a/alacritty/alacritty.toml b/alacritty/alacritty.toml new file mode 100644 index 0000000..4b13d76 --- /dev/null +++ b/alacritty/alacritty.toml @@ -0,0 +1,16 @@ +[font] +size = 16 + +[font.normal] +family = "Hack Nerd Font Mono" +style = "Regular" + +[window] +opacity = 0.8 + +[window.padding] +x = 5 +y = 5 + +[selection] +save_to_clipboard = true diff --git a/hypr/conf/monitor.conf b/hypr/conf/monitor.conf index 8bb498e..f0bb326 100644 --- a/hypr/conf/monitor.conf +++ b/hypr/conf/monitor.conf @@ -1,3 +1,3 @@ # See https://wiki.hyprland.org/Configuring/Monitors/ -monitor=eDP-1,2880x1920@60,auto,2 +monitor=eDP-1,2880x1920@60,auto,1 monitor=DP-1,3440x1440@60,auto,1 diff --git a/nvim/init.lua b/nvim/init.lua index eb9e9f5..b3dbdb7 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -1,87 +1,5 @@ --[[ - -===================================================================== -==================== READ THIS BEFORE CONTINUING ==================== -===================================================================== -======== .-----. ======== -======== .----------------------. | === | ======== -======== |.-""""""""""""""""""-.| |-----| ======== -======== || || | === | ======== -======== || KICKSTART.NVIM || |-----| ======== -======== || || | === | ======== -======== || || |-----| ======== -======== ||:Tutor || |:::::| ======== -======== |'-..................-'| |____o| ======== -======== `"")----------------(""` ___________ ======== -======== /::::::::::| |::::::::::\ \ no mouse \ ======== -======== /:::========| |==hjkl==:::\ \ required \ ======== -======== '""""""""""""' '""""""""""""' '""""""""""' ======== -======== ======== -===================================================================== -===================================================================== - -What is Kickstart? - - Kickstart.nvim is *not* a distribution. - - Kickstart.nvim is a starting point for your own configuration. - The goal is that you can read every line of code, top-to-bottom, understand - what your configuration is doing, and modify it to suit your needs. - - Once you've done that, you can start exploring, configuring and tinkering to - make Neovim your own! That might mean leaving Kickstart just the way it is for a while - or immediately breaking it into modular pieces. It's up to you! - - If you don't know anything about Lua, I recommend taking some time to read through - a guide. One possible example which will only take 10-15 minutes: - - https://learnxinyminutes.com/docs/lua/ - - After understanding a bit more about Lua, you can use `:help lua-guide` as a - reference for how Neovim integrates Lua. - - :help lua-guide - - (or HTML version): https://neovim.io/doc/user/lua-guide.html - -Kickstart Guide: - - TODO: The very first thing you should do is to run the command `:Tutor` in Neovim. - - If you don't know what this means, type the following: - - - - : - - Tutor - - - - (If you already know the Neovim basics, you can skip this step.) - - Once you've completed that, you can continue working through **AND READING** the rest - of the kickstart init.lua. - - Next, run AND READ `:help`. - This will open up a help window with some basic information - about reading, navigating and searching the builtin help documentation. - - This should be the first place you go to look when you're stuck or confused - with something. It's one of my favorite Neovim features. - - MOST IMPORTANTLY, we provide a keymap "sh" to [s]earch the [h]elp documentation, - which is very useful when you're not exactly sure of what you're looking for. - - I have left several `:help X` comments throughout the init.lua - These are hints about where to find more information about the relevant settings, - plugins or Neovim features used in Kickstart. - - NOTE: Look for lines like this - - Throughout the file. These are for you, the reader, to help you understand what is happening. - Feel free to delete them once you know what you're doing, but they should serve as a guide - for when you are first encountering a few different constructs in your Neovim config. - -If you experience any errors while trying to install kickstart, run `:checkhealth` for more info. - -I hope you enjoy your Neovim journey, -- TJ - -P.S. You can delete this when you're done too. It's your config now! :) +-- Setup initial configuration --]] -- Set as the leader key @@ -161,6 +79,9 @@ vim.opt.scrolloff = 10 -- See `:help 'confirm'` vim.opt.confirm = true +-- Set the column width to 80 to match coding conventions +vim.opt.colorcolumn = '80' + -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` @@ -194,12 +115,6 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the right win vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) --- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes --- vim.keymap.set("n", "", "H", { desc = "Move window to the left" }) --- vim.keymap.set("n", "", "L", { desc = "Move window to the right" }) --- vim.keymap.set("n", "", "J", { desc = "Move window to the lower" }) --- vim.keymap.set("n", "", "K", { desc = "Move window to the upper" }) - -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` @@ -239,8 +154,9 @@ vim.opt.rtp:prepend(lazypath) -- NOTE: Here is where you install your plugins. require('lazy').setup({ -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). - 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically - 'ThePrimeagen/vim-be-good', + -- 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically + -- 'ThePrimeagen/vim-be-good', + -- { 'akinsho/toggleterm.nvim', version = '*', config = true }, -- NOTE: Plugins can also be added by using a table, -- with the first argument being the link and the following -- keys can be used to configure plugin behavior/loading/etc. @@ -989,7 +905,7 @@ require('lazy').setup({ -- 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! @@ -1017,19 +933,5 @@ require('lazy').setup({ }, }) -vim.filetype.add { - extension = { - yml = 'yaml.ansible', - }, -} - -vim.filetype.add { - extension = { - jinja = 'jinja', - jinja2 = 'jinja', - j2 = 'jinja', - }, -} - -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 26a1357..e9fd5da 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,25 +1,27 @@ { - "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, - "blink.cmp": { "branch": "main", "commit": "cb5e346d9e0efa7a3eee7fd4da0b690c48d2a98e" }, + "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, + "blink.cmp": { "branch": "main", "commit": "54cbaac2064fe6198ec55b636b53cc8c9791ead3" }, "catppuccin": { "branch": "main", "commit": "1bf070129c0b6f77cc23f6a2212dcdc868308c52" }, - "conform.nvim": { "branch": "master", "commit": "6632e7d788a85bf8405ea0c812d343fc308b7b8c" }, + "conform.nvim": { "branch": "master", "commit": "2b2b30260203af3b93a7470ac6c8457ddd6e32d9" }, "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, - "gitsigns.nvim": { "branch": "main", "commit": "d600d3922c1d001422689319a8f915136bb64e1e" }, + "gitsigns.nvim": { "branch": "main", "commit": "e399f9748d7cfd8859747c8d6c4e9c8b4d50a1bd" }, + "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, - "mason-tool-installer.nvim": { "branch": "main", "commit": "1255518cb067e038a4755f5cb3e980f79b6ab89c" }, - "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, - "mini.nvim": { "branch": "main", "commit": "a8b1d74f45dadf3554c0eed784c6ccd8ade67883" }, - "nvim-lint": { "branch": "master", "commit": "d698d3b6fd7b1b85657d05a2a31d843ddb682c63" }, - "nvim-lspconfig": { "branch": "master", "commit": "c40a2dca6e4a4f4af262375dcb71692882b6122c" }, - "nvim-treesitter": { "branch": "master", "commit": "684eeac91ed8e297685a97ef70031d19ac1de25a" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "d39a75bbce4b8aad5d627191ea915179c77c100f" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "75d60a8f928decd8b38897f80849768b7c540a5b" }, + "mason.nvim": { "branch": "main", "commit": "7c7318e8bae7e3536ef6b9e86b9e38e74f2e125e" }, + "mini.nvim": { "branch": "main", "commit": "009435c6c3653d54bc62997ca6b2e8513bc52cf4" }, + "nvim-lint": { "branch": "master", "commit": "fdb04e9285edefbe25a02a31a35e8fbb10fe054d" }, + "nvim-lspconfig": { "branch": "master", "commit": "ac1dfbe3b60e5e23a2cff90e3bd6a3bc88031a57" }, + "nvim-treesitter": { "branch": "master", "commit": "066fd6505377e3fd4aa219e61ce94c2b8bdb0b79" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "rose-pine": { "branch": "main", "commit": "491a0c77abc7ecb955c27a974091a5968232995f" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, - "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, + "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, + "toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" }, "vim-be-good": { "branch": "master", "commit": "0ae3de14eb8efc6effe7704b5e46495e91931cc5" }, "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } diff --git a/nvim/lua/custom/plugins/filetypes.lua b/nvim/lua/custom/plugins/filetypes.lua new file mode 100644 index 0000000..73c99f2 --- /dev/null +++ b/nvim/lua/custom/plugins/filetypes.lua @@ -0,0 +1,15 @@ +return { + vim.filetype.add { + extension = { + yml = 'yaml.ansible', + }, + }, + + vim.filetype.add { + extension = { + jinja = 'jinja', + jinja2 = 'jinja', + j2 = 'jinja', + }, + }, +} diff --git a/nvim/lua/custom/plugins/harppon.lua b/nvim/lua/custom/plugins/harppon.lua new file mode 100644 index 0000000..1fc29bb --- /dev/null +++ b/nvim/lua/custom/plugins/harppon.lua @@ -0,0 +1,37 @@ +return { + { + 'ThePrimeagen/harpoon', + branch = 'harpoon2', + dependencies = { 'nvim-lua/plenary.nvim' }, + config = function() + local harpoon = require 'harpoon' + harpoon:setup() + vim.keymap.set('n', 'a', function() + harpoon:list():add() + end) + vim.keymap.set('n', '', function() + harpoon.ui:toggle_quick_menu(harpoon:list()) + end) + vim.keymap.set('n', '1', function() + harpoon:list():select(1) + end) + vim.keymap.set('n', '2', function() + harpoon:list():select(2) + end) + vim.keymap.set('n', '3', function() + harpoon:list():select(3) + end) + vim.keymap.set('n', '4', function() + harpoon:list():select(4) + end) + + -- Toggle previous & next buffers stored within Harpoon list + vim.keymap.set('n', '', function() + harpoon:list():prev() + end) + vim.keymap.set('n', '', function() + harpoon:list():next() + end) + end, + }, +} diff --git a/nvim/lua/custom/plugins/remap.lua b/nvim/lua/custom/plugins/remap.lua new file mode 100644 index 0000000..367d21c --- /dev/null +++ b/nvim/lua/custom/plugins/remap.lua @@ -0,0 +1,5 @@ +return { + -- Scroll by half page and keep cursor in middle + vim.keymap.set('n', '', 'zz'), + vim.keymap.set('n', '', 'zz'), +} diff --git a/nvim/lua/custom/plugins/toggleterm.lua b/nvim/lua/custom/plugins/toggleterm.lua new file mode 100644 index 0000000..cc40f75 --- /dev/null +++ b/nvim/lua/custom/plugins/toggleterm.lua @@ -0,0 +1,21 @@ +return { + { + 'akinsho/toggleterm.nvim', + version = '*', + opts = { + start_in_insert = false, + persistent_mode = true, + shell = vim.o.shell, + auto_scroll = true, + + -- Float options + float_opts = { + border = 'single', + title_pos = 'center', + }, + + -- Bindings + vim.keymap.set('n', '`', ':ToggleTerm direction=float', { desc = 'Open a floating terminal' }), + }, + }, +} diff --git a/nvim/lua/custom/plugins/vim-be-good.lua b/nvim/lua/custom/plugins/vim-be-good.lua new file mode 100644 index 0000000..7e5c709 --- /dev/null +++ b/nvim/lua/custom/plugins/vim-be-good.lua @@ -0,0 +1,5 @@ +return { + { + 'ThePrimeagen/vim-be-good', + }, +} diff --git a/nvim/lua/custom/plugins/vim-sleuth.lua b/nvim/lua/custom/plugins/vim-sleuth.lua new file mode 100644 index 0000000..123ac6a --- /dev/null +++ b/nvim/lua/custom/plugins/vim-sleuth.lua @@ -0,0 +1,3 @@ +return { + { 'tpope/vim-sleuth' }, -- Detect tabstop and shiftwidth automatically +} diff --git a/nvim/lua/custom/plugins/which-key.lua b/nvim/lua/custom/plugins/which-key.lua new file mode 100644 index 0000000..1f73adc --- /dev/null +++ b/nvim/lua/custom/plugins/which-key.lua @@ -0,0 +1,3 @@ +return { + -- { 'folke/which-key.nvim' }, +} diff --git a/waybar/modules.jsonc b/waybar/modules.jsonc index 4a655a2..c775bd7 100644 --- a/waybar/modules.jsonc +++ b/waybar/modules.jsonc @@ -26,8 +26,8 @@ } }, "tray": { - "icon-size": 21, - "spacing": 10 + "icon-size": 42, + "spacing": 30 }, "custom/music": { "format": " {}", diff --git a/waybar/style.css b/waybar/style.css index 6041450..a1c4596 100644 --- a/waybar/style.css +++ b/waybar/style.css @@ -1,6 +1,6 @@ * { font-family: JetbrainsMono Nerd Font; - font-size: 10px; + font-size: 18px; min-height: 0; padding-right: 2px; padding-left: 2px; -- cgit v1.3