Skip to content

Instantly share code, notes, and snippets.



Created Jun 6, 2014
What would you like to do?
"" Custom vim settings
"No need to be vi compatible.
:set nocompatible
:set incsearch "Turn on incremental searching
:set ignorecase "Ignore case when searching
:set smartcase "Ignore case when typing lowercase,
"otherwise match case
:set scrolloff=2 "Keep 2 lines of code before & after the cursor
"Indentation:set autoindent "Automatic line indentation
:set tabstop=4 "Set tab character to 4 characters
:set expandtab "Turn tabs into whitespace
:set shiftwidth=4 "Indent width for autoindent
"Shortcut to auto indent entire file
:nmap <F11> 1G=G
:imap <F11> <ESC>1G=Ga
"File handling
:set nobackup "Do not litter my working dir with backup files
"Line numbers
:set number "Turn on line numbering
"Line wrapping settings
:set wrap "Turn on line wrapping
:set textwidth=0 wrapmargin=0
:set ruler
:set statusline+=%F\ %l\:%c
"Split window navigation
:nnoremap <C-h> <C-w>h
:nnoremap <C-j> <C-w>j
:nnoremap <C-k> <C-w>k
:nnoremap <C-l> <C-w>l
"Color scheme
syntax on
:colorscheme darkblue
":set cursorline
":set cursorcolumn
"My shortcuts:
"Use , instead of :
map , :
"Go to end of line:
map <C-e> <esc>$<right>
imap <C-e> <esc>$i<right>
"Go to beginning of line:
map <C-a> <esc>0
imap <C-a> <esc>0i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment