From 7f5e6b2d8790d2fc54934060440c94c45166785e Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 19 Dec 2019 18:16:01 +1300 Subject: Use four spaces for indentation in Markdown in Vim --- vim/after/indent/markdown.vim | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 vim/after/indent/markdown.vim diff --git a/vim/after/indent/markdown.vim b/vim/after/indent/markdown.vim new file mode 100644 index 00000000..61f09a1e --- /dev/null +++ b/vim/after/indent/markdown.vim @@ -0,0 +1,2 @@ +" Use four spaces for indentation +call indent#spaces(4) -- cgit v1.2.3 From 0cd4bf15e37fcc6827fc9df5ea0ec28fa579639e Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 19 Dec 2019 18:20:21 +1300 Subject: Spin spellfile_local plugin out into new plugin --- .gitmodules | 3 + vim/autoload/spellfile_local.vim | 154 --------------------------------------- vim/bundle/spellfile_local | 1 + vim/plugin/spellfile_local.vim | 20 ----- 4 files changed, 4 insertions(+), 174 deletions(-) delete mode 100644 vim/autoload/spellfile_local.vim create mode 160000 vim/bundle/spellfile_local delete mode 100644 vim/plugin/spellfile_local.vim diff --git a/.gitmodules b/.gitmodules index e78d89ea..92fe319f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -65,6 +65,9 @@ [submodule "vim/bundle/shebang_create_exec"] path = vim/bundle/shebang_create_exec url = https://sanctum.geek.nz/code/vim-shebang-create-exec.git +[submodule "vim/bundle/spellfile_local"] + path = vim/bundle/spellfile_local + url = https://sanctum.geek.nz/code/vim-spellfile-local.git [submodule "vim/bundle/squeeze_repeat_blanks"] path = vim/bundle/squeeze_repeat_blanks url = https://sanctum.geek.nz/code/vim-squeeze-repeat-blanks.git diff --git a/vim/autoload/spellfile_local.vim b/vim/autoload/spellfile_local.vim deleted file mode 100644 index 7dbe8fb5..00000000 --- a/vim/autoload/spellfile_local.vim +++ /dev/null @@ -1,154 +0,0 @@ -" Entry point for plugin -function! spellfile_local#() abort - - " If this is a special buffer, don't do anything - if index(['nofile', 'quickfix', 'help'], &buftype) >= 0 - return - endif - - " Get the first item in the spelling languages list, bail if there aren't - " any; strip any regional suffix (e.g. en_NZ), too, as the final 'spellfile' - " value won't tolerate it - " - let spelllangs = s:OptionSplit(&spelllang) - if len(spelllangs) == 0 - return - endif - let lang = split(spelllangs[0], '_')[0] - - " Use current encoding - let encoding = &encoding - - " Start a list of spellfiles - let spellfiles = [] - - " Imitate Vim's behaviour in creating a `spell` subdir in the first - " writeable element of 'runtimepath' - " - for runtimepath in s:OptionSplit(&runtimepath) - let path = s:Path(join(add( - \ split(runtimepath, '/', 1) - \,'spell' - \), '/'), lang, encoding) - if path !=# '' - call add(spellfiles, path) - break - endif - endfor - - " Still no 'spellfile'? Quietly give up - if len(spellfiles) == 0 - return - endif - - " Get the path to the spelling files directory - let dir = fnamemodify(spellfiles[0], ':h') - - " Specify the name and type of spelling files we'll add, with a list of - " two-key dictionaries. For each of these, the `name` is used as the - " subdirectory, and the `value` as the first component of the filename. We - " - let types = [ - \ { 'name': 'path', 'value': expand('%:p') } - \,{ 'name': 'filetype', 'value': &filetype } - \] - - " Iterate through the specified types to add them to the spelling files list - for type in types - - " Add a new calculated path to the spellfiles list, if valid - let spellfile = s:Path(dir, lang, encoding, type) - if spellfile !=# '' - call add(spellfiles, spellfile) - endif - - endfor - - " Set the spellfile path list to the concatenated list - let &spellfile = s:OptionJoin(spellfiles) - -endfunction - -" Escape a path for use as a valid spelling file name; replace any characters -" not in 'isfname' with percent symbols -function! s:Escape(filename) abort - let filename = '' - for char in split(a:filename, '\zs') - if char !=# '_' && char !=# '/' && char =~# '^\f$' - let filename .= char - else - let filename .= '%' - endif - endfor - return filename -endfunction - -" Ensure a directory exists, or create it -function! s:Establish(path) abort - return isdirectory(a:path) - \ || exists('*mkdir') && mkdir(a:path, 'p', 0700) -endfunction - -" Join a list of strings into a comma-separated option -function! s:OptionJoin(list) abort - return join(map( - \ a:list - \,'substitute(v:val, ''\\\@ 0 - let type = a:1 - endif - - " Make lists representing the directory path elements and the - " period-separated filename - " - let dir = split(a:dir, '/', 1) - let file = [a:lang, a:encoding, 'add'] - - " If we have an optional type, extend the directory with another element - " according to its name, and insert the value before the filename, - " e.g. append "filetype" to the directory, and insert the current value of - " &filetype before the filename; if we have a type but a blank value, which - " is not necessarily an error condition, stop here and return nothing - " - if exists('type') - if type['value'] ==# '' - return - endif - call add(dir, type['name']) - call insert(file, type['value']) - endif - - " Ensure the directory is in place, trying to create it if need be, and that - " all of it passes an 'isfname' filter, since 'spellfile' checks that - " - let ds = join(dir, '/') - if ds !~# '^\f\+$' - \ || filewritable(ds) != 2 && !mkdir(ds, '0700', 'p') - return - endif - - " Build the full spellfile path, escaping the filename appropriately, and - " return it as a path string - " - let path = add(copy(dir), s:Escape(join(file, '.'))) - return join(path, '/') - -endfunction diff --git a/vim/bundle/spellfile_local b/vim/bundle/spellfile_local new file mode 160000 index 00000000..fd3d5183 --- /dev/null +++ b/vim/bundle/spellfile_local @@ -0,0 +1 @@ +Subproject commit fd3d5183d7c1d7494140ff77ad47857f86657f18 diff --git a/vim/plugin/spellfile_local.vim b/vim/plugin/spellfile_local.vim deleted file mode 100644 index 07307754..00000000 --- a/vim/plugin/spellfile_local.vim +++ /dev/null @@ -1,20 +0,0 @@ -" -" spellfile_local.vim: Set extra 'spellfile' elements for full file paths and -" filetype, to give the option of adding to file-specific or filetype-specific -" spelling word lists. -" -" Author: Tom Ryder -" License: Same as Vim itself -" -if exists('loaded_spellfile_local') || &compatible - finish -endif -let loaded_spellfile_local = 1 - -" For various events involving establishing or renaming a file buffer or -" changing its filetype, rebuild the 'spellfile' definition accordingly -" -augroup spellfile_local - autocmd BufFilePost,BufNewFile,BufRead,EncodingChanged,FileType * - \ call spellfile_local#() -augroup END -- cgit v1.2.3 From 7e8b016067375f2f1808bca1f67128178584f1de Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 19 Dec 2019 18:27:49 +1300 Subject: Update redact_pass.vim plugin to v2.2.0 --- vim/bundle/redact_pass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/bundle/redact_pass b/vim/bundle/redact_pass index a5ff8935..337e7498 160000 --- a/vim/bundle/redact_pass +++ b/vim/bundle/redact_pass @@ -1 +1 @@ -Subproject commit a5ff8935fc2e81de46375d85378e59e333ee1ad8 +Subproject commit 337e7498e2b483e79c9abb33a2feb670655b23dc -- cgit v1.2.3 From 50652b4921a97ce1717b72eaacd6b6de6aebd2d7 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 19 Dec 2019 18:29:03 +1300 Subject: Update spellfile_local.vim plugin to v0.1.1 --- vim/bundle/spellfile_local | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/bundle/spellfile_local b/vim/bundle/spellfile_local index fd3d5183..7124a05b 160000 --- a/vim/bundle/spellfile_local +++ b/vim/bundle/spellfile_local @@ -1 +1 @@ -Subproject commit fd3d5183d7c1d7494140ff77ad47857f86657f18 +Subproject commit 7124a05b1ed53ccc1bae6f4dc99a1fe78c474512 -- cgit v1.2.3 From 870bbe187fc2b85402ff309361ed5e4ce1244a38 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 19 Dec 2019 18:30:10 +1300 Subject: Bump VERSION --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 421c7f5a..3bd90f4c 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -tejr dotfiles v8.7.0 -Thu, 19 Dec 2019 04:19:58 +0000 +tejr dotfiles v8.8.0 +Thu, 19 Dec 2019 05:30:10 +0000 -- cgit v1.2.3