Vim Configuration & Notes (~/.vimrc)

My personal Vim setup and useful commands.

Basic Settings

" Show line numbers and relative numbers set number set relativenumber

" Enable mouse support in all modes set mouse=a

" Enable syntax highlighting and filetype detection syntax on filetype plugin indent on

" Other preferences set tabstop=4 set shiftwidth=4 set expandtab set ignorecase set smartcase

Key Mappings

" Leader key let mapleader = " " " Use Space as leader

" Save file nnoremap w :w

" Quit window/buffer nnoremap q :q

" Easy escape in insert mode inoremap jk

" Navigate splits nnoremap h nnoremap j nnoremap k nnoremap l

Plugin Management (vim-plug)

<span class="code-line">call plug#begin('~/.vim/plugged')</span>
<span class="code-line"> </span>
<span class="code-line">" Appearance</span>
<span class="code-line">Plug 'morhetz/gruvbox' " Theme</span>
<span class="code-line">Plug 'vim-airline/vim-airline' " Status line</span>
<span class="code-line"> </span>
<span class="code-line">" Functionality</span>
<span class="code-line">Plug 'tpope/vim-fugitive'   " Git wrapper</span>
<span class="code-line">Plug 'tpope/vim-surround'   " Surroundings</span>
<span class="code-line">Plug 'junegunn/fzf.vim'    " Fuzzy finder</span>
<span class="code-line">Plug 'preservim/nerdtree'  " File explorer</span>
<span class="code-line"> </span>
<span class="code-line">call plug#end()</span>
<span class="code-line"> </span>
<span class="code-line">" Theme setup</span>
<span class="code-line">if exists("+termguicolors")</span>
<span class="code-line">  set termguicolors</span>
<span class="code-line">endif</span>
<span class="code-line">colorscheme gruvbox</span>

Useful Commands

Command Mode(s) Description
:w Normal Write (save) the file
:q Normal Quit the current window
:wq / :x Normal Write and quit
:q! Normal Quit without saving
dd Normal Delete current line
yy Normal Yank (copy) current line
p / P Normal Paste after/before cursor
u Normal Undo
<C-r> Normal Redo
/pattern Normal Search forward for pattern
?pattern Normal Search backward for pattern
n / N Normal Next/Previous search match
:NERDTree Normal Open file explorer (plugin)
:FZF Normal Open fuzzy finder (plugin)

Notes & Tips

Use :help <command> or :help <topic> to get help on anything in Vim. Example: :help motion

Visual mode (v, V, <C-v>) is powerful for selecting text to operate on.

" Last saved: {{formatDate}} {{formatTime}}


This document was styled using the vim theme with stylemd. Get the tool here: https://github.com/ddukbg/stylemd

-- NORMAL -- example.md
Ln 1, Col 1 100% unix [utf-8]