Skip to content

Instantly share code, notes, and snippets.

@Jimilian
Last active December 30, 2016 12:56
Show Gist options
  • Save Jimilian/15d06bd3fd6eb346620a to your computer and use it in GitHub Desktop.
Save Jimilian/15d06bd3fd6eb346620a to your computer and use it in GitHub Desktop.
Vim settings
" Standard configuration
filetype plugin indent on
syntax on
set tabstop=4
set shiftwidth=4
set expandtab
" Enables paste mode
set pastetoggle=<F2>
" Save and run in python by Ctrl+P
map <C-p> :w<CR>:!python %<CR>
" Save and run in python with timer by Ctrl+T
map <C-t> :w<CR>:!time python %<CR>
fun! <SID>StripTrailingWhitespaces()
let l = line(".")
let c = col(".")
%s/\s\+$//e
call cursor(l, c)
endfun
" Remove trailing spaces on save
autocmd FileType c,cpp,java,php,ruby,python autocmd BufWritePre <buffer> :call <SID>StripTrailingWhitespaces()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment