From a666a09b7761ce1fd50abe4124fa10a87f2d2123 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 14 Jun 2019 19:26:25 +1200 Subject: Ensure only actual quoted mail lines are reshaped --- vim/after/ftplugin/mail.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim index cfb738a1..260b0363 100644 --- a/vim/after/ftplugin/mail.vim +++ b/vim/after/ftplugin/mail.vim @@ -45,7 +45,7 @@ for lnum in range(1, line('$')) let line = getline(lnum) " Get the leading quote string, if any; stop if there isn't one - let quote = matchstr(line, '^[> ]\+') + let quote = matchstr(line, '^>[> ]*') if strlen(quote) == 0 continue endif -- cgit v1.2.3 From 13d56c5d0f0af692914a7f39673da357d6e50213 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 14 Jun 2019 19:27:04 +1200 Subject: Correct a misleading word in mail ftplugin comment --- vim/after/ftplugin/mail.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim index 260b0363..cba446a3 100644 --- a/vim/after/ftplugin/mail.vim +++ b/vim/after/ftplugin/mail.vim @@ -44,7 +44,7 @@ for lnum in range(1, line('$')) " Get current line let line = getline(lnum) - " Get the leading quote string, if any; stop if there isn't one + " Get the leading quote string, if any; skip if there isn't one let quote = matchstr(line, '^>[> ]*') if strlen(quote) == 0 continue -- cgit v1.2.3 From 6e83eb640f4f92dac7a4856dfeeec611bc19ac03 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 14 Jun 2019 19:27:36 +1200 Subject: Ensure we're in body text before breaking quotes --- vim/after/ftplugin/mail.vim | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim index cba446a3..fd67bc51 100644 --- a/vim/after/ftplugin/mail.vim +++ b/vim/after/ftplugin/mail.vim @@ -39,11 +39,18 @@ if line('.') == 1 && col('.') == 1 endif " Normalise quoting +let body = 0 for lnum in range(1, line('$')) " Get current line let line = getline(lnum) + " Skip lines until we hit a blank line, meaning body text + let body = body || !strlen(line) + if !body + continue + endif + " Get the leading quote string, if any; skip if there isn't one let quote = matchstr(line, '^>[> ]*') if strlen(quote) == 0 -- cgit v1.2.3 From bac5acad0ae8a9929215af063de53e31a4eb4e86 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 14 Jun 2019 19:28:18 +1200 Subject: Use more idiomatic check for empty string --- vim/after/ftplugin/mail.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim index fd67bc51..2894ec2b 100644 --- a/vim/after/ftplugin/mail.vim +++ b/vim/after/ftplugin/mail.vim @@ -53,7 +53,7 @@ for lnum in range(1, line('$')) " Get the leading quote string, if any; skip if there isn't one let quote = matchstr(line, '^>[> ]*') - if strlen(quote) == 0 + if !strlen(quote) continue endif -- cgit v1.2.3 From 582f503ba5d669170fdb8033618f4efe2e89b148 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 14 Jun 2019 19:39:31 +1200 Subject: Wrap mail starting point guesser in command-func --- vim/after/ftplugin/mail.vim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim index 2894ec2b..d9a24082 100644 --- a/vim/after/ftplugin/mail.vim +++ b/vim/after/ftplugin/mail.vim @@ -4,7 +4,7 @@ let b:quote_space = 0 " If something hasn't already moved the cursor, we'll move to an optimal point " to start writing -if line('.') == 1 && col('.') == 1 +function! s:SuggestStart() abort " Start by trying to move to the first quoted line; this may fail if there's " no quote, which is fine @@ -35,8 +35,10 @@ if line('.') == 1 && col('.') == 1 " Now move to the first quoted or unquoted blank line call search('\m^>\= *$', 'c') - -endif +endfunction +command! -bar -buffer SuggestStart + \ call s:SuggestStart() +SuggestStart " Normalise quoting let body = 0 -- cgit v1.2.3 From 86ee76daf5650d2c0526a6d7567ac3853c03b732 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 14 Jun 2019 19:40:02 +1200 Subject: Move to body text correctly for start guesser --- vim/after/ftplugin/mail.vim | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim index d9a24082..43586731 100644 --- a/vim/after/ftplugin/mail.vim +++ b/vim/after/ftplugin/mail.vim @@ -6,6 +6,12 @@ let b:quote_space = 0 " to start writing function! s:SuggestStart() abort + " Move to top of buffer + call setpos('.', [0, 1, 1, 0]) + + " Move to body text + call search('\m^$', 'c') | + + " Start by trying to move to the first quoted line; this may fail if there's " no quote, which is fine call search('\m^>', 'c') -- cgit v1.2.3 From f833e6c33a97df108d378a4a682c7d3825c6a63a Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 14 Jun 2019 19:40:29 +1200 Subject: Wrap mail quote cleanup in command-func --- vim/after/ftplugin/mail.vim | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim index 43586731..85db8c9e 100644 --- a/vim/after/ftplugin/mail.vim +++ b/vim/after/ftplugin/mail.vim @@ -47,32 +47,37 @@ command! -bar -buffer SuggestStart SuggestStart " Normalise quoting -let body = 0 -for lnum in range(1, line('$')) +function! s:StrictQuote() abort + let body = 0 + for lnum in range(1, line('$')) - " Get current line - let line = getline(lnum) + " Get current line + let line = getline(lnum) - " Skip lines until we hit a blank line, meaning body text - let body = body || !strlen(line) - if !body - continue - endif + " Skip lines until we hit a blank line, meaning body text + let body = body || !strlen(line) + if !body + continue + endif - " Get the leading quote string, if any; skip if there isn't one - let quote = matchstr(line, '^>[> ]*') - if !strlen(quote) - continue - endif + " Get the leading quote string, if any; skip if there isn't one + let quote = matchstr(line, '^>[> ]*') + if !strlen(quote) + continue + endif - " Normalise the quote with no spaces - let quote = substitute(quote, '[^>]', '', 'g') + " Normalise the quote with no spaces + let quote = substitute(quote, '[^>]', '', 'g') - " Re-set the line - let line = substitute(line, '^[> ]\+', quote, '') - call setline(lnum, line) + " Re-set the line + let line = substitute(line, '^[> ]\+', quote, '') + call setline(lnum, line) -endfor + endfor +endfunction +command -bar -buffer StrictQuote + \ call s:StrictQuote() +StrictQuote " Add a space to the end of wrapped lines for format-flowed mail setlocal formatoptions+=w -- cgit v1.2.3 From a7e32d502a4999acd0f4a8100ec9c662f754a559 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 14 Jun 2019 19:41:36 +1200 Subject: Remove resolved issue from ISSUES.md list --- ISSUES.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/ISSUES.md b/ISSUES.md index e046856a..103c3a98 100644 --- a/ISSUES.md +++ b/ISSUES.md @@ -30,6 +30,3 @@ Known issues pushed upstream. * The `_text_filenames` completion handler for Bash won't work on files with newlines in their names. Can it be made to? -* Something in the mail ftplugin is butchering the headers, probably something - that strips whitespace or quotes. It would probably be better to make the - cleanup it does an explicit action with a buffer-local map. -- cgit v1.2.3 From e3036969e337b2a351dc4f5e0b4bd57c0e6a7243 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 14 Jun 2019 19:44:46 +1200 Subject: Add missing b:undo_ftplugin commands for ft=mail --- vim/after/ftplugin/mail.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim index 85db8c9e..f4a4c91d 100644 --- a/vim/after/ftplugin/mail.vim +++ b/vim/after/ftplugin/mail.vim @@ -1,6 +1,7 @@ " Don't append spaces after quote chars, for strict compliance with " format=flowed let b:quote_space = 0 +let b:undo_ftplugin .= '|unlet b:quote_space' " If something hasn't already moved the cursor, we'll move to an optimal point " to start writing @@ -44,6 +45,7 @@ function! s:SuggestStart() abort endfunction command! -bar -buffer SuggestStart \ call s:SuggestStart() +let b:undo_ftplugin .= '|delcommand SuggestStart' SuggestStart " Normalise quoting @@ -77,6 +79,7 @@ function! s:StrictQuote() abort endfunction command -bar -buffer StrictQuote \ call s:StrictQuote() +let b:undo_ftplugin .= '|delcommand StrictQuote' StrictQuote " Add a space to the end of wrapped lines for format-flowed mail -- cgit v1.2.3 From 3b6450a5ccd985bd14cdb72043690d4000db36f7 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 14 Jun 2019 19:48:24 +1200 Subject: Add -bar attribute to :AddLocalSpellFile command --- vim/plugin/spellfile_local.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/plugin/spellfile_local.vim b/vim/plugin/spellfile_local.vim index b04b7573..c026d626 100644 --- a/vim/plugin/spellfile_local.vim +++ b/vim/plugin/spellfile_local.vim @@ -10,7 +10,7 @@ let s:spellfile = join([ Establish $MYVIM/cache/spell execute 'set spellfile=$MYVIM/cache/spell/'.s:spellfile -command! AddLocalSpellFile +command! -bar AddLocalSpellFile \ call spellfile_local#() augroup spellfile_local -- cgit v1.2.3 From e2d29e216d51588a6ad5def72bd46aecd8bf137b Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 14 Jun 2019 20:02:43 +1200 Subject: Add Vim leader maps for :command and :function --- vim/vimrc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vim/vimrc b/vim/vimrc index 7a67920a..4bbbef20 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -1361,6 +1361,9 @@ nnoremap H "" Leader,k shows my marks nnoremap k \ :marks +"" Leader,K shows functions +nnoremap K + \ :function "" Leader,m shows normal maps nnoremap m \ :nmap @@ -1370,6 +1373,9 @@ nnoremap M "" Leader,S shows loaded scripts nnoremap S \ :scriptnames +"" Leader,U shows user commands +nnoremap U + \ :command "" Leader,v shows all global and internal variables nnoremap v \ :let g: v: -- cgit v1.2.3 From a833f90b88cc1db2230720591ce8c93faac3a296 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 14 Jun 2019 20:03:14 +1200 Subject: Tweak a comment about jetpack mapping --- vim/vimrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 4bbbef20..16745df7 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -1387,8 +1387,8 @@ nnoremap y \ :registers " This group contains mappings concerned with buffer navigation and -" management. I use the "jetpack" buffer jumper one like crazy; I really like -" it. I got it from one of bairui's "Vim and Vigor" comics: +" management. I use the "jetpack" buffer jumper one a lot. I got it from one +" of bairui's "Vim and Vigor" comics: " " -- cgit v1.2.3 From d63860cac06d84e9cd6ec62129e4c86dc978c81e Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 14 Jun 2019 20:31:06 +1200 Subject: Restore Git diff.algorithm to 'patience' It's noticeably better. --- git/gitconfig.mi5 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/git/gitconfig.mi5 b/git/gitconfig.mi5 index 292ffe7a..15669129 100644 --- a/git/gitconfig.mi5 +++ b/git/gitconfig.mi5 @@ -1,6 +1,9 @@ [commit] status = false +[diff] + algorithm = patience + [fetch] output = compact -- cgit v1.2.3 From a22e4ff2daaf7379f5ee1346e9c6639cb6eb4653 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 14 Jun 2019 20:33:29 +1200 Subject: Refactor colorscheme select with cursorline hooks --- vim/vimrc | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 16745df7..6dd64c2c 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -962,29 +962,32 @@ if !exists('syntax_on') syntax enable endif -" We'll have Vim try to use my 'sahara' fork of the 'desert256' color scheme, -" and if it manages to do so without errors, turn on the 'cursorline' feature, -" since the scheme configures it and 'cursorcolumn' to be a very dark gray -" that doesn't stand out too much against a black background. Aside from the -" aforementioned experiment with monochrome terminals, I exclusively use dark -" backgrounds. -" +" Before we attempt to pick a syntax highlighting color scheme, we'll set up +" a couple of hooks for colorscheme loading. In this case, we turn +" 'cursorline' on if my 'sahara' colorscheme is loaded, since I've configured +" it to be a very dark gray that doesn't stand out too much against a black +" background. For any other colorscheme, turn the option off, because it +" almost always stands out too much for my liking. +" +autocmd vimrc ColorScheme * + \ set nocursorline +autocmd vimrc ColorScheme sahara + \ set cursorline + +" We'll have Vim try to use my 'sahara' fork of the 'desert256' color scheme. " If we fail to load the color scheme, for whatever reason, suppress the -" error, and reset the syntax highlighting, 'background', and 'cursorline' for -" dark-background default colors. I used it for years; it looks and works -" just fine. +" error, and ensure a dark background for the default colorscheme. " -" There's also a very simple grayscale color scheme I occasionally use -" instead called 'juvenile', which is included as a Git submodule with this -" dotfiles distribution. +" There's also a very simple grayscale color scheme I occasionally use instead +" called 'juvenile', which is included as a Git submodule with this dotfiles +" distribution. " try colorscheme sahara - set cursorline catch - colorscheme default - set background=dark - set nocursorline + if &background !=# 'dark' + set background=dark + endif endtry " My mapping definitions begin here. I have some general personal rules for -- cgit v1.2.3 From 9693d9d286d758043c038087079704bef899d289 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 14 Jun 2019 20:33:51 +1200 Subject: Move autocmd definitions out of augroup block --- vim/vimrc | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 6dd64c2c..124e3af7 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -204,33 +204,33 @@ endfunction command! -bar ReloadVimrc \ noautocmd source $MYVIMRC | call s:ReloadVimrc() -" We'll now reset and define a group of automatic command hooks specific to -" matters related to reloading the vimrc itself. +" We'll now create or reset a group of automatic command hooks specific to +" matters related to reloading the vimrc itself, or maintaining and managing +" options set within it. " augroup vimrc autocmd! +augroup END - " Reload the stub vimrc, and thereby this main one, each time either of them - " is saved. This often makes errors in the file immediately apparent, and - " saves restarting Vim or running the :source command manually, which - " I almost always want to do after changing my vimrc file anyway. - " - autocmd BufWritePost $MYVIMRC,$MYVIM/vimrc - \ ReloadVimrc - - " If Vim is new enough (v7.0.187) to support the ##SourceCmd event for - " automatic command hooks, we'll also apply a hook for that event to catch - " invocations of :source of either vimrc file, and translate that into - " reloading the stub vimrc. - " - " - " - if exists('##SourceCmd') - autocmd SourceCmd $MYVIMRC,$MYVIM/vimrc - \ ReloadVimrc - endif +" Reload the stub vimrc, and thereby this main one, each time either of them +" is saved. This often makes errors in the file immediately apparent, and +" saves restarting Vim or running the :source command manually, which +" I almost always want to do after changing my vimrc file anyway. +" +autocmd vimrc BufWritePost $MYVIMRC,$MYVIM/vimrc + \ ReloadVimrc -augroup END +" If Vim is new enough (v7.0.187) to support the ##SourceCmd event for +" automatic command hooks, we'll also apply a hook for that event to catch +" invocations of :source of either vimrc file, and translate that into +" reloading the stub vimrc. +" +" +" +if exists('##SourceCmd') + autocmd vimrc SourceCmd $MYVIMRC,$MYVIM/vimrc + \ ReloadVimrc +endif " We're going to be creating a few directories now. The code to do so in " a compatible way is verbose, mostly because we need to check whether the -- cgit v1.2.3 From c11c409c60603e6735833a2a57cf90c6e83567e6 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 14 Jun 2019 22:20:05 +1200 Subject: Replace and refactor Vim paste plugins --- .gitmodules | 3 --- vim/autoload/paste_insert.vim | 14 ++++++++++++++ vim/bundle/paste_open | 1 - vim/plugin/paste_insert.vim | 6 ++++++ vim/vimrc | 17 +++++++++-------- 5 files changed, 29 insertions(+), 12 deletions(-) create mode 100644 vim/autoload/paste_insert.vim delete mode 160000 vim/bundle/paste_open create mode 100644 vim/plugin/paste_insert.vim diff --git a/.gitmodules b/.gitmodules index 86bad115..77c7e443 100644 --- a/.gitmodules +++ b/.gitmodules @@ -29,9 +29,6 @@ [submodule "vim/bundle/insert_timeout"] path = vim/bundle/insert_timeout url = https://sanctum.geek.nz/code/vim-insert-timeout.git -[submodule "vim/bundle/paste_open"] - path = vim/bundle/paste_open - url = https://sanctum.geek.nz/code/vim-paste-open.git [submodule "vim/bundle/put_blank_lines"] path = vim/bundle/put_blank_lines url = https://sanctum.geek.nz/code/vim-put-blank-lines.git diff --git a/vim/autoload/paste_insert.vim b/vim/autoload/paste_insert.vim new file mode 100644 index 00000000..fe7cb35f --- /dev/null +++ b/vim/autoload/paste_insert.vim @@ -0,0 +1,14 @@ +augroup paste_insert + autocmd! +augroup END + +function! paste_insert#() abort + autocmd! paste_insert + autocmd paste_insert CursorHold,CursorMoved,User + \ set nopaste paste? + \|autocmd! paste_insert + autocmd paste_insert InsertEnter + \ set paste paste? + \|autocmd paste_insert InsertLeave + \ doautocmd paste_insert User +endfunction diff --git a/vim/bundle/paste_open b/vim/bundle/paste_open deleted file mode 160000 index 79ee83ea..00000000 --- a/vim/bundle/paste_open +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 79ee83eac32dbadf722df687e65f07d75a2f8eaf diff --git a/vim/plugin/paste_insert.vim b/vim/plugin/paste_insert.vim new file mode 100644 index 00000000..be578746 --- /dev/null +++ b/vim/plugin/paste_insert.vim @@ -0,0 +1,6 @@ +if exists('loaded_paste_insert') + finish +endif +let loaded_paste_insert = 1 +command! -bar PasteInsert + \ call paste_insert#() diff --git a/vim/vimrc b/vim/vimrc index 124e3af7..f5dfc8fd 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -1254,10 +1254,6 @@ xmap n ngv nnoremap N \ :set ruler! ruler? xmap N Ngv -"" Leader,p toggles paste mode -nnoremap p - \ :set paste! paste? -xmap p pgv "" Leader,w toggles soft wrapping nnoremap w \ :setlocal wrap! wrap? @@ -1317,6 +1313,15 @@ nnoremap L \ :ToggleFlagLocal colorcolumn +1 xmap L Lgv +" This mapping uses my paste_insert.vim plugin to queue up automatic commands +" for the next insert operation. It's still pretty new. It replaces my old +" paste_open.vim plugin which did this only for opening new lines, and which +" kept confusing me. I'm hoping this will be better. + +"" Leader,p prepares the next insert for paste mode +nnoremap p + \ :PasteInsert + " These mappings are for managing filetypes. The first one uses the " :ReloadFileType command that was defined much earlier in this file for " application in the vimrc reload command. @@ -1494,10 +1499,6 @@ nnoremap ? "" Leader,. runs the configured make program into the location list nnoremap . \ :lmake! -"" Leader,o opens a line below in paste mode -nmap o (PasteOpenBelow) -"" Leader,O opens a line above in paste mode -nmap O (PasteOpenAbove) "" Leader,q formats the current paragraph nnoremap q gqap "" Leader,r acts as a replacement operator -- cgit v1.2.3 From 939bdc40bddba39824c01a90aa96430ae3ad0fcb Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 14 Jun 2019 22:20:56 +1200 Subject: Fix layout of vim-keep-position submodule config --- .gitmodules | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 77c7e443..344c4b6e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -29,6 +29,9 @@ [submodule "vim/bundle/insert_timeout"] path = vim/bundle/insert_timeout url = https://sanctum.geek.nz/code/vim-insert-timeout.git +[submodule "vim/bundle/keep_position"] + path = vim/bundle/keep_position + url = https://sanctum.geek.nz/code/vim-keep-position.git [submodule "vim/bundle/put_blank_lines"] path = vim/bundle/put_blank_lines url = https://sanctum.geek.nz/code/vim-put-blank-lines.git @@ -87,6 +90,3 @@ [submodule "vim/bundle/sahara"] path = vim/bundle/sahara url = https://sanctum.geek.nz/code/vim-sahara.git -[submodule "vim/bundle/keep_position"] - path = vim/bundle/keep_position - url = https://sanctum.geek.nz/code/vim-keep-position.git -- cgit v1.2.3 From 7bfc2ae02ce2049e464837881df1afc223f661ba Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 14 Jun 2019 22:23:22 +1200 Subject: Use tabs for Git configuration files The frontend tools use tabs, and it's probably best not to fight them on it. --- .gitmodules | 116 ++++++++++++++++++++--------------------- git/gitconfig.mi5 | 32 ++++++------ vim/after/indent/gitconfig.vim | 6 +++ 3 files changed, 80 insertions(+), 74 deletions(-) create mode 100644 vim/after/indent/gitconfig.vim diff --git a/.gitmodules b/.gitmodules index 344c4b6e..5f049838 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,92 +1,92 @@ # Vim plugins [submodule "vim/bundle/big_file_options"] - path = vim/bundle/big_file_options - url = https://sanctum.geek.nz/code/vim-big-file-options.git + path = vim/bundle/big_file_options + url = https://sanctum.geek.nz/code/vim-big-file-options.git [submodule "vim/bundle/colon_operator"] - path = vim/bundle/colon_operator - url = https://sanctum.geek.nz/code/vim-colon-operator.git + path = vim/bundle/colon_operator + url = https://sanctum.geek.nz/code/vim-colon-operator.git [submodule "vim/bundle/copy_linebreak"] - path = vim/bundle/copy_linebreak - url = https://sanctum.geek.nz/code/vim-copy-linebreak.git + path = vim/bundle/copy_linebreak + url = https://sanctum.geek.nz/code/vim-copy-linebreak.git [submodule "vim/bundle/cursorline_current"] - path = vim/bundle/cursorline_current - url = https://sanctum.geek.nz/code/vim-cursorline-current.git + path = vim/bundle/cursorline_current + url = https://sanctum.geek.nz/code/vim-cursorline-current.git [submodule "vim/bundle/digraph_search"] - path = vim/bundle/digraph_search - url = https://sanctum.geek.nz/code/vim-digraph-search.git + path = vim/bundle/digraph_search + url = https://sanctum.geek.nz/code/vim-digraph-search.git [submodule "vim/bundle/equalalways_resized"] - path = vim/bundle/equalalways_resized - url = https://sanctum.geek.nz/code/vim-equalalways-resized.git + path = vim/bundle/equalalways_resized + url = https://sanctum.geek.nz/code/vim-equalalways-resized.git [submodule "vim/bundle/foldlevelstart_stdin"] - path = vim/bundle/foldlevelstart_stdin - url = https://sanctum.geek.nz/code/vim-foldlevelstart-stdin.git + 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 + path = vim/bundle/insert_cancel + url = https://sanctum.geek.nz/code/vim-insert-cancel.git [submodule "vim/bundle/insert_suspend_hlsearch"] - path = vim/bundle/insert_suspend_hlsearch - url = https://sanctum.geek.nz/code/vim-insert-suspend-hlsearch.git + path = vim/bundle/insert_suspend_hlsearch + url = https://sanctum.geek.nz/code/vim-insert-suspend-hlsearch.git [submodule "vim/bundle/insert_timeout"] - path = vim/bundle/insert_timeout - url = https://sanctum.geek.nz/code/vim-insert-timeout.git + path = vim/bundle/insert_timeout + url = https://sanctum.geek.nz/code/vim-insert-timeout.git [submodule "vim/bundle/keep_position"] - path = vim/bundle/keep_position - url = https://sanctum.geek.nz/code/vim-keep-position.git + path = vim/bundle/keep_position + url = https://sanctum.geek.nz/code/vim-keep-position.git [submodule "vim/bundle/put_blank_lines"] - path = vim/bundle/put_blank_lines - url = https://sanctum.geek.nz/code/vim-put-blank-lines.git + path = vim/bundle/put_blank_lines + url = https://sanctum.geek.nz/code/vim-put-blank-lines.git [submodule "vim/bundle/quickfix_auto_open"] - path = vim/bundle/quickfix_auto_open - url = https://sanctum.geek.nz/code/vim-quickfix-auto-open.git + path = vim/bundle/quickfix_auto_open + url = https://sanctum.geek.nz/code/vim-quickfix-auto-open.git [submodule "vim/bundle/redact_pass"] - path = vim/bundle/redact_pass - url = https://sanctum.geek.nz/code/vim-redact-pass.git + path = vim/bundle/redact_pass + url = https://sanctum.geek.nz/code/vim-redact-pass.git [submodule "vim/bundle/regex_escape"] - path = vim/bundle/regex_escape - url = https://sanctum.geek.nz/code/vim-regex-escape.git + path = vim/bundle/regex_escape + url = https://sanctum.geek.nz/code/vim-regex-escape.git [submodule "vim/bundle/replace_operator"] - path = vim/bundle/replace_operator - url = https://sanctum.geek.nz/code/vim-replace-operator.git + path = vim/bundle/replace_operator + url = https://sanctum.geek.nz/code/vim-replace-operator.git [submodule "vim/bundle/shebang_change_filetype"] - path = vim/bundle/shebang_change_filetype - url = https://sanctum.geek.nz/code/vim-shebang-change-filetype.git + path = vim/bundle/shebang_change_filetype + url = https://sanctum.geek.nz/code/vim-shebang-change-filetype.git [submodule "vim/bundle/shebang_create_exec"] - path = vim/bundle/shebang_create_exec - url = https://sanctum.geek.nz/code/vim-shebang-create-exec.git + path = vim/bundle/shebang_create_exec + url = https://sanctum.geek.nz/code/vim-shebang-create-exec.git [submodule "vim/bundle/squeeze_repeat_blanks"] - path = vim/bundle/squeeze_repeat_blanks - url = https://sanctum.geek.nz/code/vim-squeeze-repeat-blanks.git + path = vim/bundle/squeeze_repeat_blanks + url = https://sanctum.geek.nz/code/vim-squeeze-repeat-blanks.git [submodule "vim/bundle/strip_trailing_whitespace"] - path = vim/bundle/strip_trailing_whitespace - url = https://sanctum.geek.nz/code/vim-strip-trailing-whitespace.git + path = vim/bundle/strip_trailing_whitespace + url = https://sanctum.geek.nz/code/vim-strip-trailing-whitespace.git [submodule "vim/bundle/toggle_flags"] - path = vim/bundle/toggle_flags - url = https://sanctum.geek.nz/code/vim-toggle-flags.git + path = vim/bundle/toggle_flags + url = https://sanctum.geek.nz/code/vim-toggle-flags.git [submodule "vim/bundle/vertical_region"] - path = vim/bundle/vertical_region - url = https://sanctum.geek.nz/code/vim-vertical-region.git + path = vim/bundle/vertical_region + url = https://sanctum.geek.nz/code/vim-vertical-region.git [submodule "vim/bundle/vimrc_reload_filetype"] - path = vim/bundle/vimrc_reload_filetype - url = https://sanctum.geek.nz/code/vim-vimrc-reload-filetype.git + path = vim/bundle/vimrc_reload_filetype + url = https://sanctum.geek.nz/code/vim-vimrc-reload-filetype.git [submodule "vim/bundle/write_mkpath"] - path = vim/bundle/write_mkpath - url = https://sanctum.geek.nz/code/vim-write-mkpath.git + path = vim/bundle/write_mkpath + url = https://sanctum.geek.nz/code/vim-write-mkpath.git # Vim filetype plugins [submodule "vim/bundle/diff_prune"] - path = vim/bundle/diff_prune - url = https://sanctum.geek.nz/code/vim-diff-prune.git + path = vim/bundle/diff_prune + url = https://sanctum.geek.nz/code/vim-diff-prune.git [submodule "vim/bundle/make_target"] - path = vim/bundle/make_target - url = https://sanctum.geek.nz/code/vim-make-target.git + path = vim/bundle/make_target + url = https://sanctum.geek.nz/code/vim-make-target.git [submodule "vim/bundle/perl_version_bump"] - path = vim/bundle/perl_version_bump - url = https://sanctum.geek.nz/code/vim-perl-version-bump.git + path = vim/bundle/perl_version_bump + url = https://sanctum.geek.nz/code/vim-perl-version-bump.git # Vim colorschemes [submodule "vim/bundle/juvenile"] - path = vim/bundle/juvenile - url = https://sanctum.geek.nz/code/vim-juvenile.git + path = vim/bundle/juvenile + url = https://sanctum.geek.nz/code/vim-juvenile.git [submodule "vim/bundle/sahara"] - path = vim/bundle/sahara - url = https://sanctum.geek.nz/code/vim-sahara.git + path = vim/bundle/sahara + url = https://sanctum.geek.nz/code/vim-sahara.git diff --git a/git/gitconfig.mi5 b/git/gitconfig.mi5 index 15669129..11b815d1 100644 --- a/git/gitconfig.mi5 +++ b/git/gitconfig.mi5 @@ -1,37 +1,37 @@ [commit] - status = false + status = false [diff] - algorithm = patience + algorithm = patience [fetch] - output = compact + output = compact [init] - templateDir = ~/.git-template + templateDir = ~/.git-template [log] - date = local - decorate = short + date = local + decorate = short [merge] - ff = false - log = 1024 + ff = false + log = 1024 [pull] - ff = only + ff = only [push] - default = current + default = current [sendemail] - confirm = compose - smtpServer = <% SENDMAIL %> + confirm = compose + smtpServer = <% SENDMAIL %> [status] - short = true + short = true [user] - name = <% NAME %> - email = <% EMAIL %> - signingKey = <% KEY %> + name = <% NAME %> + email = <% EMAIL %> + signingKey = <% KEY %> diff --git a/vim/after/indent/gitconfig.vim b/vim/after/indent/gitconfig.vim new file mode 100644 index 00000000..16a948ab --- /dev/null +++ b/vim/after/indent/gitconfig.vim @@ -0,0 +1,6 @@ +" Use tabs for indent in Git config files, rather than fighting with the +" frontend tool +setlocal noexpandtab +setlocal softtabstop=0 +let &shiftwidth = &tabstop +let b:undo_indent .= '|setlocal expandtab< softtabstop< shiftwidth<' -- cgit v1.2.3 From cb77ee161538bc439b9daad3483974c60468a84a Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 14 Jun 2019 22:36:02 +1200 Subject: Remove unneeded password filetype --- vim/filetype.vim | 6 ------ vim/ftplugin/password.vim | 9 --------- vim/indent/password.vim | 11 ----------- 3 files changed, 26 deletions(-) delete mode 100644 vim/ftplugin/password.vim delete mode 100644 vim/indent/password.vim diff --git a/vim/filetype.vim b/vim/filetype.vim index 848637dd..6b52fab9 100644 --- a/vim/filetype.vim +++ b/vim/filetype.vim @@ -239,12 +239,6 @@ augroup filetypedetect \,/etc/shadow- \,/etc/shadow.edit \ setfiletype passwd - " pass(1) password files - autocmd BufNewFile,BufRead - \ /dev/shm/pass.?*/?*.txt - \,$TMPDIR/pass.?*/?*.txt - \,/tmp/pass.?*/?*.txt - \ setfiletype password " Perl 5 files autocmd BufNewFile,BufRead \ ?*.pl diff --git a/vim/ftplugin/password.vim b/vim/ftplugin/password.vim deleted file mode 100644 index 28f5a5e9..00000000 --- a/vim/ftplugin/password.vim +++ /dev/null @@ -1,9 +0,0 @@ -" Only do this when not yet done for this buffer -if exists('b:did_ftplugin') - finish -endif -let b:did_ftplugin = 1 - -" No autoformatting -setlocal formatoptions= -let b:undo_ftplugin = 'setlocal formatoptions<' diff --git a/vim/indent/password.vim b/vim/indent/password.vim deleted file mode 100644 index e37d0387..00000000 --- a/vim/indent/password.vim +++ /dev/null @@ -1,11 +0,0 @@ -" Only do this when not done yet for this buffer -if exists('b:did_indent') - finish -endif -let b:did_indent = 1 - -" Manual indenting and literal tabs for passwords -setlocal noautoindent -setlocal noexpandtab -setlocal softtabstop=0 -let b:undo_indent = 'setlocal autoindent< expandtab< softtabstop<' -- cgit v1.2.3 From e85f002ac8a7eb9412440f3c93c71e56c57028df Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 14 Jun 2019 22:42:46 +1200 Subject: Add explanatory comment on Vim indent ftplugin --- vim/indent/html.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vim/indent/html.vim b/vim/indent/html.vim index d93443a7..b31564f6 100644 --- a/vim/indent/html.vim +++ b/vim/indent/html.vim @@ -1,2 +1,5 @@ +" No load guard--we want this to run just before the stock runtime script to +" change its behaviour. We don't want to block it. + " Indent after

paragraph tags too let html_indent_inctags = 'p' -- cgit v1.2.3 From fe93144dc341f42feb5da17450d46f6f5809fc7a Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 14 Jun 2019 22:44:45 +1200 Subject: Spruce up CSV and TSV Vim filetype scripts --- vim/ftplugin/csv.vim | 6 ++---- vim/ftplugin/tsv.vim | 13 ++----------- vim/indent/csv.vim | 8 ++++++-- vim/indent/tsv.vim | 13 ++----------- 4 files changed, 12 insertions(+), 28 deletions(-) diff --git a/vim/ftplugin/csv.vim b/vim/ftplugin/csv.vim index 162da402..9bd3e86e 100644 --- a/vim/ftplugin/csv.vim +++ b/vim/ftplugin/csv.vim @@ -4,8 +4,6 @@ if exists('b:did_ftplugin') endif let b:did_ftplugin = 1 -" No autoformatting, literal tabs -setlocal noautoindent -setlocal noexpandtab +" No autoformatting setlocal formatoptions= -let b:undo_ftplugin = 'setlocal autoindent< expandtab< formatoptions<' +let b:undo_ftplugin = 'formatoptions<' diff --git a/vim/ftplugin/tsv.vim b/vim/ftplugin/tsv.vim index 162da402..f78da35f 100644 --- a/vim/ftplugin/tsv.vim +++ b/vim/ftplugin/tsv.vim @@ -1,11 +1,2 @@ -" Only do this when not yet done for this buffer -if exists('b:did_ftplugin') - finish -endif -let b:did_ftplugin = 1 - -" No autoformatting, literal tabs -setlocal noautoindent -setlocal noexpandtab -setlocal formatoptions= -let b:undo_ftplugin = 'setlocal autoindent< expandtab< formatoptions<' +" TSVs have the same filetype options as CSVs +runtime! ftplugin/csv.vim diff --git a/vim/indent/csv.vim b/vim/indent/csv.vim index fd3c99de..78bddd33 100644 --- a/vim/indent/csv.vim +++ b/vim/indent/csv.vim @@ -4,8 +4,12 @@ if exists('b:did_indent') endif let b:did_indent = 1 -" Manual indenting and literal tabs for CSVs +" Manual indenting setlocal noautoindent +let b:undo_indent = 'setlocal autoindent<' + +" Literal tabs setlocal noexpandtab setlocal softtabstop=0 -let b:undo_indent = 'setlocal autoindent< expandtab< softtabstop<' +let &shiftwidth = &tabstop +let b:undo_indent = 'setlocal expandtab< softtabstop< shiftwidth<' diff --git a/vim/indent/tsv.vim b/vim/indent/tsv.vim index adbde97d..ae72397c 100644 --- a/vim/indent/tsv.vim +++ b/vim/indent/tsv.vim @@ -1,11 +1,2 @@ -" Only do this when not done yet for this buffer -if exists('b:did_indent') - finish -endif -let b:did_indent = 1 - -" Manual indenting and literal tabs for TSVs -setlocal noautoindent -setlocal noexpandtab -setlocal softtabstop=0 -let b:undo_indent = 'setlocal autoindent< expandtab< softtabstop<' +" TSVs have the same indent options as CSVs +runtime! indent/csv.vim -- cgit v1.2.3 From 180f1f9b19019ee2069ba930fedf58258bc8b7f0 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 14 Jun 2019 23:00:24 +1200 Subject: Bump VERSION --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index c055b047..f33dc294 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -tejr dotfiles v6.1.0 -Fri Jun 14 05:39:51 UTC 2019 +tejr dotfiles v6.2.0 +Fri Jun 14 11:00:24 UTC 2019 -- cgit v1.2.3