diff --git a/vim/vimrc b/vim/vimrc index 2e323b5..b89514c 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -19,19 +19,6 @@ cmap :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> tran \ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" \ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">" -" Align cucumber tables -function! s:align() - let p = '^\s*|\s.*\s|\s*$' - if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p) - let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g')) - let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*')) - Tabularize/|/l1 - normal! 0 - call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.')) - endif -endfunction -inoremap :call align()a - " Quick editing of common dot-files map vv :edit $MYVIMRC map gg :edit $MYGVIMRC