From 596610205ba22cbf27f3f40c4a7133f859570239 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 16 Aug 2018 22:32:38 +1200 Subject: Spin foldlevelstart_stdin.vim into its own dist --- .gitmodules | 3 +++ vim/bundle/foldlevelstart_stdin | 1 + vim/plugin/foldlevelstart_stdin.vim | 28 ---------------------------- 3 files changed, 4 insertions(+), 28 deletions(-) create mode 160000 vim/bundle/foldlevelstart_stdin delete mode 100644 vim/plugin/foldlevelstart_stdin.vim diff --git a/.gitmodules b/.gitmodules index 8368e236..0cc8fb3f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -17,6 +17,9 @@ [submodule "vim/bundle/digraph_search"] path = vim/bundle/digraph_search url = https://sanctum.geek.nz/code/vim-digraph-search.git +[submodule "vim/bundle/foldlevelstart_stdin"] + path = vim/bundle/foldlevelstart_stdin + url = https://sanctum.geek.nz/code/vim-foldlevelstart-stdin.git [submodule "vim/bundle/insert_cancel"] path = vim/bundle/insert_cancel url = https://sanctum.geek.nz/code/vim-insert-cancel.git diff --git a/vim/bundle/foldlevelstart_stdin b/vim/bundle/foldlevelstart_stdin new file mode 160000 index 00000000..77d9d2c3 --- /dev/null +++ b/vim/bundle/foldlevelstart_stdin @@ -0,0 +1 @@ +Subproject commit 77d9d2c3ee865f6334ffda5d665ecb6cdf0541cd diff --git a/vim/plugin/foldlevelstart_stdin.vim b/vim/plugin/foldlevelstart_stdin.vim deleted file mode 100644 index f8e4d50e..00000000 --- a/vim/plugin/foldlevelstart_stdin.vim +++ /dev/null @@ -1,28 +0,0 @@ -" -" foldlevelstart_stdin.vim: Set 'foldlevel' to 'foldlevelstart' after reading -" from standard input, which Vim doesn't do by default. -" -" Author: Tom Ryder -" License: Same as Vim itself -" -if exists('g:loaded_foldlevelstart_stdin') || &compatible - finish -endif -if !has('autocmd') || !has('folding') || !exists('##StdinReadPre') - finish -endif -let g:loaded_foldlevelstart_stdin = 1 - -" Check if 'foldlevelstart' is non-negative, and set 'foldlevel' to its value -" if it is -function! s:SetFoldlevel() abort - if &foldlevelstart >= 0 - let &l:foldlevel = &foldlevelstart - endif -endfunction - -" Watch for stdin reads and set fold level accordingly -augroup foldlevelstart_stdin - autocmd! - autocmd StdinReadPre * call s:SetFoldlevel() -augroup END -- cgit v1.2.3