Skip to content

Instantly share code, notes, and snippets.

@danielcarr
Created November 17, 2015 19:59
Show Gist options
  • Save danielcarr/2c5714c91f67d98d9b81 to your computer and use it in GitHub Desktop.
Save danielcarr/2c5714c91f67d98d9b81 to your computer and use it in GitHub Desktop.
Vim config file
colorscheme slate
syntax on "syntax highlighting
set number "line numbers
set expandtab "use spaces for tab
set tabstop=4
set softtabstop=4
set shiftwidth=4
set shiftround "round indentation to a multiple of shiftwidth
set backspace=indent,eol,start "when to allow backspacing
set nowrap "turn off line wrapping by default
set scrolloff=5 "length from bottom at which to scroll
set autoindent
set ignorecase "Ignore case in searches
" Bring normal mode a little closer
inoremap § <esc>
" Key mappings
nnoremap <leader>ev :vsplit $MYVIMRC<cr>
nnoremap <leader>sv :source $MYVIMRC<cr>
" Torture yourself by disabling arrow keys
noremap <up> <nop>
noremap <down> <nop>
noremap <left> <nop>
noremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
" vimdiff specific settings
if &diff
colorscheme traffic_lights_diff
nnoremap <buffer> <leader>< :diffget RE<cr>]c
nnoremap <buffer> <leader>> :diffget LO<cr>]c
nnoremap <buffer> <leader>| :diffget BA<cr>]c
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment