From 6285067546ee45ed5b0f27f246aa323cb818fbbc Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Tue, 13 Jan 2026 16:09:20 +0000 Subject: Stow nvim --- nvim/.config/nvim/init.lua | 5 ++ nvim/.config/nvim/lazy-lock.json | 4 ++ nvim/.config/nvim/lua/config/colorscheme.lua | 1 + nvim/.config/nvim/lua/config/globals.lua | 7 +++ nvim/.config/nvim/lua/config/keymaps.lua | 54 ++++++++++++++++++++ nvim/.config/nvim/lua/config/lazy.lua | 26 ++++++++++ nvim/.config/nvim/lua/config/options.lua | 76 ++++++++++++++++++++++++++++ nvim/.config/nvim/lua/plugins/nord.lua | 3 ++ 8 files changed, 176 insertions(+) create mode 100644 nvim/.config/nvim/init.lua create mode 100644 nvim/.config/nvim/lazy-lock.json create mode 100644 nvim/.config/nvim/lua/config/colorscheme.lua create mode 100644 nvim/.config/nvim/lua/config/globals.lua create mode 100644 nvim/.config/nvim/lua/config/keymaps.lua create mode 100644 nvim/.config/nvim/lua/config/lazy.lua create mode 100644 nvim/.config/nvim/lua/config/options.lua create mode 100644 nvim/.config/nvim/lua/plugins/nord.lua diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua new file mode 100644 index 0000000..713ec00 --- /dev/null +++ b/nvim/.config/nvim/init.lua @@ -0,0 +1,5 @@ +require('config.globals') +require('config.options') +require("config.lazy") +require('config.keymaps') +require('config.colorscheme') diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..0778057 --- /dev/null +++ b/nvim/.config/nvim/lazy-lock.json @@ -0,0 +1,4 @@ +{ + "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "nord.nvim": { "branch": "master", "commit": "80c1e5321505aeb22b7a9f23eb82f1e193c12470" } +} diff --git a/nvim/.config/nvim/lua/config/colorscheme.lua b/nvim/.config/nvim/lua/config/colorscheme.lua new file mode 100644 index 0000000..0adddf3 --- /dev/null +++ b/nvim/.config/nvim/lua/config/colorscheme.lua @@ -0,0 +1 @@ +vim.cmd[[colorscheme nord]] diff --git a/nvim/.config/nvim/lua/config/globals.lua b/nvim/.config/nvim/lua/config/globals.lua new file mode 100644 index 0000000..8058c12 --- /dev/null +++ b/nvim/.config/nvim/lua/config/globals.lua @@ -0,0 +1,7 @@ +-- https://github.com/radleylewis/nvim-lite/tree/master + +local g = vim.g + +g.mapleader = ' ' -- Set leader key to space. +g.maplocalleader = ' ' +g.have_nerd_font = true -- I have a Nerd Font install and selected in the terminal. diff --git a/nvim/.config/nvim/lua/config/keymaps.lua b/nvim/.config/nvim/lua/config/keymaps.lua new file mode 100644 index 0000000..70e2633 --- /dev/null +++ b/nvim/.config/nvim/lua/config/keymaps.lua @@ -0,0 +1,54 @@ +-- https://github.com/radleylewis/nvim-lite/tree/master + +local set = vim.keymap.set + +-- Move lines up/down +set('n', '', ':m .+1==', { desc = 'Move line down' }) +set('n', '', ':m .-2==', { desc = 'Move line up' }) +set('i', '', ':m .+1==gi', { desc = 'Move line down' }) +set('i', '', ':m .-2==gi', { desc = 'Move line up' }) +set('v', '', ":m '>+1gv=gv", { desc = 'Move selection down' }) +set('v', '', ":m '<-2gv=gv", { desc = 'Move selection up' }) + +-- Better indenting in visual mode +set('v', '<', '', '>gv', { desc = 'Indent right and reselect' }) + +-- Buffer navigation +set('n', 'bn', ':bnext', { desc = 'Next buffer' }) +set('n', 'bp', ':bprevious', { desc = 'Previous buffer' }) + +-- Better window navigation +set('n', '', 'h', { desc = 'Move to left window' }) +set('n', '', 'j', { desc = 'Move to bottom window' }) +set('n', '', 'k', { desc = 'Move to top window' }) +set('n', '', 'l', { desc = 'Move to right window' }) + +-- Splitting & Resizing +set('n', 'sv', ':vsplit', { desc = 'Split window vertically' }) +set('n', 'sh', ':split', { desc = 'Split window horizontally' }) +set('n', 'se', '=', { desc = 'Make split windows equal width & height' }) +set('n', '', ':resize +2', { desc = 'Increase window height' }) +set('n', '', ':resize -2', { desc = 'Decrease window height' }) +set('n', '', ':vertical resize -2', { desc = 'Decrease window width' }) +set('n', '', ':vertical resize +2', { desc = 'Increase window width' }) + +-- Center screen when jumping +set('n', 'n', 'nzzzv', { desc = 'Next search result (centered)' }) +set('n', 'N', 'Nzzzv', { desc = 'Previous search result (centered)' }) +set('n', '', 'zz', { desc = 'Half page down (centered)' }) +set('n', '', 'zz', { desc = 'Half page up (centered)' }) + +-- Better paste behavior +set('x', 'p', '"_dP', { desc = 'Paste without yanking' }) + +-- Delete without yanking +set({ 'n', 'v' }, 'd', '"_d', { desc = 'Delete without yanking' }) + +-- Toggle visible whitespace characters +set('n', 'l', ':set list!', { desc = 'Toggle hidden characters' }) + +-- Quickly source current file / execute Lua code +set('n', 'xx', 'source %', { desc = 'Source current file' }) +set('n', 'x', ':.lua', { desc = 'Lua: execute current line' }) +set('v', 'x', ':lua', { desc = 'Lua: execute current selection' }) diff --git a/nvim/.config/nvim/lua/config/lazy.lua b/nvim/.config/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..4a07a57 --- /dev/null +++ b/nvim/.config/nvim/lua/config/lazy.lua @@ -0,0 +1,26 @@ +-- Bootstrap lazy.nvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end +end +vim.opt.rtp:prepend(lazypath) + +require("lazy").setup({ + spec = { + { import = "plugins" }, + }, + -- colorscheme that will be used when installing plugins. + install = { colorscheme = { "nord" } }, + -- automatically check for plugin updates. + checker = { enabled = true }, +}) diff --git a/nvim/.config/nvim/lua/config/options.lua b/nvim/.config/nvim/lua/config/options.lua new file mode 100644 index 0000000..9d89c35 --- /dev/null +++ b/nvim/.config/nvim/lua/config/options.lua @@ -0,0 +1,76 @@ +-- Configuration based on https://github.com/radleylewis/nvim-lite/tree/master + +local opt = vim.opt + +-- Basic settings +opt.number = true -- Line numbers +opt.relativenumber = true -- Relative line numbers +opt.cursorline = true -- Highlight current line +opt.wrap = false -- Don't wrap lines +opt.scrolloff = 8 -- Keep 8 lines above/below cursor +opt.sidescrolloff = 8 -- Keep 8 columns left/right of cursor + +-- Indentation +opt.tabstop = 2 -- Tab width +opt.shiftwidth = 2 -- Indent width +opt.softtabstop = 2 -- Soft tab stop +opt.expandtab = true -- Use spaces instead of tabs +opt.smartindent = true -- Smart auto-indenting +opt.autoindent = true -- Copy indent from current line + +-- Search settings +opt.ignorecase = true -- Case insensitive search +opt.smartcase = true -- Case sensitive if uppercase in search +opt.hlsearch = false -- Don't highlight search results +opt.incsearch = true -- Show matches as you type + +-- Visual settings +opt.termguicolors = true -- Enable 24-bit colors +opt.signcolumn = 'yes' -- Always show sign column +opt.showmatch = true -- Highlight matching brackets +opt.matchtime = 2 -- How long to show matching bracket +opt.cmdheight = 1 -- Command line height +opt.completeopt = 'menuone,noinsert,noselect' -- Completion options +opt.showmode = false -- Don't show mode in command line +opt.pumheight = 10 -- Popup menu height +opt.pumblend = 10 -- Popup menu transparency +opt.winblend = 0 -- Floating window transparency +opt.conceallevel = 0 -- Don't hide markup +opt.concealcursor = '' -- Don't hide cursor line markup +opt.lazyredraw = true -- Don't redraw during macros +opt.synmaxcol = 300 -- Syntax highlighting limit +opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } +opt.winborder = 'rounded' -- Default border for all floating windows + +-- File handling +opt.backup = false -- Don't create backup files +opt.writebackup = false -- Don't create backup before writing +opt.swapfile = false -- Don't create swap files +opt.undofile = true -- Persistent undo +opt.updatetime = 300 -- Faster completion +opt.timeoutlen = 500 -- Key timeout duration +opt.ttimeoutlen = 0 -- Key code timeout +opt.autoread = true -- Auto reload files changed outside vim +opt.autowrite = false -- Don't auto save + +-- Behavior settings +opt.hidden = true -- Allow hidden buffers +opt.errorbells = false -- No error bells +opt.backspace = 'indent,eol,start' -- Better backspace behavior +opt.autochdir = false -- Don't auto change directory +opt.iskeyword:append('-') -- Treat dash as part of word +opt.path:append('**') -- include subdirectories in search +opt.selection = 'exclusive' -- Selection behavior +opt.mouse = 'a' -- Enable mouse support +opt.clipboard:append('unnamedplus') -- Use system clipboard +opt.modifiable = true -- Allow buffer modifications +opt.encoding = 'UTF-8' -- Set encoding + +-- Folding settings +opt.foldmethod = 'expr' -- Use expression for folding +opt.foldexpr = 'nvim_treesitter#foldexpr()' -- Use treesitter for folding +opt.foldlevel = 99 -- Start with all folds open + +-- Split behavior +opt.splitbelow = true -- Horizontal splits go below +opt.splitright = true -- Vertical splits go right diff --git a/nvim/.config/nvim/lua/plugins/nord.lua b/nvim/.config/nvim/lua/plugins/nord.lua new file mode 100644 index 0000000..d189415 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/nord.lua @@ -0,0 +1,3 @@ +return { + 'shaunsingh/nord.nvim' +} -- cgit v1.2.3-13-gbd6f