mirror of
https://github.com/spf13/spf13-vim.git
synced 2024-09-21 07:27:11 +00:00
Customizable backup/swap/undo/views location
This was done in an effort to clean up the home directory and to maintain a more centralized location for all vim related files that are not touched often.
This commit is contained in:
parent
3d53a2bf96
commit
7e37213cfc
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,4 +1,4 @@
|
||||
.DS_Store
|
||||
*.pyc
|
||||
*._*
|
||||
.vim/bundle
|
||||
.vim/
|
||||
|
21
.vimrc
21
.vimrc
@ -551,9 +551,8 @@ com! -nargs=+ UnBundle
|
||||
\ call UnBundle(<args>)
|
||||
|
||||
function! InitializeDirectories()
|
||||
let separator = "."
|
||||
let parent = $HOME
|
||||
let prefix = '.vim'
|
||||
let prefix = 'vim'
|
||||
let dir_list = {
|
||||
\ 'backup': 'backupdir',
|
||||
\ 'views': 'viewdir',
|
||||
@ -563,8 +562,19 @@ function! InitializeDirectories()
|
||||
let dir_list['undo'] = 'undodir'
|
||||
endif
|
||||
|
||||
" To specify a different directory in which to place the vimbackup,
|
||||
" vimviews, vimundo, and vimswap files/directories, add the following to
|
||||
" your .vimrc.local file:
|
||||
" let g:spf13_consolidated_directory = <full path to desired directory>
|
||||
" eg: let g:spf13_consolidated_directory = $HOME . '/.vim/'
|
||||
if exists('g:spf13_consolidated_directory')
|
||||
let common_dir = g:spf13_consolidated_directory . prefix
|
||||
else
|
||||
let common_dir = parent . '/.' . prefix
|
||||
endif
|
||||
|
||||
for [dirname, settingname] in items(dir_list)
|
||||
let directory = parent . '/' . prefix . dirname . "/"
|
||||
let directory = common_dir . dirname . '/'
|
||||
if exists("*mkdir")
|
||||
if !isdirectory(directory)
|
||||
call mkdir(directory)
|
||||
@ -579,7 +589,6 @@ function! InitializeDirectories()
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
call InitializeDirectories()
|
||||
|
||||
function! NERDTreeInitAsNeeded()
|
||||
redir => bufoutput
|
||||
@ -632,3 +641,7 @@ endfunction
|
||||
endif
|
||||
endif
|
||||
" }
|
||||
|
||||
" Finish local initializations {
|
||||
call InitializeDirectories()
|
||||
" }
|
||||
|
Loading…
Reference in New Issue
Block a user