From ea1ba78ef274e8602fa79f3c46fa2eff2eb9c360 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 1 Mar 2015 13:35:40 +0100 Subject: vimrc: misc Signed-off-by: Florian Pritz --- .vimrc | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.vimrc b/.vimrc index 49ab84c..59681e1 100644 --- a/.vimrc +++ b/.vimrc @@ -99,7 +99,13 @@ NeoBundleCheck "aliases cnorea w!! w !sudo tee "%" > /dev/null cnorea qpd %!perl -pe 's/\=([0-9A-Fa-f]{2})/chr(hex($1))/ge; s/\=\n//;' -com -range=% Fb :exec ",w !fb -e " . &filetype . " -n " . expand("%:t") +function Filebin(start, end) + let range = expand(a:start) . "," . expand(a:end) + silent exe expand(range) . "w !fb -n " . expand("%:t") . " -e " . expand(&ft) + redraw! +endfunction + +com! -nargs=0 -range=% Fb :call Filebin(, ) syntax on @@ -111,10 +117,8 @@ autocmd BufReadPost * \ exe "normal! g`\"" | \ endif -if !exists(":DiffOrig") - command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis - \ | wincmd p | diffthis -endif +command! DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis + \ | wincmd p | diffthis set runtimepath+=/usr/share/vim @@ -238,8 +242,10 @@ autocmd FileType python setlocal omnifunc=pythoncomplete#Complete autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags autocmd FileType php set foldmethod=syntax autocmd FileType php set foldlevelstart=2 foldnestmax=2 -autocmd FileType php let g:php_folding=2 -autocmd FileType php let g:php_htmlInStrings=1 +autocmd FileType php let g:php_folding=1 + +autocmd FileType python set foldmethod=indent +autocmd FileType python set foldlevelstart=2 foldnestmax=2 autocmd FileType make setlocal noexpandtab au FileType python set ts=4 sw=4 softtabstop=4 et @@ -274,9 +280,9 @@ au FileType tex map :!texi2pdf -c % nmap :call BlameCurrentLine() " Get the current line number & file name, view the git commit that inserted it fun! BlameCurrentLine() -let lnum = line(".") -let file = @% -exec "!gitBlameFromLineNo " lnum file + let lnum = line(".") + let file = @% + exec "!gitBlameFromLineNo " lnum file endfun map ggg?G``" apply rot13 for people snooping over shoulder, good fun -- cgit v1.2.3-24-g4f1b