diff options
author | Julian Teu <julianteule@gmail.com> | 2018-04-11 17:26:39 +0200 |
---|---|---|
committer | Julian Teu <julianteule@gmail.com> | 2018-04-11 17:26:39 +0200 |
commit | 48752256339630c65fa7535690eb6cc2e45b59ba (patch) | |
tree | 03efa342fbaef908e4b031546b62b88195fd0d9c | |
parent | f20306559de79548ec4a58d20cf7e546d61939d0 (diff) |
Added cool ge gb commands to go to end and begin of object
-rw-r--r-- | .vimrc | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -51,3 +51,28 @@ inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>" tnoremap <C-e> <C-\><C-n> + +" Map C-s +noremap <silent> <C-S> :update<CR> + +" Make ToBegin and ToEnd +function! InputChar() + let c = getchar() + return type(c) == type(0) ? nr2char(c) : c +endfunction + +function! ToEnd() + let s = InputChar() + if s =~ "\<esc>" || s =~ "\<c-c>" + return + endif + execute "normal! vi". s. "\<Esc>" +endfunction + +function! ToBegin() + call ToEnd() + execute "'<" +endfunction + +nnoremap <silent> ge :call ToEnd()<cr> +nnoremap <silent> gb :call ToBegin()<cr> |