Skip to content

Instantly share code, notes, and snippets.

@jspeis
Created June 24, 2015 16:36
Show Gist options
  • Save jspeis/d42b34bf655cf6003cd8 to your computer and use it in GitHub Desktop.
Save jspeis/d42b34bf655cf6003cd8 to your computer and use it in GitHub Desktop.
My old vimrc file
" Jonathan Speiser's vimrc file
" Based on Yosef Berman's vimrc file
:syntax on
:set number
:set nohlsearch
" indentation stuff
:set autoindent
:set expandtab
:set tabstop=4
:set softtabstop=4
:set shiftwidth=4
:set autoread
" exit from mode using ;;
:imap <C-c> <Esc>
" comment/uncomment
":command -range C <line1>,<line2>s/^/# /g
":command -range C <line1>,<line2>s/^/\/\/ /g
" make Executable, Run, Time how long it takes to run
:command E exec expand('!chmod +x "%" ')
:command R exec expand('!./"%" ')
:command T exec expand('!time ./"%" ')
" Set commenting/uncommenting scheme based on file extension
let ext=expand("%:e")
if ext == "py" || ext == "pl"
:command -range C <line1>,<line2>s/^/# /g
:command -range U <line1>,<line2>s/^\(\W*\)# /\1/g
elseif ext == "c" || ext == "cpp" || ext == "java"
:command -range C <line1>,<line2>s/^/\/\/ /g
:command -range U <line1>,<line2>s/^\(\W*\)\/\/ /\1/g
elseif ext == "cl" || ext == "lisp"
:command -range C <line1>,<line2>s/^/; /g
:command -range U <line1>,<line2>s/^\(\W*\); /\1/g
endif
:set paste
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment