diff options
| author | David T. Sadler <davidtsadler@googlemail.com> | 2026-01-13 16:09:20 +0000 |
|---|---|---|
| committer | David T. Sadler <davidtsadler@googlemail.com> | 2026-01-24 13:29:44 +0000 |
| commit | 6285067546ee45ed5b0f27f246aa323cb818fbbc (patch) | |
| tree | 53085443f8d084e3c86b0bff598e0f34b5da2c00 | |
| parent | 580dccb54de412a673b0f6131fdf49996bb9e7d4 (diff) | |
Stow nvim
| -rw-r--r-- | nvim/.config/nvim/init.lua | 5 | ||||
| -rw-r--r-- | nvim/.config/nvim/lazy-lock.json | 4 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/config/colorscheme.lua | 1 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/config/globals.lua | 7 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/config/keymaps.lua | 54 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/config/lazy.lua | 26 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/config/options.lua | 76 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/plugins/nord.lua | 3 |
8 files changed, 176 insertions, 0 deletions
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', '<A-j>', ':m .+1<CR>==', { desc = 'Move line down' }) +set('n', '<A-k>', ':m .-2<CR>==', { desc = 'Move line up' }) +set('i', '<A-j>', '<Esc>:m .+1<CR>==gi', { desc = 'Move line down' }) +set('i', '<A-k>', '<Esc>:m .-2<CR>==gi', { desc = 'Move line up' }) +set('v', '<A-j>', ":m '>+1<CR>gv=gv", { desc = 'Move selection down' }) +set('v', '<A-k>', ":m '<-2<CR>gv=gv", { desc = 'Move selection up' }) + +-- Better indenting in visual mode +set('v', '<', '<gv', { desc = 'Indent left and reselect' }) +set('v', '>', '>gv', { desc = 'Indent right and reselect' }) + +-- Buffer navigation +set('n', '<leader>bn', ':bnext<CR>', { desc = 'Next buffer' }) +set('n', '<leader>bp', ':bprevious<CR>', { desc = 'Previous buffer' }) + +-- Better window navigation +set('n', '<C-h>', '<C-w>h', { desc = 'Move to left window' }) +set('n', '<C-j>', '<C-w>j', { desc = 'Move to bottom window' }) +set('n', '<C-k>', '<C-w>k', { desc = 'Move to top window' }) +set('n', '<C-l>', '<C-w>l', { desc = 'Move to right window' }) + +-- Splitting & Resizing +set('n', '<leader>sv', ':vsplit<CR>', { desc = 'Split window vertically' }) +set('n', '<leader>sh', ':split<CR>', { desc = 'Split window horizontally' }) +set('n', '<leader>se', '<C-w>=', { desc = 'Make split windows equal width & height' }) +set('n', '<C-Up>', ':resize +2<CR>', { desc = 'Increase window height' }) +set('n', '<C-Down>', ':resize -2<CR>', { desc = 'Decrease window height' }) +set('n', '<C-Left>', ':vertical resize -2<CR>', { desc = 'Decrease window width' }) +set('n', '<C-Right>', ':vertical resize +2<CR>', { 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', '<C-d>', '<C-d>zz', { desc = 'Half page down (centered)' }) +set('n', '<C-u>', '<C-u>zz', { desc = 'Half page up (centered)' }) + +-- Better paste behavior +set('x', '<leader>p', '"_dP', { desc = 'Paste without yanking' }) + +-- Delete without yanking +set({ 'n', 'v' }, '<leader>d', '"_d', { desc = 'Delete without yanking' }) + +-- Toggle visible whitespace characters +set('n', '<leader>l', ':set list!<CR>', { desc = 'Toggle hidden characters' }) + +-- Quickly source current file / execute Lua code +set('n', '<leader>xx', '<Cmd>source %<CR>', { desc = 'Source current file' }) +set('n', '<leader>x', '<Cmd>:.lua<CR>', { desc = 'Lua: execute current line' }) +set('v', '<leader>x', '<Cmd>:lua<CR>', { 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' +} |
