From 1592841391c83680b114877a9c61b95f66a2b964 Mon Sep 17 00:00:00 2001 From: lolson Date: Fri, 10 Jul 2015 15:45:45 -0500 Subject: [PATCH] adding features --- plugin/makecols.vim | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/plugin/makecols.vim b/plugin/makecols.vim index 244bf1f..36583de 100644 --- a/plugin/makecols.vim +++ b/plugin/makecols.vim @@ -62,10 +62,15 @@ endfunction -function! s:makecols(orient) range +function! s:makecols(orient, cols) range let g:makecols_orientation = a:orient + if exists(v:count) + let g:makecols_cols = v:count + else + let g:makecols_cols = a:cols + endif echom "Orientation: " . g:makecols_orientation - echom "Number of Columns: " . v:count ? g:makecols_cols : 5 + echom "Number of Columns: " . g:makecols_cols let mode = visualmode() if (mode !=# "V") echo "You must be in linewise visual mode" @@ -80,9 +85,9 @@ function! s:makecols(orient) range endfunction -vnoremap mc :call makecols(g:makecols_orientation) -vnoremap mch :call makecols("horz") -vnoremap mcv :call makecols("vert") +vnoremap mc :call makecols(g:makecols_orientation, g:makecols_cols) +vnoremap mch :call makecols("horz", g:makecols_cols) +vnoremap mcv :call makecols("vert", g:makecols_cols) if !exists("g:makecols_orientation") || ! g:makecols_orientation let g:makecols_orientation = "horz"