-- === === === === === === === === Neovim Config === === === === === === === === -- -- A configuration for Neovim that aims to be beautiful, intuitive, and -- pragmatic about plugin usage, while providing a developer experience on par -- with professional IDEs. It is tuned for usage with a custom keyboard -- layout and terminal configuration, and may not be as useful in other setups. -- -- This configuration leverages a combination of keymaps and omnibars to give -- quick access to a large amount of functionality in an intuitive way. Most -- keymaps are unchanged from stock Neovim, with the notable exception of -- remapping most `s` keymaps. -- -- === === === === === === === === === === === === === === === === === === === -- -- Core Options -- -- === === === === === === === === === === === === === === === === === === === -- Incantation to render correctly in Alacritty/tmux/macOS vim.cmd([[ let &t_8f = "\[38;2;%lu;%lu;%lum" let &t_8b = "\[48;2;%lu;%lu;%lum" set termguicolors ]]) -- File options vim.opt.wrap = false vim.opt.encoding = "UTF-8" vim.opt.hlsearch = true vim.opt.spell = true vim.opt.spelllang = "en_us" -- Display options vim.opt.pumheight = 15 vim.opt.laststatus = 2 vim.opt.showtabline = 2 vim.opt.showcmd = true vim.opt.cmdheight = 0 vim.opt.number = true vim.opt.relativenumber = true vim.opt.splitbelow = true vim.opt.splitright = true vim.opt.expandtab = true vim.opt.tabstop = 4 vim.opt.shiftwidth = 4 -- === === === === === === === === === === === === === === === === === === === -- -- Lazy.nvim Configuration -- -- `lazy.nvim` is a modern plugin manager for Neovim. -- -- === === === === === === === === === === === === === === === === === === === -- Bootstrapping `lazy`, as directed by GitHub docs: -- https://github.com/folke/lazy.nvim#-installation 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", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) end vim.opt.rtp:prepend(lazypath) -- Add custom plugins to the runtimepath via lazy. local custom_runtime_path_root = vim.fn.stdpath("config") .. "/custom" local custom_runtime_paths = {} for _, filename in pairs(vim.split(vim.fn.glob(custom_runtime_path_root .. "/*"), "\n")) do table.insert(custom_runtime_paths, filename) end -- Load plugins require("lazy").setup("plugins", { performance = { rtp = { paths = custom_runtime_paths } }, change_detection = { enabled = false }, defaults = { lazy = false } }) -- === === === === === === === === === === === === === === === === === === === -- -- Keymaps -- -- === === === === === === === === === === === === === === === === === === === -- Use `Alt-Arrow` to navigate between panes vim.keymap.set("i", "", "W") vim.keymap.set("i", "", "w") vim.keymap.set("i", "", ":tabnext") vim.keymap.set("i", "", ":tabprevious") vim.keymap.set("n", "", "W") vim.keymap.set("n", "", "w") vim.keymap.set("n", "", ":tabnext") vim.keymap.set("n", "", ":tabprevious") -- Folds toggled by homerow roll vim.keymap.set("n", "sr", ": normal za") -- Buffer actions vim.keymap.set("n", "SV", ":vsp") vim.keymap.set("n", "SQ", ":q") vim.keymap.set("n", "SH", ":noh") -- Yank to system clipboard vim.keymap.set({ "n", 'v' }, "Y", "\"+y") -- Yank file properties to system clipboard local yank_filename = function(full, line) local filename = vim.fn.expand("%") if full then filename = vim.fn.expand("%:p") end if line then filename = filename .. ":" .. vim.api.nvim_win_get_cursor(0)[1] end vim.fn.setreg("+", filename) end vim.keymap.set("n", "Syan", function() yank_filename(true, false) end) vim.keymap.set("n", "Syal", function() yank_filename(true, true) end) vim.keymap.set("n", "Syrn", function() yank_filename(false, false) end) vim.keymap.set("n", "Syrl", function() yank_filename(false, true) end) vim.keymap.set("n", "Syf", function() yank_filename(false, false) end)