Skip to content

About

There are many like it, but this one is mine.

Resources

Stars

42 stars

Watchers

2 watching

Forks

Repository files navigation

Neovim IDE configuration

My configuration for Neovim, mostly for frontend development (TypeScript, CSS, python, rust).

  • Editor - enhanced vim motions, extended text objects, folding
  • Code - formatter, comments, code completion, AI powered suggestions
  • HTTP - REST client for .http files
  • AI Assistant - suggestions, chat, agentic
  • LSP - Language Server Protocol client, symbols navigation, diagnostics
  • Syntax - highlighting, syntax aware motions, text objects
  • Git integration - status, diff, conflicts, commit message editor, buffer integration
  • Search - fuzzy find anything, files, git changed, last buffers
  • UI - files and directory explorer, notifications, command palette

Works on Neovim v0.12+

Setup

Prerequisites

Installation

git clone https://github.com/ruicsh/nvim-config.git ~/.config/nvim
nvim

On first launch, lazy.nvim will bootstrap itself and install all plugins automatically.

Screenshots

screenshot

Theme

Plugins

61 plugins

Code

AI

Editor

Windows

Git

Navigation

LSP/Syntax/Tools

Config

Config

Complex configuration options.

foldtext Text displayed for a closed fold
formatoptions Format options
standard-plugins Disable unused standard plugins
statusline Content of the statusline
winbar Content of the winbar
wrap Toggle soft-wrap

Filetypes

Custom configuration, keymaps, and features dependent on the file's type.

dockerfile Dockerfile
terminal Terminal buffers
typescript TypeScript LSP code actions

Autocmds

New features built around autocmds (events).

auto-close-buffer-if-deleted Auto close buffer when deleted from disk
auto-resize-splits Auto resize splits when window is resized
cmdline Clean up after use, hide hit-enter messages on blur
default-filetype Markdown for new/undetected buffers
help Open Help in side panel
show-cursorline-only-active Show cursorline only on active window.

Custom

Random features added.

duplicate-comment Duplicate and comment
lsp-disable-semantic-tokens Disable semantic tokens (LSP)
lsp-keymaps Keymaps (LSP)
lsp-highlight-references Highlight references (LSP)
lsp-jump-to-references Jump to references (LSP)
lsp-python-set-venv Set venv for python files (LSP)
vim-messages Display :messages on a separate window

Keymaps

Files explorer

  • - open directory explorer (Oil)
  • _ open current working directory (Oil)
  • <tab> preview file
  • <bs> go to parent directory
  • <c-w>s open in horizontal split
  • <c-w>t open in new tab
  • <c-w>v open in vertical split
  • <leader>- open Yazi at current file
  • <leader>_ open Yazi at current working directory
  • <leader>. last picker
  • <leader><space> files & buffers

Buffers

  • <bs> switch to last
  • q close
  • <leader>, list

Bookmarks

  • \{a,s,d,f,g} jump to
  • \\{a,s,d,f,g} save to
  • <leader>\ list

Alternate buffer

  • == switch to
  • =<space> switch to source
  • =b switch to test
  • =m switch to template
  • =s switch to style
  • =y switch to story

Navigation

  • { jump up 6 lines
  • } jump down 6 lines
  • w/b next/previous word
  • e/ge next/previous word end
  • '' jump to position before last jump
  • '. jump to position where last change was made
  • s jump with labels
  • '{a-z}' jump to marked position
  • mm jump to matching pair
  • [m/]m jump to previous/next matching word
  • gm jump to previous match
  • zm jump inside next block
  • [[ jump to earlier section (]] later)

Windows

  • | switch
  • q close
  • <c-q> quit
  • <c-w>t move file to new tab
  • <c-w>m move window
  • <c-w>x swap windows
  • <c-w>z toggle zoom
  • <s-tab> toggle terminal
  • <c-g> open file references (path[:line]) from terminal output
  • <leader>w toggle soft-wrap
  • <leader>q close side panels

Search

  • <leader>/ search in workspace
  • <leader>? search in directory
  • <leader>g/ search current word in workspace
  • g/ search current word / selection
  • <leader>" registers
  • <leader>' marks
  • <leader>; jumps
  • <leader>u command history
  • <leader>p clipboard history
  • <leader>cc quickfix list
  • */# search word under cursor forward/backward
  • g*/g# search partial word forward/backward
  • [/ search word under cursor
  • gr/ replace current word / selection
  • gw/ web search current word / selection
  • <c-w>/ search first occurence in new window
  • n/N next/previous result

Editing

  • [<space> add blank line above cursor (]<space> below)
  • [p paste to new line above (]p below)
  • gCC duplicate [count] lines, comment out the first instance
  • gC duplicate a selection, comment out the first instance (visual mode)
  • U redo
  • V select until end of line
  • vv enter visual line mode
  • <c-s> save
  • <a-h> move line/selection left
  • <a-j> move line/selection down
  • <a-k> move line/selection up
  • <a-l> move line/selection right
  • <tab> toggle fold
  • <leader>v enter visual block mode

Insert/Command mode

  • <c-b> jump character backward
  • <c-f> jump character forward
  • <a-b> jump word backward
  • <a-f> jump word forward
  • <c-a> jump to line start
  • <c-e> jump to line end
  • <c-h> delete character backward
  • <c-d> delete character forward
  • <a-bs> delete word backward
  • <a-d> delete word forward
  • <c-w> delete WORD backward
  • <c-k> delete line forward
  • <c-u> delete line backward
  • <c-v> paste from clipboard (insert mode)
  • <c-z> undo (insert mode)
  • <c-n> jump to next match (command mode)
  • <c-p> jump to previous match (command mode)

Text objects

  • a function argument
  • b brackets ({}, (), [])
  • c comment
  • % entire file
  • f function
  • h git hunk
  • m matching pair
  • q quotes (", ', `)
  • s single word in different cases
  • t HTML tags

Change text cases

  • <leader>~- to kebab-case
  • <leader>~_ to snake_case
  • <leader>~C to CONSTANT_CASE
  • <leader>~U to UPPER CASE
  • <leader>~c to camelCase
  • <leader>~p to PascalCase
  • <leader>~u to lower case

Also available as <leader>g~{char} (LSP rename) and g~o{char} (operator).

Yank current filepath

  • y% path (relative)
  • yL path (relative) + line number

Operators

  • ys{motion}{char} add surrounding character
  • ds{char} delete surrounding character
  • cs{target}{replacement} replace surrounding character
  • S{char} add surrounding character (visual mode)
  • <leader>x{motion} exchange with another motion (<leader>xx line, <leader>xc cancel)
  • <leader>r{motion} replace with register (<leader>rr line, <leader>R end of line)
  • <leader>s{motion} sort (<leader>ss line)

MultiCursor

  • <s-down> add cursor below (<s-up> for above)
  • <leader><s-down> skip cursor below (<leader><s-up> for above)
  • <c-s-down> add cursor to next match (<c-s-up> for previous)
  • <leader><c-s-down> skip cursor next match (<leader><c-s-up> for previous)
  • <leader>mm toggle cursor
  • <leader>x delete cursor
  • <esc> clear cursors

Completion

  • <c-n> show/next entry
  • <c-p> previous entry
  • <tab> show/next entry
  • <s-tab> previous entry
  • <cr> confirm
  • <c-e> hide
  • <c-f> scroll docs forward
  • <c-b> scroll docs backward

AI suggestions

  • <c-]> accept
  • <c-d> dismiss
  • <a-w> accept word
  • <a-e> accept line
  • <a-n> show next
  • <a-p> show previous

AI agent

  • <c-bslash> show/focus (visual mode: send selection)
  • <c-w><c-bslash> toggle
  • <c-b> buffer picker (agent terminal)
  • <c-f> file picker (agent terminal)

Logging

  • glv insert variable log below
  • glV insert variable log above
  • glp insert plain log below
  • glP insert plain log above
  • glb insert batch log below
  • gla add to batch log
  • glk insert breakpoint below
  • glK insert breakpoint above
  • glt insert timestamp below
  • glT insert timestamp above
  • <leader>glt insert timestamp above/below

Syntax (AST)

  • <c-h> jump to parent node
  • <c-j> jump to next sibling node
  • <c-k> jump to previous sibling node
  • <c-l> jump to child node
  • <c-s-h> swap with left node (<c-H> on Windows)
  • <c-s-j> swap with down node (<c-J> on Windows)
  • <c-s-k> swap with up node (<c-K> on Windows)
  • <c-s-l> swap with right node (<c-L> on Windows)
  • ]a jump to next parameter start ([a previous)
  • ]f jump to next function start ([f previous)
  • ]s jump to next className ([s previous)

LSP

  • K display hover information for symbol
  • gO list symbols in document
  • gra code actions
  • grt jump to type definition
  • gri jump to implementation
  • grn rename symbol
  • grr list references
  • grI list incoming calls
  • grO list outgoing calls
  • grx run code lens
  • <cr> jump to definition
  • <c-w>] jump to definition (vsplit)
  • <leader>dd open diagnostics (file)
  • <leader>dD open diagnostics (workspace)
  • [r jump to previous symbol reference (]r next)
  • [e jump to previous error (]e next)
  • [E jump to first error (]E last)

TypeScript (LSP)

  • <leader>im add missing imports
  • <leader>io organize imports
  • <leader>ir remove unused
  • <leader>is sort imports
  • <leader>iu remove unused imports

Git

  • [c previous change (]c next)
  • <leader>h~ diff HEAD~{count}..HEAD
  • <leader>h<c-bslash> AI review branch vs chosen base (defaults to default branch)
  • <leader>hB branches
  • <leader>hD diff explorer
  • <leader>hH status (picker)
  • <leader>hL search log
  • <leader>hM review branch vs chosen base (defaults to default branch)
  • <leader>hd inline diff overlay (in place, vs index)
  • <leader>hh status
  • <leader>hl show range history (visual mode)
  • <leader>hl% log for file
  • <leader>hl$ blame line
  • <leader>hR discard file
  • <leader>hr discard hunk
  • <leader>hS stage file
  • <leader>hs stage hunk
  • <leader>hx open file in browser
  • <leader>hX open commit in browser

Git merge conflicts

  • [x previous conflict (]x next)
  • cb choose both
  • co choose current
  • ct choose incoming
  • cx discard

Test runner

  • <leader>ba run all
  • <leader>bb run last
  • <leader>b% run file
  • <leader>bn run nearest

Tabs

  • <leader><tab><tab> new tab
  • <leader><tab>q close tab
  • [<tab> previous tab
  • ]<tab> next tab
  • <leader><tab>{1-9} go to tab

HTTP requests (REST)

  • <leader>ar run request under cursor
  • <leader>aR re-run last request
  • <leader>aa pick and run request
  • <leader>ao open result pane
  • <leader>ae select environment
  • <leader>aE show environment
  • <leader>ac edit cookies
  • <leader>al open logs

Scratchpad

  • <leader>e toggle scratchpad
  • <leader>E select scratchpad

Zen mode

  • <leader>z toggle zen mode
  • <c-w>z toggle zoom

Application

  • <leader>na autocmds
  • <leader>nh help
  • <leader>nH highlights
  • <leader>nk keymaps
  • <leader>nn vim-messages
  • <leader>nc clear vim-messages

© 2024 Rui Costa, MIT License

About

There are many like it, but this one is mine.

Resources

Stars

42 stars

Watchers

2 watching

Forks

Used by

Contributors

Languages