Skip to content
Browse files

use viminfo to save settings on exit

  • Loading branch information...
1 parent edae503 commit 6e27b24426c44df5855768d95458156ba0f3e2f3 @nocash committed
Showing with 11 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +10 −0 .vimrc
View
1 .gitignore
@@ -1,3 +1,4 @@
.netrwhist
tags
tags-ja
+.viminfo
View
10 .vimrc
@@ -12,6 +12,13 @@ syntax on
filetype plugin indent on
"-- Files & Directories ---------------------------------------------------
+" Tell vim to remember certain things when we exit
+" +-> Remember marks for up to # previously edited files
+" | +-> Save up to # lines for each register
+" | | +-> Remember up to # lines of command-line history
+" | | | +-> Saves and restores the buffer list
+" | | | | +-> Where to save the viminfo files
+set viminfo='10,\"100,:20,%,n~/.vim/.viminfo
set autochdir " automatically change working directory
set directory=~/.vim/tmp " store swap files in a single directory
set nobackup " do not make backups
@@ -217,6 +224,9 @@ augroup Miscellaneous
" Change PHP indenting (I just can't get used to two spaces with all of
" those brackets).
autocmd Filetype php setlocal sts=4 sw=4
+ " Restore cursor to last known position when opening a previously edited
+ " file.
+ autocmd BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
augroup END
"}}}

0 comments on commit 6e27b24

Please sign in to comment.
Something went wrong with that request. Please try again.