aboutsummaryrefslogtreecommitdiffstats
path: root/neovim/.config/nvim/lua/config/autocmds.lua
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/lua/config/autocmds.lua
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/lua/config/autocmds.lua')
-rw-r--r--neovim/.config/nvim/lua/config/autocmds.lua22
1 files changed, 22 insertions, 0 deletions
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.