Skip to content

Instantly share code, notes, and snippets.

@abrahamcuenca
Last active March 14, 2026 23:03
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 - Vim configuration
" Last updated: 2023-03-14
" 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<Tab> 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
colorscheme darkblue
syntax on
set relativenumber
set encoding=UTF-8
set smarttab
set smartindent
set tabstop=4 softtabstop=4
set shiftwidth=4
set expandtab
set re=0
set nowrap
set noswapfile
set scrolloff=8
set guicursor=
set ignorecase
set smartcase
set incsearch
set hlsearch
set path+=**
set wildmenu
set wildignore+=*/node_modules/*,*.pyc,*.o
set grepprg=grep\ -nH\ $*
set mouse=a
set nocompatible
filetype plugin indent on
set hidden
set nowrap
set number
set ruler
set showcmd
set splitright
set splitbelow
set tags=./tags,tags;
set tagstack
set tagrelative
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/*,*.o,*.a,*.so,*.class
if executable('rg')
set grepprg=rg\ --vimgrep\ --smart-case\ --hidden
set grepformat=%f:%l:%c:%m,%f:%l:%m
endif
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 .
let mapleader=" "
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>
nnoremap <leader>fw :Grep <C-r><C-w><CR>
nnoremap <leader>fv :execute 'vimgrep /' . expand('<cword>') . '/gj **/*' <bar> copen<CR>
nnoremap ]q :cnext<CR>zz
nnoremap [q :cprev<CR>zz
nnoremap ]Q :cnewer<CR>
nnoremap [Q :colder<CR>
nnoremap <leader>co :copen<CR>
nnoremap <leader>cc :cclose<CR>
nnoremap ]l :lnext<CR>zz
nnoremap [l :lprev<CR>zz
nnoremap <leader>lo :lopen<CR>
nnoremap <leader>lc :lclose<CR>
nnoremap gf gf
nnoremap <leader>ff :find <C-r><C-w><CR>
nnoremap <leader>ii [I
nnoremap <leader>id [D
nnoremap <leader>h :nohlsearch<CR>
augroup my_quickfix_maps
autocmd!
autocmd FileType qf nnoremap <buffer> q :cclose<CR>
autocmd FileType qf nnoremap <buffer> J :cnext<CR>zz<C-w>w
autocmd FileType qf nnoremap <buffer> K :cprev<CR>zz<C-w>w
augroup END

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

Make sure to use modern Ctags

MacOS:
brew install --HEAD universal-ctags/universal-ctags/universal-ctags

Ubuntu/Debian:
sudo apt install universal-ctags

@abrahamcuenca
Copy link
Author

abrahamcuenca commented Mar 14, 2026

Vim 8.2 Quick Navigation Cheatsheet

Tags

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

Search

Command Purpose
/pattern Search forward in current file.
?pattern Search backward in current file.
n Repeat last search.
N Repeat last search opposite direction.
* Search forward for word under cursor.
# Search backward for word under cursor.
g* Search forward for partial word under cursor.
g# Search backward for partial word under cursor.
:nohlsearch Clear search highlight.

Project search

Command Purpose
:vimgrep /pattern/gj **/* Search project with Vim regex into quickfix.
:grep pattern -r . Search project with external grep into quickfix.
:copen Open quickfix window.
:cclose Close quickfix window.
:cnext Next quickfix result.
:cprev Previous quickfix result.
:cfirst First quickfix result.
:clast Last quickfix result.
:cwindow Open quickfix only if results exist.
:colder Older quickfix list.
:cnewer Newer quickfix list.

Location list

Command Purpose
:lvimgrep /pattern/gj **/* Search into location list.
:lgrep pattern -r . External grep into location list.
:lopen Open location list.
:lclose Close location list.
:lnext Next location-list result.
:lprev Previous location-list result.

File and include lookup

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

Tag setup

Command Purpose
ctags -R . Generate tags file for project.
set tags=./tags,tags; Find tags in current/project dirs.
set tagstack Enable tag jump history.
set tagrelative Use relative paths from tags file.
set path+=** Improve file lookup with :find and gf.

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