aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--autoload/grappele.vim5
-rw-r--r--plugin/grappele.vim13
2 files changed, 15 insertions, 3 deletions
diff --git a/autoload/grappele.vim b/autoload/grappele.vim
index f9c7bd3..74af532 100644
--- a/autoload/grappele.vim
+++ b/autoload/grappele.vim
@@ -4,10 +4,13 @@ function! grappele#Grappele(line, ...)
let l:column_offset = 0
let l:mode = get(a:, 1, '')
+ let l:visualmode = get(a:, 2, '')
normal! m'
if l:mode ==# 'v'
+ execute 'normal! ' . l:visualmode
+ elseif l:mode ==# 'o'
normal! V
endif
@@ -28,6 +31,6 @@ endfunction
function! grappele#Recall(mode)
if exists('s:line')
- call grappele#Grappele(s:line, a:mode)
+ call grappele#Grappele(s:line, a:mode, visualmode())
endif
endfunction
diff --git a/plugin/grappele.vim b/plugin/grappele.vim
index a0f0aa2..9ab1400 100644
--- a/plugin/grappele.vim
+++ b/plugin/grappele.vim
@@ -4,13 +4,22 @@ endif
let g:loaded_grappele = 1
-nnoremap <silent> <Plug>Grappele :<c-u>call grappele#Grappele(v:count)<cr>
+nnoremap <silent> <Plug>Grappele :<c-u>call grappele#Grappele(v:count, 'n')<cr>
nnoremap <silent> <Plug>GrappeleRecall :<c-u>call grappele#Recall('n')<cr>
vnoremap <silent> <Plug>GrappeleRecall :<c-u>call grappele#Recall('v')<cr>
onoremap <silent> <Plug>GrappeleRecall :<c-u>call grappele#Recall('o')<cr>
if !hasmapto('<Plug>Grappele') || !maparg('G', 'n')
- nnoremap <silent> G :<c-u>call grappele#Grappele(v:count)<cr>
+ nnoremap <silent> G :<c-u>call grappele#Grappele(v:count, 'n')<cr>
+endif
+
+if !hasmapto('<Plug>Grappele') || !maparg('G', 'v')
+ vnoremap <silent> G
+ \ :<c-u>call grappele#Grappele(v:count, 'v', visualmode())<cr>
+endif
+
+if !hasmapto('<Plug>Grappele') || !maparg('G', 'o')
+ onoremap <silent> G :<c-u>call grappele#Grappele(v:count, 'o')<cr>
endif
if !hasmapto('<Plug>GrappeleRecall') || !maparg('gG', 'n')