summaryrefslogtreecommitdiffstats
path: root/vimrc
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2017-10-28 17:16:14 -0400
committerJesse Luehrs <doy@tozt.net>2017-10-29 02:01:52 -0400
commita6d912e02f5c6a8fcd1fb8a52854fcb9782ed07e (patch)
tree3e7a2a7309329dea61a8a8c9f54fec5c45850150 /vimrc
parentcade34d8b4fa0963ab837e0c85f578627c9cee68 (diff)
downloadconf-a6d912e02f5c6a8fcd1fb8a52854fcb9782ed07e.tar.gz
conf-a6d912e02f5c6a8fcd1fb8a52854fcb9782ed07e.zip
simplify
Diffstat (limited to 'vimrc')
-rw-r--r--vimrc33
1 files changed, 6 insertions, 27 deletions
diff --git a/vimrc b/vimrc
index f0e672c..96bb14b 100644
--- a/vimrc
+++ b/vimrc
@@ -459,37 +459,16 @@ xnoremap <silent>K :call Help(1, [], '<SID>man')<CR>
" }}}
" auto-append closing characters {{{
function s:move_cursor_left()
- let l:pos = getcurpos()
- let l:newpos = [
- \ l:pos[0],
- \ l:pos[1],
- \ l:pos[2] - 1,
- \ l:pos[3],
- \ l:pos[2] - 1,
- \]
- call setpos('.', l:newpos)
+ let [l:bufnr, l:lnum, l:col, l:off, l:curswant] = getcurpos()
+ call setpos('.', [l:bufnr, l:lnum, l:col - 1, 0, l:col - 1])
endfunction
function s:move_cursor_right()
- let l:pos = getcurpos()
- let l:newpos = [
- \ l:pos[0],
- \ l:pos[1],
- \ l:pos[2] + 1,
- \ l:pos[3],
- \ l:pos[2] + 1,
- \]
- call setpos('.', l:newpos)
+ let [l:bufnr, l:lnum, l:col, l:off, l:curswant] = getcurpos()
+ call setpos('.', [l:bufnr, l:lnum, l:col + 1, 0, l:col + 1])
endfunction
function s:move_cursor_to_pos(lnum, col)
- let l:pos = getcurpos()
- let l:newpos = [
- \ l:pos[0],
- \ a:lnum,
- \ a:col,
- \ 0,
- \ a:col,
- \]
- call setpos('.', l:newpos)
+ let [l:bufnr, l:lnum, l:col, l:off, l:curswant] = getcurpos()
+ call setpos('.', [l:bufnr, a:lnum, a:col, 0, a:col])
endfunction
let s:pair_bs_maps = {
\ '"': "<SID>maybe_remove_adjacent_char('\"')",