Skip to content

Instantly share code, notes, and snippets.

@rabdill
Created September 17, 2018 20:47
Show Gist options
  • Save rabdill/87d708ddd953ea16efd7224fb311a33f to your computer and use it in GitHub Desktop.
Save rabdill/87d708ddd953ea16efd7224fb311a33f to your computer and use it in GitHub Desktop.
I am tired of losing my vi configuration every time I switch computers and forget about it.
" with thanks to https://github.com/amix/vimrc/blob/master/vimrcs/basic.vim
" highlighting!
syntax enable
" spaces not tabs
set expandtab
" tabs should be 4 spaces not 8:
set tabstop=4
set shiftwidth=4
set autoindent
set ruler
" highlight matching brackets
set showmatch
" set wordwrap:
set wm=5
" don't bother with swapfiles
set noswapfile
" Enable 256 colors palette in Gnome Terminal
if $COLORTERM == 'gnome-terminal'
set t_Co=256
endif
" Display the current mode:
set showmode
" teach backspace about linewrap
set backspace=eol,start,indent
set whichwrap+=<,>,h,l
" ignore case in search
set ignorecase
" Delete trailing white space on save
fun! CleanExtraSpaces()
let save_cursor = getpos(".")
let old_query = getreg('/')
silent! %s/\s\+$//e
call setpos('.', save_cursor)
call setreg('/', old_query)
endfun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment