Skip to content

Commit

Permalink
added backupdir,undodir,key mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
kn1cht committed Jun 1, 2016
1 parent d33dfb1 commit 9558e8c
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,32 @@ set whichwrap=b,s,h,l,<,>,[,]
autocmd BufWritePre * :%s/\s\+$//ge
autocmd BufWritePre * :%s/\t/ /ge
"---------------------------------------------------------------------------
" history
if !isdirectory(expand("~/.vim/backupdir/"))
silent !echo "Creating backup dir..."
silent !mkdir -p ~/.vim/backupdir
endif
if !isdirectory(expand("~/.vim/swap/"))
silent !echo "Creating swap dir..."
silent !mkdir -p ~/.vim/swap
endif
if !isdirectory(expand("~/.vim/undo/"))
silent !echo "Creating undo dir..."
silent !mkdir -p ~/.vim/undo
endif
set backupdir^=~/.vim/backup/
set undodir^=~/.vim/undo/

" 表示行単位で上下移動するように
nnoremap j gj
nnoremap k gk
nnoremap <Down> gj
nnoremap <Up> gk
" 逆に普通の行単位で移動したい時のために逆の map も設定しておく
nnoremap gj j
nnoremap gk k
" Shift+hjklで移動量を大きく
noremap H 3h
noremap J 3j
Expand Down

0 comments on commit 9558e8c

Please sign in to comment.