From 4a2364e38ee902d1d1d4ad6fe8fca902f98a7f13 Mon Sep 17 00:00:00 2001 From: Joseph Groocock Date: Tue, 10 May 2016 17:07:08 +0100 Subject: [PATCH] Add Dvorak Vim keybindings stolen from sporkbox/vimrc --- .vimrc | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 83 insertions(+), 3 deletions(-) diff --git a/.vimrc b/.vimrc index 7d47d78..68c597e 100644 --- a/.vimrc +++ b/.vimrc @@ -14,6 +14,9 @@ set encoding=utf-8 set background=dark set guifont=Sauce\ Code\ Pro\ 10.6 +" Change to dvorak-mapped keys +let g:use_dvorak = 1 + " set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() @@ -22,6 +25,7 @@ Plugin 'VundleVim/Vundle.vim' Plugin 'Valloric/YouCompleteMe' Plugin 'scrooloose/syntastic' Plugin 'tpope/vim-sensible' +Plugin 'vim-scripts/vim-auto-save' Plugin 'airblade/vim-gitgutter' Plugin 'ryanoasis/vim-devicons' Plugin 'vim-airline/vim-airline' @@ -37,6 +41,84 @@ let g:ycm_server_python_interpreter = '/usr/bin/python3' let g:Powerline_symbols = 'fancy' let g:airline_powerline_fonts = 1 let g:airline_theme='solarized' +let g:airline#extensions#tabline#enabled = 1 + +" vim-auto-save +let g:auto_save = 1 " enable AutoSave on Vim startup + +let mapleader="\" + +" Dvorak Hackery +" Source: https://github.com/sporkbox/vimrc/blob/master/vimrc +if (exists("g:use_dvorak") && g:use_dvorak == 1) + " I use a Dvorak keyboard, so standard vim movement keys are a hassle. + " Since mnemonics are helpful all around, I need a mapping that gives me + " pain-free file navigation without screwing up mnemonics (too much). + " + " Thus: + " (D)elete is now (K)ill: d2w == k2w "kill 2 words" + " Un(T)il is now (J)ump-To: dt( == kj( "kill, jump-to paren" + " (N)ext is now (L)eap: cn == cl "change up to leap point" + + " Standard movement, which is the true focus of this hack. + " Mnemonics are awesome, so let's preserve as much as possible. + noremap d h + noremap h j + noremap t k + noremap n l + noremap D H + noremap H J + noremap T K + noremap N L + + noremap gh gj + noremap gt gk + + " I work with tabs every now and then. No, I don't have a mnemonic, so + " stfu. + noremap gj gt + noremap gJ gT + + " Window movement, equally important + noremap d h + noremap h j + noremap t k + noremap n l + + nnoremap + nnoremap + nnoremap + nnoremap + + "nnoremap h + "nnoremap j + "nnoremap k + "nnoremap l + + " Account for tag jumping + nnoremap + + " Remappings for the D key + noremap k d + noremap K D + + " Remappings for the T key + noremap j t + noremap J T + + " Remapping for the L key + noremap l n + noremap L N + + " General purpose help; the originals remain for convenience + noremap - 0 + noremap _ $ + + " Fold-related keybindings + noremap zh zj + noremap zt zk + +endif " Interface with system clipboard noremap y "*y @@ -44,6 +126,7 @@ noremap p "*p noremap Y "+y noremap P "+p +noremap q :wq com W w com Q q com Wq wq @@ -51,6 +134,3 @@ com WQ wq " Write with sudo cmap w!! w !sudo tee > /dev/null % - -" airline buffer list -let g:airline#extensions#tabline#enabled = 1