Skip to content

Instantly share code, notes, and snippets.

@weirdwater
Created September 3, 2021 12:18
Show Gist options
  • Save weirdwater/0cbe3a2fc67349250601fb666ba21f22 to your computer and use it in GitHub Desktop.
Save weirdwater/0cbe3a2fc67349250601fb666ba21f22 to your computer and use it in GitHub Desktop.
Vim configuration
" GENERAL
set nocompatible "Needed to use Vim commands, otherwise compatible with Vi
set encoding=utf-8
set nobackup "Only creates backups while saving
set swapfile "Creates a swapfile when editing
set undofile "Persists changes between edits
set backupdir=~/.vim/.backup//
set directory=~/.vim/.swp//
set undodir=~/.vim/.undo//
set autochdir "Automatically change working directory to open file
set noerrorbells
set visualbell
set history=1000
set autoread "Notifies whether the file has been changed while opened
set wildmenu "Shows autocomplete for operations
set wildmode=longest:list,full "First shows entire list of options, then cycles through
" EDITOR
syntax on "Enables code highlighting
set t_Co=256
set showmatch "highlights matching characters, e.g. (), {}, []
set wrap "Lines will automatically wrap
set number "Shows linenumbers
set relativenumber "Linenumbers are relative to cursor
set cursorline "Current selected line is highlighted
" INDENTATION
filetype indent on "Looks up standard indentation rules in ~/.vim/indent/<language>.vim
set autoindent
set tabstop=2 "Number of spaces tabs are displayed as
set shiftwidth=2 "Number of characters per level of indentation
set expandtab "Turns tabs into spaces
set softtabstop=2 "How many spaces to use when expanding tabs
" STATUSBAR
set laststatus=2 "Always shows the statusbar
set showmode "Show current mode at the bottom
set showcmd "Shows current command composition
set ruler "Shows location of cursor
" SEARCH
set hlsearch "Highlight match while searching
set incsearch "Automatically jumps to match while entering pattern
set ignorecase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment