From 630c85719fb52e3edb9c98a04a716d956223c9d0 Mon Sep 17 00:00:00 2001 From: johannst Date: Wed, 19 Oct 2016 16:21:52 +0200 Subject: added vi movement in bash; vim changed keymaps to be non-recursive and changed layout of quickfix window, added auto save/restore (but currently disabled) --- .vimrc | 35 +++++++++++++++++++++-------------- bashrc | 2 ++ inputrc | 5 +++++ 3 files changed, 28 insertions(+), 14 deletions(-) create mode 100644 inputrc diff --git a/.vimrc b/.vimrc index 4ef1ef0..9a42a8e 100644 --- a/.vimrc +++ b/.vimrc @@ -61,6 +61,9 @@ set nocompatible " make vim less vi "}}} +"autocmd VimEnter * silent! source .vim_last_session +"autocmd QuitPre * mksession! .vim_last_session + function! TriggerSCons(arg_string) let base_cmd = "scons -u " let &makeprg=base_cmd.a:arg_string @@ -100,6 +103,7 @@ set backspace=2 " had some issues with BS on empty line didn't del set noautowrite " never write a file unless I request it. set noautowriteall " NEVER. set noautoread " don't automatically re-read changed files. +set nowrap " Line/Column settings set number " Display line numbers @@ -152,36 +156,39 @@ set noerrorbells set novisualbell " automatically open Quickfix -autocmd QuickFixCmdPost [^l]* nested cwindow -autocmd QuickFixCmdPost l* nested lwindow +autocmd QuickFixCmdPost [^l]* nested botright cwindow +autocmd QuickFixCmdPost l* nested botright lwindow "{{{ Keymaps + " unset . +" noremap . " set leader key "execute "set =\es" let mapleader=";" " re-source .vimrc - map v :source ~/.vimrc + nnoremap v :source ~/.vimrc "remap esc button - imap jj +" inoremap + inoremap jj " quit buffer noremap q :bd " re-adjust indentation - map f mzgg=G`z + nnoremap f mzgg=G`z " navigate between different splits - map j - map k - map l - map h - map j - map k - map l - map h + nnoremap j + nnoremap k + nnoremap l + nnoremap h + nnoremap j + nnoremap k + nnoremap l + nnoremap h " resize splits "map 5- @@ -210,7 +217,7 @@ autocmd QuickFixCmdPost l* nested lwindow " add a marker fold snippet (for C/C++) nnoremap o//{{{ o//}}}A - imap + inoremap o//{{{ o//}}}A " only works with v-block (not v-line) vnoremap VV''>o//}}}'<A diff --git a/bashrc b/bashrc index 37f2f60..db0ff88 100644 --- a/bashrc +++ b/bashrc @@ -6,6 +6,8 @@ if [ "$TERM" == "screen" ]; then export TERM=screen-256color; fi if [ "$TERM" == "xterm" ]; then export TERM=xterm-256color; fi +# enable vi mode (use 'bind -P' to see bindings) +set -o vi # disable sticky mode stty -ixon diff --git a/inputrc b/inputrc new file mode 100644 index 0000000..06ef8a9 --- /dev/null +++ b/inputrc @@ -0,0 +1,5 @@ +# dotfiles -- inputrc +# author: johannst + +set keymap vi-insert +"jj": vi-movement-mode -- cgit v1.2.3