Skip to content

Instantly share code, notes, and snippets.

@abrahamcuenca
Last active March 16, 2026 19:11
Show Gist options
  • Select an option

  • Save abrahamcuenca/676dd60c661eee0170d13cd8d2b7425d to your computer and use it in GitHub Desktop.

Select an option

Save abrahamcuenca/676dd60c661eee0170d13cd8d2b7425d to your computer and use it in GitHub Desktop.
Vanilla VIM setup
--languages=JavaScript,TypeScript,Java,SQL
--exclude=node_modules
--exclude=dist
--exclude=*.min.js
--exclude=reports
--exclude=coverage
--recurse=yes
--fields=+l
--fields=+K
--extras=+q
--sort=yes
" ~/.vimrc - minimal plain Vim 8.2 config
" Built-in navigation, search, quickfix, and ctags. No plugins.
set nocompatible
filetype plugin indent on
syntax on
colorscheme darkblue
" General
set encoding=utf-8
set hidden
set number
set relativenumber
set ruler
set showcmd
set mouse=a
set nowrap
set noswapfile
set scrolloff=8
set splitright
set splitbelow
" Indentation
set smarttab
set smartindent
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
" Search
set ignorecase
set smartcase
set incsearch
set hlsearch
" File/path completion
set wildmenu
set path+=**
set suffixesadd+=.c,.h,.cpp,.hpp,.cc,.hh,.py,.js,.ts,.tsx,.jsx,.go,.rs,.java
set wildignore+=*/.git/*,*/node_modules/*,*/dist/*,*/build/*,*/target/*,*.pyc,*.o,*.a,*.so,*.class
" Tags
set tags=./tags,tags;
set tagstack
set tagrelative
" Optional cursor override; leave enabled only if you like terminal behavior
set guicursor=
" Grep: use ripgrep if available, otherwise keep a simple grep fallback
if executable('rg')
set grepprg=rg\ --vimgrep\ --smart-case\ --hidden
set grepformat=%f:%l:%c:%m,%f:%l:%m
else
set grepprg=grep\ -nH\ $*
endif
" Custom commands
command! -nargs=+ Grep silent grep! <args> | copen
command! -nargs=+ LGrep silent lgrep! <args> | lopen
command! COpen copen
command! CClose cclose
command! LOpen lopen
command! LClose lclose
command! MakeTags !ctags -R .
" Leader
let mapleader=" "
" Tag navigation
nnoremap <leader>jd <C-]>
nnoremap <leader>jb <C-t>
nnoremap <leader>js g]
nnoremap <leader>jv <C-w>]
nnoremap <leader>jp :ptag <C-r><C-w><CR>
" Search / usages
nnoremap <leader>fw :Grep <C-r><C-w><CR>
nnoremap <leader>fv :execute

Vanilla VIM Setup

Description:

Personal Vim configuration focused on minimalism. No plugins used. Uses built-in commands and external tools (grep, find, ctags). For JS/TS development with fast file navigation, search, and function jumping.

Notes:

  • Use :e **/filename to find files
  • Use :vimgrep or :grep to search across files
  • Use buffers (:bnext/:bprev) or tabs (:tabnew) for file navigation
  • Use ctags + Ctrl-] / Ctrl-T to jump between functions
@abrahamcuenca
Copy link
Author

abrahamcuenca commented Mar 14, 2026

Vim 8.2 Cheatsheet

Minimal plain-Vim workflow for tags, search, quickfix, and file navigation.

  • Leader key: Space
  • Generate tags: :MakeTags or ctags -R .

Leader mappings

Keys Action
<Space>jd Jump to definition under cursor
<Space>jb Jump back from tag jump
<Space>js Show matching tags for symbol under cursor
<Space>jv Open definition in a split
<Space>jp Preview tag under cursor
<Space>fw Grep current word using :Grep
<Space>fv Search current word with :vimgrep and open quickfix
<Space>fu Find usages of current word as whole word and open quickfix
<Space>fg Grep current word using external grep and open quickfix
<Space>co Open quickfix window
<Space>cc Close quickfix window
<Space>cw Open quickfix only if it has results
<Space>lo Open location list
<Space>lc Close location list
<Space>ff :find file/name under cursor
<Space>ii List identifier matches in current file/includes
<Space>id List macro definitions
<Space>h Clear search highlight

Tags

Command Action
CTRL-] Jump to definition under cursor
CTRL-T Jump back through tag stack
g] Show matching tag entries
:tag Name Jump to named tag
:tjump Name Jump if one match, choose if many
:tselect Name List matching tag definitions
:tnext Next tag match
:tprevious Previous tag match
:tags Show tag stack
CTRL-W ] Open tag in split
:ptag Name Preview tag

Search in file

Command Action
/pattern Search forward
?pattern Search backward
n Repeat last search
N Repeat opposite direction
* Search forward for word under cursor
# Search backward for word under cursor
g* Search forward for partial word
g# Search backward for partial word
:nohlsearch Clear highlights

Project search

Command Action
:Grep pattern External grep into quickfix
:vimgrep /pattern/gj **/* Vim-native project search into quickfix
:grep pattern -r . Recursive grep into quickfix
:copen Open quickfix
:cclose Close quickfix
:cwindow Open quickfix only if results exist
:cnext Next quickfix result
:cprev Previous quickfix result
:cfirst First quickfix result
:clast Last quickfix result
:cnewer Newer quickfix list
:colder Older quickfix list

Location list

Command Action
:LGrep pattern External grep into location list
:lvimgrep /pattern/gj **/* Vim-native search into location list
:lopen Open location list
:lclose Close location list
:lnext Next location-list result
:lprev Previous location-list result

Quickfix movement mappings

Keys Action
]q Next quickfix item
[q Previous quickfix item
]Q Newer quickfix list
[Q Older quickfix list
]l Next location-list item
[l Previous location-list item

Quickfix window keys

Keys Action
q Close quickfix window
J Next quickfix item
K Previous quickfix item

File and include lookup

Command Action
gf Open file path under cursor
:find name Find file using 'path'
[I List identifier matches
[CTRL-I Jump to identifier match
[D List macro definitions
[CTRL-D Jump to macro definition
:checkpath Check missing include files

Setup

let mapleader=" "
set tags=./tags,tags;
set tagstack
set tagrelative
set path+=**

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment