aboutsummaryrefslogtreecommitdiffstats
path: root/autoload/grappele.vim
diff options
context:
space:
mode:
authorTeddy Wing2018-12-13 13:49:40 +0100
committerTeddy Wing2018-12-13 13:49:40 +0100
commit1926fc6c9fb6f724660a495f23afccc0830de069 (patch)
treecaba57c8987b2052d588ade1bf21cddaf47f9769 /autoload/grappele.vim
parent8b5481b9de6a72a6eede405dda8fb158d5358941 (diff)
downloadvim-grappele-1926fc6c9fb6f724660a495f23afccc0830de069.tar.bz2
Add operator-pending and visual mode mappings
New mappings that allow the stored `G` position to be used in both visual mode and operator-pending mode for greater flexibility.
Diffstat (limited to 'autoload/grappele.vim')
-rw-r--r--autoload/grappele.vim16
1 files changed, 11 insertions, 5 deletions
diff --git a/autoload/grappele.vim b/autoload/grappele.vim
index 9139116..f9c7bd3 100644
--- a/autoload/grappele.vim
+++ b/autoload/grappele.vim
@@ -1,10 +1,16 @@
-function! grappele#Grappele(line)
+function! grappele#Grappele(line, ...)
let l:current_buffer = 0
let l:column_position = 0
let l:column_offset = 0
-
+
+ let l:mode = get(a:, 1, '')
+
normal! m'
-
+
+ if l:mode ==# 'v'
+ normal! V
+ endif
+
if a:line ==# 0
" Go to the end of the buffer
$
@@ -20,8 +26,8 @@ function! grappele#Grappele(line)
endif
endfunction
-function! grappele#Recall()
+function! grappele#Recall(mode)
if exists('s:line')
- call grappele#Grappele(s:line)
+ call grappele#Grappele(s:line, a:mode)
endif
endfunction