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
|
.DS_Store
|
||||||
*.pyc
|
*.pyc
|
||||||
*._*
|
*._*
|
||||||
.vim/bundle
|
.vim/
|
||||||
|
21
.vimrc
21
.vimrc
@ -551,9 +551,8 @@ com! -nargs=+ UnBundle
|
|||||||
\ call UnBundle(<args>)
|
\ call UnBundle(<args>)
|
||||||
|
|
||||||
function! InitializeDirectories()
|
function! InitializeDirectories()
|
||||||
let separator = "."
|
|
||||||
let parent = $HOME
|
let parent = $HOME
|
||||||
let prefix = '.vim'
|
let prefix = 'vim'
|
||||||
let dir_list = {
|
let dir_list = {
|
||||||
\ 'backup': 'backupdir',
|
\ 'backup': 'backupdir',
|
||||||
\ 'views': 'viewdir',
|
\ 'views': 'viewdir',
|
||||||
@ -563,8 +562,19 @@ function! InitializeDirectories()
|
|||||||
let dir_list['undo'] = 'undodir'
|
let dir_list['undo'] = 'undodir'
|
||||||
endif
|
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)
|
for [dirname, settingname] in items(dir_list)
|
||||||
let directory = parent . '/' . prefix . dirname . "/"
|
let directory = common_dir . dirname . '/'
|
||||||
if exists("*mkdir")
|
if exists("*mkdir")
|
||||||
if !isdirectory(directory)
|
if !isdirectory(directory)
|
||||||
call mkdir(directory)
|
call mkdir(directory)
|
||||||
@ -579,7 +589,6 @@ function! InitializeDirectories()
|
|||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
call InitializeDirectories()
|
|
||||||
|
|
||||||
function! NERDTreeInitAsNeeded()
|
function! NERDTreeInitAsNeeded()
|
||||||
redir => bufoutput
|
redir => bufoutput
|
||||||
@ -632,3 +641,7 @@ endfunction
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
" }
|
" }
|
||||||
|
|
||||||
|
" Finish local initializations {
|
||||||
|
call InitializeDirectories()
|
||||||
|
" }
|
||||||
|
Loading…
Reference in New Issue
Block a user