Skip to content
nicholaspcrPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Nicholas' nvim config

A lazy.nvim-based Neovim configuration. Originally inspired by dope.

Dependencies

Required:

  • Neovim 0.12+
  • ripgrep — live grep, obsidian search
  • fd — recent-notes picker
  • tree-sitter CLI ≥ 0.26 — parser installation (brew install tree-sitter-cli)
  • A C compiler and make — parser compilation and telescope-fzf-native

Optional formatters. conform.nvim falls back to LSP formatting for any of these that is missing, so none of them is required:

  • gofmt — Go (imports are organised by the gopls code action, no tool needed)
  • rustfmt — Rust (ships with the toolchain)
  • stylua — Lua, uses the .stylua.toml in this repo. Also required by the Checks section below and by CI.
  • prettier — json, jsonc, yaml, markdown
  • shfmt — sh, bash

Layout

init.lua                     leader key, core module loading order
lua/core/
  options.lua                editor options (clipboard, folds, search, ...)
  mappings.lua               plugin-independent keymaps
  keymap.lua                 small keymap.set wrapper
  lsp.lua                    capabilities + LspAttach keymaps
  diagnostics.lua            diagnostic rendering
  incremental_selection.lua  <C-space>/<BS> treesitter selection
  theme.lua                  follows the terminal light/dark state file
  lazy.lua                   lazy.nvim bootstrap
lua/lsp/                     one module of settings per language server
lua/plugins/                 one spec per plugin (keymaps live with their plugin)
after/ftplugin/              per-filetype deltas from the global options
plugin/trimwhite.lua         :TrimTrailingWhitespace with inccommand preview
scripts/smoke.lua            headless config sanity check (also run in CI)

Notable behavior

  • Leader is <Space>; which-key shows group labels, individual descriptions come from each mapping's desc.

  • LSP servers are installed by mason / mason-lspconfig (lua/plugins/mason.lua). mason-lspconfig v2 enables them itself, so the config only supplies per-server settings from lua/lsp/<server>.lua via vim.lsp.config() — which takes precedence over the lsp/<server>.lua files nvim-lspconfig puts on the runtimepath.

  • pylsp expects python-lsp-black, pylsp-mypy, pyls-isort, and pylint installed in its mason venv.

  • Formatting is owned by conform.nvim (lua/plugins/conform.lua): <Leader>fw formats on demand in any buffer, and Go and Rust format on save.

  • Notes workflow uses obsidian.nvim (community fork) with a vault at ~/notes. Note keymaps live under <Leader>o (which also holds <Leader>oz Zen Mode); <Leader>ch toggles a checkbox.

  • Markdown buffers get an in-place rendered view via render-markdown.nvim; <Leader>tm swaps between rendered and raw source.

  • Treesitter (main rewrite) has no auto-install: parsers are pre-listed in lua/plugins/nvim_treesitter.lua. Startup only installs what is missing; :TSEnsureInstalled re-checks the list on demand.

  • gopls runs with staticcheck on and inlay hints configured. Its settings and analyzer defaults were checked against the binary with gopls api-json rather than the docs, which lag: unusedparams, nilness, unusedwrite and unusedvariable are all on by default in v0.23 and need no analyses entry, and completeUnimported is no longer a setting at all.

  • LSP keymaps are Neovim's own, not remapped. Neovim 0.11 began shipping these; this config predated that and duplicated them on other keys, so the custom set was dropped:

    was now action
    gr grr references
    gi gri implementation
    gD grt type definition
    gd gd or <C-]> definition (kept, plus Neovim's key)
    <Leader>rn grn rename
    <Leader>ca gra code action
    — grx run codelens
    — gO document symbols
    K K hover (Neovim maps this itself on attach)
    <C-k> <C-s> signature help (insert/select mode)

    lua/core/lsp.lua keeps those bindings but rebinds gd, <C-]>, grr, gri, grt and gO to telescope pickers, since stock Neovim sends them to the quickfix list. gra (code action) goes through vim.ui.select, which telescope-ui-select routes into a picker as well. grn, grx, K and <C-s> are left exactly as Neovim sets them.

    <Leader>fs / <Leader>fS pick document and workspace symbols, and <Leader>ih toggles inlay hints.

  • Every LSP picker clears file_ignore_patterns. Telescope applies its defaults to all pickers, so the ignore list meant for file browsing would otherwise make gd fail silently whenever a definition lives in vendor/ or a generated .pb.go.

  • Pressing gr alone waits timeoutlen before the builtin gr{char} virtual replace runs, because the six gr* defaults above extend it (:h map-ambiguous). This is stock Neovim behaviour, reproducible with nvim --clean.

  • <Leader>ff finds files, <Leader>fh finds them including hidden and gitignored paths (this repo lives under .config/, which <Leader>ff skips).

  • NVIM_COLUMN overrides textwidth (defaults to 120); colorcolumn tracks it.

  • Clipboard uses pbcopy/pbpaste on macOS and OSC52 elsewhere (works over SSH).

  • lazy-lock.json is committed. Use :Lazy restore to pin a machine to it and :Lazy update to move it forward.

Checks

stylua --check .
nvim --headless -c 'luafile scripts/smoke.lua' -c 'qa'

Both run in CI on every push and pull request to master.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

Generated from nvimdev/dope