summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Teu <julianteule@gmail.com>2018-04-11 17:26:39 +0200
committerJulian Teu <julianteule@gmail.com>2018-04-11 17:26:39 +0200
commit48752256339630c65fa7535690eb6cc2e45b59ba (patch)
tree03efa342fbaef908e4b031546b62b88195fd0d9c
parentf20306559de79548ec4a58d20cf7e546d61939d0 (diff)
Added cool ge gb commands to go to end and begin of object
-rw-r--r--.vimrc25
1 files changed, 25 insertions, 0 deletions
diff --git a/.vimrc b/.vimrc
index 80d00bb..fb8672e 100644
--- a/.vimrc
+++ b/.vimrc
@@ -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>