File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -29,9 +29,23 @@ inoremap <expr> <C-E> col('.')>strlen(getline('.'))<bar><bar>pumvisible()?"\<Lt>
29
29
inoremap <expr> <C-F> col('.')>strlen(getline('.'))?"\<Lt> C-F>":"\<Lt> Right>"
30
30
cnoremap <expr> <C-F> getcmdpos()>strlen(getcmdline())?&cedit:"\<Lt> Right>"
31
31
32
- noremap ! <expr> <SID> transposition getcmdpos()>strlen(getcmdline())?"\<Left> ":getcmdpos()>1?'':"\<Right> "
33
- noremap ! <expr> <SID> transpose "\<BS> \<Right> ".matchstr(getcmdline()[0 : getcmdpos()-2], '.$')
34
- cmap <script> <C-T> <SID> transposition<SID> transpose
32
+ function ! s: transpose () abort
33
+ let pos = getcmdpos ()
34
+ if getcmdtype () == # ' /'
35
+ return " \<C-T> "
36
+ elseif pos > strlen (getcmdline ())
37
+ let pre = " \<Left> "
38
+ let pos -= 1
39
+ elseif pos <= 1
40
+ let pre = " \<Right> "
41
+ let pos += 1
42
+ else
43
+ let pre = " "
44
+ endif
45
+ return pre . " \<BS>\<Right> " .matchstr (getcmdline ()[0 : pos- 2 ], ' .$' )
46
+ endfunction
47
+
48
+ cnoremap <expr> <C-T> <SID> transpose()
35
49
36
50
if exists (' g:rsi_no_meta' )
37
51
finish
You can’t perform that action at this time.
0 commit comments