Skip to content
WarboxLiamPublic
forked from LiamWinterton/nvim

About

My nvim config

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

82 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neovim Config

A lazy.nvim based Neovim config. It uses the Catppuccin Mocha theme with a transparent background.

Requirements

  • Neovim 0.11+ (uses vim.lsp.config)
  • git and make (for telescope-fzf-native)
  • deno (builds peek.nvim)
  • rustup (provides rust-analyzer and rustfmt)
  • A Nerd Font for icons
  • Formatters, as needed: stylua, prettier or prettierd, biome

Install

git clone <repo-url> ~/.config/nvim
nvim

lazy.nvim bootstraps itself on first launch and installs the plugins.

Structure

.
├── init.lua              # Loads salt and lazy
├── ftplugin/markdown.lua # Wrap and linebreak for markdown
└── lua/
    ├── config/lazy.lua   # lazy.nvim bootstrap
    ├── salt/             # Options and remaps
    └── plugins/          # One file per plugin (or group)

Plugins

Area Plugins
UI catppuccin, dashboard-nvim, fidget, indent-blankline, which-key
Navigation telescope (with fzf-native), harpoon, oil, flash
Editing vim-sandwich, ultimate-autopair, undotree
LSP and completion mason, mason-lspconfig, nvim-lspconfig, blink.cmp, friendly-snippets
Treesitter nvim-treesitter (main), treesitter-modules, nvim-treesitter-textobjects
Formatting conform
Git gitsigns, vim-fugitive, vim-rhubarb, git-conflict
Markdown render-markdown, peek.nvim (:PeekOpen, :PeekClose)

Keymaps

The leader key is <Space>.

Key Mode Action
<leader>pv n File browser (netrw)
- n Open parent directory (oil)
<leader>ff n Find files
<leader>fg n Live grep
<leader>fb n Buffers
<leader>fh n Help tags
<C-e> n Harpoon menu
<leader>a n Harpoon mark file
<C-H/J/K/L> n Harpoon files 1-4
ss n/x/o Flash jump
S n/o Flash treesitter
r o Remote flash
R o/x Treesitter search
<C-s> c Toggle flash search
<leader>u n Undotree
<leader>? n Buffer-local keymaps
<leader>gs n Git status
<leader>gm n Git mergetool
<leader>go n Open file on GitHub
<Leader>ss n Start incremental selection
<Leader>si v Expand to next node
<Leader>sd v Shrink to previous node
<Leader>sc v Expand to scope
af / if x/o Function outer / inner
ac / ic x/o Class outer / inner
aa / ia x/o Parameter outer / inner
as x/o Language scope

LSP

Set when a language server attaches.

Key Action
K Hover
gd / gD Definition / declaration
gi Implementation
gt Type definition
gr References
gs Signature help
<F2> Rename
<F4> Code action
<leader>vd Diagnostic float
<leader>[d Previous diagnostic
<leader>]d Next diagnostic

Completion uses blink.cmp with the super-tab preset.

LSP and formatting

Mason installs these servers: bashls, cssls, graphql, html, jsonls, marksman, mdx_analyzer, vtsls, tailwindcss, vimls, lemminx.

rust-analyzer comes from rustup (~/.cargo/bin/rust-analyzer), so it matches the active toolchain. Run rustup update to keep them in sync.

Formatting runs on save through conform:

  • JS and TS use prettier when a .prettierrc is found, otherwise biome (with organize imports).
  • CSS, HTML and JSON use biome, then prettierd, then prettier.
  • YAML uses prettierd, then prettier.
  • Markdown and MDC use prettierd.
  • Lua uses stylua, and Rust uses rustfmt.

.mdc files are treated as markdown.

Notable options

  • Relative line numbers
  • Tabs, width 4
  • No line wrapping (wrapping is on for markdown)
  • scrolloff=999 keeps the cursor centred
  • System clipboard shared with Neovim
  • inccommand=split previews substitutions
  • virtualedit=block
  • Transparent background
  • Plugin update checker enabled

About

My nvim config

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages