FIX
You can configure a huge range of behaviors in your .vimrc
file to tailor Vim to your workflow. Here’s a categorized breakdown of what you can tweak:
Core Editor Behavior
set nocompatible
— disables legacy Vi compatibilitysyntax on
— enables syntax highlightingset number
— shows line numbersset cursorline
— highlights the current lineset showcmd
andset showmode
— display partial commands and current mode
Indentation & Tabs
set tabstop=4
— sets tab widthset shiftwidth=4
— sets indent widthset expandtab
— converts tabs to spacesset autoindent
andset smartindent
— auto-indent new lines
Search Behavior
set incsearch
— incremental searchset ignorecase
— case-insensitive searchset smartcase
— case-sensitive if uppercase usedset hlsearch
— highlights matches
UI & Display
set wrap
orset nowrap
— line wrappingset scrolloff=5
— keeps cursor centered verticallyset wildmenu
— enhanced command-line completioncolorscheme desert
— sets color theme
Plugins & Extensions
If using a plugin manager like vim-plug
, you can add:
call plug#begin('~/.vim/plugged')
Plug 'preservim/nerdtree' " File explorer
Plug 'dense-analysis/ale' " Linting
Plug 'vim-airline/vim-airline' " Status line
call plug#end()
Then run :PlugInstall
inside Vim.
Key Mappings
inoremap jj <Esc> " Exit insert mode with 'jj'
nnoremap <leader>w :w<CR> " Save with \w
nnoremap <F5> :w<CR>:!python3 %<CR> " Run Python script
Advanced Features
- Folding:
set foldmethod=indent
orsyntax
- Persistent Undo:
set undofile
andset undodir=~/.vim/undo
- Backup:
set backup
andset backupdir=~/.vim/backups
- Mouse Support:
set mouse=a
Example .vimrc
Starter
set nocompatible
syntax on
set number
set tabstop=4 shiftwidth=4 expandtab
set autoindent smartindent
set incsearch ignorecase smartcase hlsearch
set cursorline scrolloff=5
set wildmenu
colorscheme desert
inoremap jj <Esc>
nnoremap <F5> :w<CR>:!python3 %<CR>
ADD – Tailor for python, bash, expect, sql