aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-11 10:30:08 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-11 10:30:08 +1200
commita5eda5c5256bd4883d973d33f78b054de61141d2 (patch)
tree051138750d443a4cdd0d7b980d925ef686cdab77
parentRearrange 'backupskip' changes logic (diff)
downloaddotfiles-a5eda5c5256bd4883d973d33f78b054de61141d2.tar.gz
dotfiles-a5eda5c5256bd4883d973d33f78b054de61141d2.zip
Rename EnsureDir to Establish
I just like this name better.
-rw-r--r--vim/plugin/spellfile_local.vim2
-rw-r--r--vim/vimrc22
2 files changed, 12 insertions, 12 deletions
diff --git a/vim/plugin/spellfile_local.vim b/vim/plugin/spellfile_local.vim
index 9cb97624..0ded3fc1 100644
--- a/vim/plugin/spellfile_local.vim
+++ b/vim/plugin/spellfile_local.vim
@@ -3,7 +3,7 @@ if exists('loaded_spellfile_local')
endif
let loaded_spellfile_local = 1
-EnsureDir $MYVIM/cache/spell
+Establish $MYVIM/cache/spell
let spellfile = join([
\ substitute(v:lang, '_.*', '', ''),
diff --git a/vim/vimrc b/vim/vimrc
index 8e77afa5..9a2a425f 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -135,25 +135,25 @@ endif
" final one, since every directory we want to create in this file should be
" locked down in this way.
"
-function! s:EnsureDir(path) abort
+function! s:Establish(path) abort
let path = expand(a:path)
return isdirectory(path)
\ || exists('*mkdir') && mkdir(path, 'p', 0700)
endfunction
-" Now we define the :EnsureDir command for user-level access to the
-" s:EnsureDir() function. We set the tab completion to provide directory
+" Now we define the :Establish command for user-level access to the
+" s:Establish() function. We set the tab completion to provide directory
" names as candidates, and specify that there must be only one argument, which
" we'll provide as a quoted parameter to the function.
"
-command! -complete=dir -nargs=1 EnsureDir
- \ call s:EnsureDir(<q-args>)
+command! -complete=dir -nargs=1 Establish
+ \ call s:Establish(<q-args>)
" Now that we have a clean means to create directories if they don't already
" exist, let's apply it for the first time, in making sure that the MYVIM
" directory exists, if it's been set.
"
-EnsureDir $MYVIM
+Establish $MYVIM
" If this file or the vimrc stub that calls it is sourced, whether because of
" the above hook, or the <Leader>R mapping prescribed later in this file, add
@@ -238,7 +238,7 @@ augroup END
" a nicer way to set it with a 'viminfofile' option, but there's no particular
" reason to use it until it's in a few more stable versions.
"
-EnsureDir $MYVIM/cache
+Establish $MYVIM/cache
set viminfo+=n$MYVIM/cache/viminfo
" Speaking of recorded data in viminfo files, the command and search history
@@ -342,7 +342,7 @@ set backup
" It's all so awkward. Surely options named something like 'backupfullpath',
" 'swapfilefullpath', and 'undofullpath' would have been clearer.
"
-EnsureDir $MYVIM/cache/backup
+Establish $MYVIM/cache/backup
if has('patch-8.1.251')
set backupdir^=$MYVIM/cache/backup//
else
@@ -428,7 +428,7 @@ set confirm
" its name, in order to avoid filename collisions. Create that path if
" needed, too.
"
-EnsureDir $MYVIM/cache/swap
+Establish $MYVIM/cache/swap
set directory^=$MYVIM/cache/swap//
" If Vim receives an Escape key code in insert mode, it shouldn't wait to see
@@ -749,7 +749,7 @@ if has('persistent_undo')
" Vim to use the full path of the original file in its undo file cache's
" name.
"
- EnsureDir $MYVIM/cache/undo
+ Establish $MYVIM/cache/undo
set undodir^=$MYVIM/cache/undo//
" Turn the persistent undo features on, regardless of whether we have
@@ -1321,7 +1321,7 @@ nnoremap <Leader>G
\ :<C-U>cd %:h<Bar>pwd<CR>
"" Leader,P creates the path to the current file if it doesn't exist
nnoremap <Leader>P
- \ :<C-U>EnsureDir %:h<CR>
+ \ :<C-U>Establish %:h<CR>
" This group contains mappings that show information about Vim's internals:
" marks, registers, variables, and the like.