.vimrc Cheat Sheet

This cheat sheet is based on your current .vimrc configuration. It provides a quick reference for the custom settings, key mappings, and plugin configurations.

General Settings


syntax enable          " Enable syntax highlighting
filetype plugin on     " Enable filetype-specific plugins

let mapleader = '\'    " Set the leader key to backslash
set autoread           " Auto-read file changes from outside
set belloff=all        " Disable beeping
set cursorcolumn       " Highlight current column
set cursorline         " Highlight current row
set formatoptions-=rot  " Disable auto-comment insertion
set hidden             " Allow background buffers
set nolist             " Don't show invisible characters
set nocompatible       " Enable Vim improvements
set number             " Show line numbers
set path+=** " Search globally in subdirectories
set relativenumber     " Show relative line numbers
set ruler              " Show cursor position
set scrolloff=10       " Keep 10 lines above/below cursor
set showmatch          " Show matching brackets
set splitright         " Split windows to the right
set term=xterm-256color " Enable 256 colors
set wildmenu           " Enable enhanced command-line completion
set colorcolumn=       " Disable color column
set nowrap             " Disable word wrapping
set gdefault           " 's' command uses 'g' flag by default
set hlsearch           " Highlight search results
set ignorecase         " Ignore case in searches
set incsearch          " Enable incremental search
set smartcase          " Case-sensitive search with capitals
set tabstop=4          " Tab width = 4
set softtabstop=4      " Tab width when editing = 4
set shiftwidth=4       " Indentation width = 4
set expandtab          " Use spaces for tabs
    

নম্বর Key Mappings

These key mappings provide shortcuts for common Vim actions. \ refers to the leader key (backslash in your configuration).

Key Combination Description
<F5> Toggle invisible characters (eol, tabs, etc.)
<leader>nn Open notes index and set notes directory
<leader>[ Grep (search) inside notes files
<leader><Space> Disable search highlighting
<leader>C Toggle cursor line and column highlighting
<Ctrl> + <Left Arrow> Navigate to previous buffer
<Ctrl> + <Right Arrow> Navigate to next buffer
<leader>b Open FZF buffer list
<leader>m Open file marks
<leader>a Abandon (close without saving) current buffer
<leader>c Close current buffer
<Ctrl> + s Save current buffer
<Ctrl> + x Copy to system clipboard
<Alt> + <Up Arrow> Navigate to pane above
<Alt> + <Down Arrow> Navigate to pane below
<Alt> + <Left Arrow> Navigate to pane on the left
<Alt> + <Right Arrow> Navigate to pane on the right
<Esc> + x Close current pane
<leader><leader> Open FZF file list
<leader>g Open FZF Git file list
<leader>f Open FZF with current word pre-populated
<leader>w Toggle line wrapping
<leader>n Toggle line numbers
<Ctrl> + k Bubble single line up
<Ctrl> + j Bubble single line down
j Move cursor down one displayed line
k Move cursor up one displayed line
<F2> Insert current date and time
<F3> Insert current date and day of week
<C-S-i> Insert current date and day of week (alternate)
<F4> Insert current date
<F10> Toggle spellcheck
,ban Insert section banner template
,begend Insert section begin/end template
,sh Insert shell script header template
,rl Insert reading list header
,md Insert markdown file header

Plugin Configuration

These are the configurations for the Vim plugins managed by VimPlug.

VimPlug

A minimalist Vim plugin manager. See: https://github.com/junegunn/vim-plug

vim-sensible

A set of sane defaults. See: https://github.com/tpope/vim-sensible

vim-colorschemes

A collection of color schemes. See: https://github.com/flazz/vim-colorschemes

fzf and fzf.vim

Fuzzy finder. See: https://github.com/junegunn/fzf and https://github.com/junegunn/fzf.vim

FZF opens files in splits (<c-x>), vertical splits (<c-v>), and copies the result into the current buffer (<c-o>).

vim-fugitive

Git integration. See: https://github.com/tpope/vim-fugitive

vim-surround

Surrounding text objects. See: https://github.com/tpope/vim-surround

vim-markdown

Markdown support. See: https://github.com/preservim/vim-markdown

Configuration:


let g:markdown_fenced_languages = ['html', 'python', 'ini', 'vim', 'bash', 'yaml'] " Enable syntax highlighting for these languages in fenced code blocks.
set conceallevel=0 "  Show all markdown formatting.
let g:vim_markdown_strikethrough = 1 " Enable strikethrough.
let g:vim_markdown_follow_anchor = 1 "  Follow anchors.
let g:vim_markdown_auto_insert_bullets=0
let g:vim_markdown_new_list_item_indent=0
let g:vim_markdown_frontmatter = 1
let g:vim_markdown_folding_disabled = 1
au BufWinEnter * normal zR " Open folds by default
    

vim-spellsync

Spell file synchronization. See: https://github.com/micarmst/vim-spellsync

bullets.vim

Bullet list support. See: https://github.com/bullets-vim/bullets.vim


let g:bullets_enabled_file_types = [ 'markdown', 'gitcommit' ]
let g:bullets_outline_levels = ['num', 'abc', 'std*', 'std+', 'std-']
    

vim-airline

Statusline. See: https://github.com/vim-airline/vim-airline


let g:airline#extensions#tabline#enabled = 1
let g:airline_detect_theme_from_guicolors = 1
    

Colors

Colorscheme is set in ~/.vimcustom if it exists, otherwise defaults to darkburn.


hi cursorcolumn cterm=NONE ctermbg=black ctermfg=white
hi visual cterm=NONE ctermbg=lightyellow ctermfg=black
set fillchars=vert:\|,fold:.,diff:-
hi StatusLine    ctermfg=white ctermbg=darkgreen cterm=bold
hi StatusLineNC ctermfg=darkgray ctermbg=gray cterm=none
    

Netrw

Netrw buffer deletion:


autocmd FileType netrw setl bufhidden=delete
     

YAML

YAML settings:


autocmd BufNewFile,BufReadPost *.{yaml,yml} set filetype=yaml  foldmethod=indent
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
     

Templates

Markdown and Shell script templates


autocmd BufNewFile *.md so $HOME/.vim/templates/mdfm
autocmd BufNewFile *.md exe "g/^filecreated:.*/s//filecreated: " .strftime("%Y-%m-%d")
autocmd BufNewFile *.md exe "normal Go"
autocmd BufWritePre,filewritepre *.md execute "normal! ma"
autocmd BufWritePre,filewritepre *.md exe "g/^fileupdated:.*/s//fileupdated: " .strftime("%Y-%m-%d")
autocmd BufWritePost,filewritepost *.md execute "normal! `a"

autocmd BufNewFile *.sh so $HOME/.vim/templates/sh
autocmd BufNewFile *.sh :%s/filename/\=expand('%:t:r')/g
autocmd BufNewFile *.sh exe "g/CREATED:.*/s//CREATED: " .strftime("%Y-%m-%d")
autocmd BufNewFile *.sh exe "normal Go"
autocmd BufWritePre,filewritepre *.sh execute "normal ma"
autocmd BufWritePre,filewritepre *.sh exe "g/UPDATED:.*/s//UPDATED: " .strftime("%Y-%m-%d")
autocmd bufWritePost,filewritepost *.sh execute "normal `a"