Last active
December 30, 2016 12:56
-
-
Save Jimilian/15d06bd3fd6eb346620a to your computer and use it in GitHub Desktop.
Vim settings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" 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