" disable history file
let g:netrw_dirhistmax = 0

" vim-plug
call plug#begin()
Plug '~/.vim/vim-fish'
Plug '~/.vim/vim-ps1'
call plug#end()

" lifekeeper
set number
syntax on
filetype plugin indent on
set belloff=all

" tab settings
set tabstop=4
set shiftwidth=4
set expandtab
set mouse=


" " this plugin not installed
map <C-n> :NERDTreeToggle<CR>
" " nerdtree: autolaunch and autoclose.
" autocmd vimenter * NERDTree
" autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif

au BufNewFile,BufRead SCons* set filetype=scons

" echo "(>^.^<)"
map - ddp
map + ddkP
map <C-d> daw
nnoremap <C-o> o<Esc>I

" Ctrl-F search
set hlsearch
map <C-f> viwyk/<C-r>"<CR>
set mouse=

" my private flow file format
au BufRead,BufNewFile *.flow set filetype=flow


" """""""""""""""""""""" BEGIN edit GPG file """"""""""""""""""""""""""""""
" " Don't save backups of *.gpg files
" set backupskip+=*.gpg
" " To avoid that parts of the file is saved to .viminfo when yanking or
" " deleting, empty the 'viminfo' option.
" set viminfo=
" 
" augroup encrypted
"   au!
"   " Disable swap files, and set binary file format before reading the file
"   autocmd BufReadPre,FileReadPre *.gpg
"     \ setlocal noswapfile bin
"   " Decrypt the contents after reading the file, reset binary file format
"   " and run any BufReadPost autocmds matching the file name without the .gpg
"   " extension
"   autocmd BufReadPost,FileReadPost *.gpg
"     \ execute "'[,']!gpg --decrypt --default-recipient-self" |
"     \ setlocal nobin |
"     \ execute "doautocmd BufReadPost " . expand("%:r")
"   " Set binary file format and encrypt the contents before writing the file
"   autocmd BufWritePre,FileWritePre *.gpg
"     \ setlocal bin |
"     \ '[,']!gpg --encrypt --default-recipient-self
"   " After writing the file, do an :undo to revert the encryption in the
"   " buffer, and reset binary file format
"   autocmd BufWritePost,FileWritePost *.gpg
"     \ silent u |
"     \ setlocal nobin
" augroup END
" """""""""""""""""""""" END edit GPG file """"""""""""""""""""""""""""""

