Skip to content

Instantly share code, notes, and snippets.

@al-maisan
Last active March 16, 2026 16:18
Show Gist options
  • Select an option

  • Save al-maisan/c4e47c58397c7bc5f3fa21b7bf660521 to your computer and use it in GitHub Desktop.

Select an option

Save al-maisan/c4e47c58397c7bc5f3fa21b7bf660521 to your computer and use it in GitHub Desktop.
Neovim init.lua changes — 2026-03-05

Neovim init.lua changes

Neovim init.lua Changes

All changes made to ~/.config/nvim/init.lua.

Current file: init.lua

Colorscheme

Replaced folke/tokyonight.nvim (tokyonight-night) with RRethy/base16-nvim (base16-one-light — subdued light theme based on Atom One Light).

Treesitter

Fixed nvim-treesitter config error (attempt to call field 'install' (a nil value)). The lazy-lock.json had a pinned commit from the archived master branch instead of main. Updated the lock file to the correct main branch commit (544320a9) where require('nvim-treesitter').install() exists.

Options

Setting Value Purpose
vim.o.wrapscan false Don't wrap search past end of file
vim.o.wildmode 'list:longest' Tab completion: list matches, complete longest common string
vim.o.wildmenu false Disable wildmenu (was overriding wildmode)
vim.o.tabstop 4 Tab display width of 4 columns
listchars.tab ' ' Tabs render as plain spaces (invisible)

Keybindings

Key Action Description
Y :e#<CR> Switch to alternate (last edited) buffer
<C-x> :bd<CR> Close current buffer
<C-a> Telescope buffers Find existing buffers (fuzzy picker)
<space>so Telescope live grep Grep only code files (go, rs, tf, sh, py, toml, mk, bash, sql, Makefile)
<space>sw Telescope grep_string Search word under cursor in code files only (same glob filter as <space>so)
<C-u> :res +6 Increase split height by 6
<C-d> :res -6 Decrease split height by 6
;; Copy path to clipboard Copy current buffer path (as opened) to system clipboard
<space>sc Telescope commands Search and execute Ex commands
<Tab> (Telescope) Toggle selection Mark/unmark item in Telescope results, move up
<S-Tab> (Telescope) Toggle selection Mark/unmark item in Telescope results, move down
<M-q> (Telescope) Selected → quickfix Send only selected items to quickfix list and open it (Telescope default)
<space>gd :DiffviewOpen Git diff all files against HEAD
<space>gh :DiffviewFileHistory % Git commit history for current file

Commands

Command Action
:Vrc Open ~/.config/nvim/init.lua

which-key

Customized from kickstart defaults:

  • delay = 250 — show which-key popup after 250ms (kickstart default is 0)
  • Trimmed spec: removed <leader>c (Code), <leader>d (Document), <leader>r (Rename), <leader>w (Workspace) groups
  • Added { 'gr', group = 'LSP Actions', mode = { 'n' } } group
  • Added visual mode to <leader>s (Search) group

blink.cmp (completion plugin)

Customized cmdline completion to fix wildmode conflict and improve UX:

cmdline = {
  keymap = {
    ['<Tab>'] = { 'select_and_accept', 'fallback' },
    ['<C-n>'] = { 'select_next', 'fallback' },
    ['<C-p>'] = { 'select_prev', 'fallback' },
  },
  completion = {
    list = { selection = { preselect = true, auto_insert = true } },
    menu = { auto_show = true },
  },
},
  • Top match auto-selected and auto-inserted
  • <Tab> accepts the selection (instead of <C-y>)
  • <C-n>/<C-p> to cycle matches

Added 'buffer' to completion sources so <C-n> also completes words from the current buffer:

sources = {
  default = { 'lsp', 'path', 'snippets', 'buffer' },
},

New Plugins

Plugin Purpose
sindrets/diffview.nvim Side-by-side git diff viewer for all files, file history
rafamadriz/friendly-snippets Premade snippets for many languages (Go, Rust, etc.)

Diff Colors

Fixed unreadable diff highlights (dark backgrounds on light theme). Added termguicolors = true and overrode DiffAdd, DiffDelete, DiffChange, DiffText with light pastel backgrounds via ColorScheme autocmd.

Terminal Title

Set terminal title to NVIM via vim.o.title = true and vim.o.titlestring = 'NVIM'.

LSP Servers

Added to the servers table (user change):

  • gopls
  • pyright
  • rust_analyzer
  • stylua

Change Log

2026-03-16

  • <space>sw restricted to code files: Changed from bare builtin.grep_string to a wrapped function with glob_pattern filter matching the same file types as <space>so (*.go, *.rs, *.tf, *.sh, *.py, *.toml, *.mk, *.bash, *.sql, Makefile). Previously searched all files in the tree.
  • Buffer word completion: Added 'buffer' to blink.cmp sources.default (was { 'lsp', 'path', 'snippets' }). <C-n> now also suggests words from the current buffer, not just LSP/snippets/paths.
  • Documentation sync: Added previously undocumented <space>sc (search commands) keybinding and which-key customizations (delay 250ms, trimmed spec, gr LSP Actions group).
  • Telescope selection → quickfix: Mapped <Tab>/<S-Tab> to toggle selection in Telescope results. <C-q> sends all results to quickfix (default), <M-q> (Alt-q) sends only selected items (also default).

2026-03-05

  • Initial setup: colorscheme, treesitter fix, options, keybindings, commands, blink.cmp cmdline config, new plugins, diff colors, terminal title, LSP servers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment