Skip to content

Instantly share code, notes, and snippets.

@bds
Last active September 25, 2015 08:27
Show Gist options
  • Save bds/892357 to your computer and use it in GitHub Desktop.
Save bds/892357 to your computer and use it in GitHub Desktop.
Latest Vim settings
" Use Vim settings, rather than Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
set background=dark
set tabstop=2
set shiftwidth=2
set expandtab
set history=50 " keep 50 lines of command line history
set showmatch " show matching brackets
set ruler " show the cursor position all the time
" folding settings
set foldmethod=indent " fold based on indent
set foldnestmax=10 " deepest fold is 10 levels
set nofoldenable " dont fold by default
set foldlevel=1 " this is just what i use
" Code folding commands
" za - toggles
" zc - closes
" zo - opens
" zR - open all
" zM - close all
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
endif
if has("autocmd")
" Enable filetype detection
filetype plugin indent on
" Restore cursor position
autocmd BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment