aboutsummaryrefslogtreecommitdiffstats
path: root/neovim/.config/nvim
diff options
context:
space:
mode:
authorGravatar Tom van der Lee <t0m.vd.l33@gmail.com>2026-09-10 21:54:47 +0200
committerGravatar Tom van der Lee <t0m.vd.l33@gmail.com>2026-09-10 22:12:44 +0200
commitd7f52c9aaee49f62f9e3a2a410ca21eb5e4b1649 (patch)
tree2fb372e530bd5d7cffc63fae9aeab89f334ec420 /neovim/.config/nvim
parent7264701a9f94b8fe758599f6c1ce32701189fc41 (diff)
downloaddotfiles-d7f52c9aaee49f62f9e3a2a410ca21eb5e4b1649.tar.gz
dotfiles-d7f52c9aaee49f62f9e3a2a410ca21eb5e4b1649.tar.bz2
dotfiles-d7f52c9aaee49f62f9e3a2a410ca21eb5e4b1649.zip
Add standalone Neovim Lua config
Replace the neovim stow package's symlink into vim/.vim with a real, independent Lua config: init.lua + lua/config/* (options, keymaps, autocmds, lazy.nvim bootstrap) + lua/plugins/*.lua (one file per plugin group). - Plugin manager: lazy.nvim (self-bootstrapping, no submodule needed). - Carries over every plugin from the vimrc as-is: vim-airline (+ themes, tmuxline), vim-janah colorscheme, nerdtree, vim-signify, nerdcommenter, ale, vim-fugitive, quick-scope, ctrlp.vim, claude-code.nvim, plus vim-ansible-yaml/vim-terraform gated the same way the vimrc gated them (executable() checks, now as lazy.nvim `cond` functions). - Replaces YouCompleteMe + jedi-vim entirely with nvim-lspconfig + mason.nvim + mason-lspconfig.nvim (ensure_installed: pyright, lua_ls, bashls, terraformls, yamlls, ts_ls, cssls, html; clangd enabled directly since it's already on PATH via Xcode CLT) and blink.cmp for completion (+ friendly-snippets), with blink's LSP capabilities merged into every server's default config. - ALE stays as a pure linter/fixer (g:ale_disable_lsp = 1) so it doesn't duplicate nvim-lspconfig's diagnostics/hover/go-to-definition. - Ports the vimrc's general settings/functions (options, window-nav keymaps, arrow-key disabling, StripTrailingWhitespace, AppendModeline, the git->Git abbreviation) to Lua; drops the w!! sudo-save abbreviation (vimrc's own comment notes it doesn't work under Neovim) and the reload-vimrc-on-save autocmd (no clean Lua equivalent). Vim's own vimrc, ftplugin/python.vim, and plugin installs are completely untouched and unaffected by this change.
Diffstat (limited to 'neovim/.config/nvim')
l---------neovim/.config/nvim1
-rw-r--r--neovim/.config/nvim/.gitignore1
-rw-r--r--neovim/.config/nvim/ftplugin/python.lua5
-rw-r--r--neovim/.config/nvim/init.lua8
-rw-r--r--neovim/.config/nvim/lua/config/autocmds.lua22
-rw-r--r--neovim/.config/nvim/lua/config/keymaps.lua37
-rw-r--r--neovim/.config/nvim/lua/config/lazy.lua17
-rw-r--r--neovim/.config/nvim/lua/config/options.lua36
-rw-r--r--neovim/.config/nvim/lua/plugins/ale.lua9
-rw-r--r--neovim/.config/nvim/lua/plugins/claude-code.lua8
-rw-r--r--neovim/.config/nvim/lua/plugins/colorscheme.lua11
-rw-r--r--neovim/.config/nvim/lua/plugins/completion.lua11
-rw-r--r--neovim/.config/nvim/lua/plugins/editing.lua13
-rw-r--r--neovim/.config/nvim/lua/plugins/filetree.lua33
-rw-r--r--neovim/.config/nvim/lua/plugins/fuzzyfinder.lua10
-rw-r--r--neovim/.config/nvim/lua/plugins/git.lua4
-rw-r--r--neovim/.config/nvim/lua/plugins/langs.lua14
-rw-r--r--neovim/.config/nvim/lua/plugins/lsp.lua36
-rw-r--r--neovim/.config/nvim/lua/plugins/statusline.lua23
19 files changed, 298 insertions, 1 deletions
diff --git a/neovim/.config/nvim b/neovim/.config/nvim
deleted file mode 120000
index bf0d817..0000000
--- a/neovim/.config/nvim
+++ /dev/null
@@ -1 +0,0 @@
1../../vim/.vim \ No newline at end of file
diff --git a/neovim/.config/nvim/.gitignore b/neovim/.config/nvim/.gitignore
new file mode 100644
index 0000000..f84e7ed
--- /dev/null
+++ b/neovim/.config/nvim/.gitignore
@@ -0,0 +1 @@
spell/
diff --git a/neovim/.config/nvim/ftplugin/python.lua b/neovim/.config/nvim/ftplugin/python.lua
new file mode 100644
index 0000000..f100b93
--- /dev/null
+++ b/neovim/.config/nvim/ftplugin/python.lua
@@ -0,0 +1,5 @@
1-- Ported from vim/.vim/ftplugin/python.vim (shared source of truth for Vim)
2vim.bo.tabstop = 8
3vim.bo.expandtab = true
4vim.bo.shiftwidth = 4
5vim.bo.softtabstop = 4
diff --git a/neovim/.config/nvim/init.lua b/neovim/.config/nvim/init.lua
new file mode 100644
index 0000000..dded909
--- /dev/null
+++ b/neovim/.config/nvim/init.lua
@@ -0,0 +1,8 @@
1-- Set the leader before anything else: lazy.nvim resolves plugin specs
2-- (including any `keys` tables) at setup time and needs it already set.
3vim.g.mapleader = " "
4
5require("config.options")
6require("config.keymaps")
7require("config.autocmds")
8require("config.lazy")
diff --git a/neovim/.config/nvim/lua/config/autocmds.lua b/neovim/.config/nvim/lua/config/autocmds.lua
new file mode 100644
index 0000000..7bc4f6b
--- /dev/null
+++ b/neovim/.config/nvim/lua/config/autocmds.lua
@@ -0,0 +1,22 @@
1-- Remove trailing spaces on save, preserving cursor and search pattern
2local function strip_trailing_whitespace()
3 if vim.list_contains({ "markdown", "diff" }, vim.bo.filetype) then
4 return
5 end
6 local view = vim.fn.winsaveview()
7 vim.cmd([[keeppatterns %s/\s\+$//e]])
8 vim.fn.winrestview(view)
9end
10
11vim.api.nvim_create_autocmd("BufWritePre", {
12 pattern = "*",
13 callback = strip_trailing_whitespace,
14})
15
16-- Note: the colorscheme (with its "desert" fallback) is applied from
17-- lua/plugins/colorscheme.lua's own `config` function, not here — under
18-- lazy.nvim that's the natural place to react to "the plugin is now loaded".
19--
20-- Note: the vimrc's "reload vimrc on save" autocmd has no clean Lua
21-- equivalent (module caching means `require()`-based configs aren't simply
22-- re-sourceable) and is deliberately not ported.
diff --git a/neovim/.config/nvim/lua/config/keymaps.lua b/neovim/.config/nvim/lua/config/keymaps.lua
new file mode 100644
index 0000000..f0bfbec
--- /dev/null
+++ b/neovim/.config/nvim/lua/config/keymaps.lua
@@ -0,0 +1,37 @@
1local map = vim.keymap.set
2
3-- Switch windows with <C-[direction]>
4map("n", "<C-j>", "<C-w>j")
5map("n", "<C-k>", "<C-w>k")
6map("n", "<C-h>", "<C-w>h")
7map("n", "<C-l>", "<C-w>l")
8
9-- Never use the arrow keys
10for _, key in ipairs({ "<Up>", "<Down>", "<Left>", "<Right>" }) do
11 map({ "n", "i" }, key, "<Nop>")
12end
13
14-- Disable ex mode
15map("n", "Q", "<Nop>")
16
17-- Expand :git to fugitive's :Git, but only as a whole command.
18-- (No Lua-native abbreviation API exists, so this stays a thin vim.cmd call.)
19vim.cmd([[cnoreabbrev <expr> git (getcmdtype() ==# ':' && getcmdline() ==# 'git') ? 'Git' : 'git']])
20
21-- Note: the vimrc's `w!!` sudo-save abbreviation is deliberately NOT ported
22-- here — its own comment says it doesn't work under Neovim (sudo can't
23-- prompt for a password there).
24
25-- Append modeline when pressing <leader>ml
26local function append_modeline()
27 local modeline = string.format(
28 " vim: set ts=%d sw=%d tw=%d %set :",
29 vim.bo.tabstop,
30 vim.bo.shiftwidth,
31 vim.bo.textwidth,
32 vim.bo.expandtab and "" or "no"
33 )
34 modeline = vim.bo.commentstring:gsub("%%s", modeline)
35 vim.api.nvim_buf_set_lines(0, -1, -1, false, { modeline })
36end
37map("n", "<leader>ml", append_modeline, { silent = true })
diff --git a/neovim/.config/nvim/lua/config/lazy.lua b/neovim/.config/nvim/lua/config/lazy.lua
new file mode 100644
index 0000000..5a645c1
--- /dev/null
+++ b/neovim/.config/nvim/lua/config/lazy.lua
@@ -0,0 +1,17 @@
1local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
2if not vim.uv.fs_stat(lazypath) then
3 vim.fn.system({
4 "git",
5 "clone",
6 "--filter=blob:none",
7 "https://github.com/folke/lazy.nvim.git",
8 "--branch=stable",
9 lazypath,
10 })
11end
12vim.opt.rtp:prepend(lazypath)
13
14require("lazy").setup("plugins", {
15 install = { colorscheme = { "janah", "desert" } },
16 checker = { enabled = false },
17})
diff --git a/neovim/.config/nvim/lua/config/options.lua b/neovim/.config/nvim/lua/config/options.lua
new file mode 100644
index 0000000..be614e1
--- /dev/null
+++ b/neovim/.config/nvim/lua/config/options.lua
@@ -0,0 +1,36 @@
1-- Ported from vim/.vim/vimrc's "DEFAULT VIM SETTINGS" block. `syntax on` and
2-- `filetype plugin indent on` are intentionally omitted: both are Neovim
3-- defaults (see `:help nvim-defaults`).
4
5local opt = vim.opt
6
7opt.number = true
8opt.relativenumber = true
9opt.list = true
10opt.modeline = true
11opt.background = "dark"
12opt.foldmethod = "indent"
13opt.listchars = { trail = "·", tab = "▸ ", eol = "¬" }
14opt.scrolloff = 1
15opt.backspace = { "indent", "eol", "start" }
16opt.cursorline = true
17opt.hidden = true -- already Neovim's default; set explicitly for parity with the vimrc
18opt.wildmenu = true -- already Neovim's default; set explicitly for parity with the vimrc
19
20-- Faster gutter updates (signify) and snappier <Esc>
21opt.updatetime = 100
22opt.ttimeoutlen = 10
23
24-- Persistent undo across sessions
25local undodir = vim.fn.stdpath("data") .. "/undo"
26if vim.fn.isdirectory(undodir) == 0 then
27 vim.fn.mkdir(undodir, "p", "0700")
28end
29opt.undofile = true
30opt.undodir = undodir
31
32-- Search-related things
33opt.hlsearch = true
34opt.incsearch = true
35opt.ignorecase = true
36opt.smartcase = true
diff --git a/neovim/.config/nvim/lua/plugins/ale.lua b/neovim/.config/nvim/lua/plugins/ale.lua
new file mode 100644
index 0000000..10a680c
--- /dev/null
+++ b/neovim/.config/nvim/lua/plugins/ale.lua
@@ -0,0 +1,9 @@
1return {
2 "dense-analysis/ale",
3 event = { "BufReadPre", "BufNewFile" },
4 init = function()
5 -- nvim-lspconfig owns LSP-protocol features (diagnostics, hover,
6 -- go-to-definition) here; keep ALE to its own linters/fixers only.
7 vim.g.ale_disable_lsp = 1
8 end,
9}
diff --git a/neovim/.config/nvim/lua/plugins/claude-code.lua b/neovim/.config/nvim/lua/plugins/claude-code.lua
new file mode 100644
index 0000000..0390852
--- /dev/null
+++ b/neovim/.config/nvim/lua/plugins/claude-code.lua
@@ -0,0 +1,8 @@
1return {
2 "greggh/claude-code.nvim",
3 dependencies = { "nvim-lua/plenary.nvim" },
4 cmd = { "ClaudeCode", "ClaudeCodeContinue", "ClaudeCodeResume", "ClaudeCodeVerbose" },
5 config = function()
6 require("claude-code").setup({ window = { position = "vertical botright" } })
7 end,
8}
diff --git a/neovim/.config/nvim/lua/plugins/colorscheme.lua b/neovim/.config/nvim/lua/plugins/colorscheme.lua
new file mode 100644
index 0000000..457dc71
--- /dev/null
+++ b/neovim/.config/nvim/lua/plugins/colorscheme.lua
@@ -0,0 +1,11 @@
1return {
2 "mhinz/vim-janah",
3 lazy = false,
4 priority = 1000,
5 config = function()
6 local ok = pcall(vim.cmd.colorscheme, "janah")
7 if not ok then
8 vim.cmd.colorscheme("desert")
9 end
10 end,
11}
diff --git a/neovim/.config/nvim/lua/plugins/completion.lua b/neovim/.config/nvim/lua/plugins/completion.lua
new file mode 100644
index 0000000..9eed355
--- /dev/null
+++ b/neovim/.config/nvim/lua/plugins/completion.lua
@@ -0,0 +1,11 @@
1return {
2 "saghen/blink.cmp",
3 version = "*", -- use a release with a prebuilt fuzzy-matcher binary
4 dependencies = { "rafamadriz/friendly-snippets" },
5 opts = {
6 keymap = { preset = "super-tab" },
7 sources = {
8 default = { "lsp", "path", "snippets", "buffer" },
9 },
10 },
11}
diff --git a/neovim/.config/nvim/lua/plugins/editing.lua b/neovim/.config/nvim/lua/plugins/editing.lua
new file mode 100644
index 0000000..c1d5567
--- /dev/null
+++ b/neovim/.config/nvim/lua/plugins/editing.lua
@@ -0,0 +1,13 @@
1return {
2 {
3 "preservim/nerdcommenter",
4 init = function()
5 vim.g.NERDSpaceDelims = 1
6 vim.g.NERDCompactSexyComs = 1
7 vim.g.NERDDefaultAlign = "left"
8 vim.g.NERDCommentEmptyLines = 1
9 vim.g.NERDTrimTrailingWhitespace = 1
10 end,
11 },
12 "unblevable/quick-scope",
13}
diff --git a/neovim/.config/nvim/lua/plugins/filetree.lua b/neovim/.config/nvim/lua/plugins/filetree.lua
new file mode 100644
index 0000000..cdee9f7
--- /dev/null
+++ b/neovim/.config/nvim/lua/plugins/filetree.lua
@@ -0,0 +1,33 @@
1return {
2 "preservim/nerdtree",
3 lazy = false,
4 config = function()
5 -- Open NERDTree when no file is specified; quit when it's the last window
6 local augroup = vim.api.nvim_create_augroup("nerdtree_auto", { clear = true })
7
8 vim.api.nvim_create_autocmd("StdinReadPre", {
9 group = augroup,
10 callback = function()
11 vim.g.std_in = 1
12 end,
13 })
14
15 vim.api.nvim_create_autocmd("VimEnter", {
16 group = augroup,
17 callback = function()
18 if vim.fn.argc() == 0 and vim.g.std_in == nil then
19 vim.cmd("NERDTree")
20 end
21 end,
22 })
23
24 vim.api.nvim_create_autocmd("BufEnter", {
25 group = augroup,
26 callback = function()
27 if vim.fn.winnr("$") == 1 and vim.bo.filetype == "nerdtree" then
28 vim.cmd("quit")
29 end
30 end,
31 })
32 end,
33}
diff --git a/neovim/.config/nvim/lua/plugins/fuzzyfinder.lua b/neovim/.config/nvim/lua/plugins/fuzzyfinder.lua
new file mode 100644
index 0000000..444d9ff
--- /dev/null
+++ b/neovim/.config/nvim/lua/plugins/fuzzyfinder.lua
@@ -0,0 +1,10 @@
1return {
2 "ctrlpvim/ctrlp.vim",
3 init = function()
4 -- Use ripgrep for listing files (fast, respects .gitignore)
5 if vim.fn.executable("rg") == 1 then
6 vim.g.ctrlp_user_command = 'rg %s --files --color=never --glob ""'
7 vim.g.ctrlp_use_caching = 0
8 end
9 end,
10}
diff --git a/neovim/.config/nvim/lua/plugins/git.lua b/neovim/.config/nvim/lua/plugins/git.lua
new file mode 100644
index 0000000..8402905
--- /dev/null
+++ b/neovim/.config/nvim/lua/plugins/git.lua
@@ -0,0 +1,4 @@
1return {
2 "tpope/vim-fugitive",
3 "mhinz/vim-signify",
4}
diff --git a/neovim/.config/nvim/lua/plugins/langs.lua b/neovim/.config/nvim/lua/plugins/langs.lua
new file mode 100644
index 0000000..7bf22d4
--- /dev/null
+++ b/neovim/.config/nvim/lua/plugins/langs.lua
@@ -0,0 +1,14 @@
1return {
2 {
3 "chase/vim-ansible-yaml",
4 cond = function()
5 return vim.fn.executable("ansible") == 1
6 end,
7 },
8 {
9 "hashivim/vim-terraform",
10 cond = function()
11 return vim.fn.executable("terraform") == 1
12 end,
13 },
14}
diff --git a/neovim/.config/nvim/lua/plugins/lsp.lua b/neovim/.config/nvim/lua/plugins/lsp.lua
new file mode 100644
index 0000000..0463dde
--- /dev/null
+++ b/neovim/.config/nvim/lua/plugins/lsp.lua
@@ -0,0 +1,36 @@
1return {
2 "mason-org/mason-lspconfig.nvim",
3 dependencies = {
4 { "mason-org/mason.nvim", opts = {} },
5 "neovim/nvim-lspconfig",
6 "saghen/blink.cmp",
7 },
8 opts = {
9 ensure_installed = {
10 "pyright",
11 "lua_ls",
12 "bashls",
13 "terraformls",
14 "yamlls",
15 "ts_ls",
16 "cssls",
17 "html",
18 },
19 -- default true: auto-calls vim.lsp.enable() for every Mason-installed
20 -- server as it finishes installing.
21 },
22 config = function(_, opts)
23 -- Merge blink.cmp's LSP capabilities into every server's default config
24 -- (Mason-managed or not) before any server gets enabled.
25 vim.lsp.config("*", {
26 capabilities = require("blink.cmp").get_lsp_capabilities(),
27 })
28
29 require("mason-lspconfig").setup(opts)
30
31 -- clangd ships with Xcode Command Line Tools already, so it's not
32 -- Mason-managed — nvim-lspconfig provides its default config, we just
33 -- need to turn it on.
34 vim.lsp.enable("clangd")
35 end,
36}
diff --git a/neovim/.config/nvim/lua/plugins/statusline.lua b/neovim/.config/nvim/lua/plugins/statusline.lua
new file mode 100644
index 0000000..b93b34c
--- /dev/null
+++ b/neovim/.config/nvim/lua/plugins/statusline.lua
@@ -0,0 +1,23 @@
1return {
2 "bling/vim-airline",
3 lazy = false,
4 dependencies = {
5 "vim-airline/vim-airline-themes",
6 "edkolev/tmuxline.vim",
7 },
8 init = function()
9 -- On arch linux install the following:
10 -- otf-powerline-symbols-git
11 -- powerline-fonts-git
12 vim.g.airline_powerline_fonts = 1
13 vim.g["airline#extensions#tabline#enabled"] = 1
14
15 -- vim.g dict reads return a copy, not a live reference, so the nested
16 -- field has to be set via a local table and reassigned.
17 local symbols = vim.g.airline_symbols or {}
18 symbols.space = "\u{a0}"
19 vim.g.airline_symbols = symbols
20
21 vim.opt.laststatus = 2
22 end,
23}