diff --git a/plugin/makecols.vim b/plugin/makecols.vim index 5fa1f53..18277a3 100644 --- a/plugin/makecols.vim +++ b/plugin/makecols.vim @@ -64,10 +64,9 @@ endfunction function! s:makecols(options) range let options = a:options - let orientation = options[0] - echom "Orientation: " . orientation + echom "Orientation: " . g:orientation let cols = options[1] - echom "Number of Columns: " . cols + echom "Number of Columns: " . g:cols let mode = visualmode() if (mode !=# "V") echo "You must be in linewise visual mode" @@ -82,9 +81,14 @@ function! s:makecols(options) range endfunction -vnoremap mch :call makecols(["horz", 5]) -vnoremap mcv :call makecols(["vert", 5]) +vnoremap mc :call makecols() +if exists(g:makecols_orientation) || ! g:makecols_orientation) + let g:makecols_orientation = "horz" +endif +if exists(g:makecols_cols) || ! g:makecols_cols) + let g:makecols_cols = "5" +endif