aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-18 12:40:59 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-18 12:40:59 +1200
commit90943a69c9ca7b71eec6465431e6d7461e62af1b (patch)
treebc6045f0466ff4fc272a010b512db246e7169cdf
parentMerge branch 'release/v4.31.0' (diff)
parentBump VERSION (diff)
downloaddotfiles-4.32.0.tar.gz (sig)
dotfiles-4.32.0.zip
Merge branch 'release/v4.32.0'v4.32.0
* release/v4.32.0: Bump VERSION Remove accidentally created "3" file More compact layout for 'wildignore' setting Update vim-sahara to v1.2.0 Move single ftdetect rule into filetype.vim Test 'compatible' is off before loading main vimrc Add a couple of abbreviations Don't suppress errors from loading matchit Adjust formatting of a leading comment Move 'wildignore' setting back into .vimrc
-rw-r--r--3219
-rw-r--r--Makefile6
-rw-r--r--VERSION4
m---------vim/bundle/sahara0
-rw-r--r--vim/filetype.vim10
-rw-r--r--vim/ftdetect/perl.vim9
-rw-r--r--vim/plugin/dist.vim3
-rw-r--r--vim/plugin/matchit.vim2
-rw-r--r--vim/plugin/wildignore.vim173
-rw-r--r--vim/vimrc28
-rw-r--r--vim/vimrc.stub.vim2
11 files changed, 43 insertions, 413 deletions
diff --git a/3 b/3
deleted file mode 100644
index a63baadd..00000000
--- a/3
+++ /dev/null
@@ -1,219 +0,0 @@
-" Remove g:is_posix if we resorted to it in order to get correct POSIX sh
-" highlighting with older Vim runtime files
-if exists('is_posix')
- unlet! is_posix is_kornshell
-endif
-
-" If we know we have another shell type, clear away the others completely, now
-" that core syntax/sh.vim is done prodding /bin/sh to determine the system
-" shell type (which I don't care about).
-if exists('b:is_bash')
- unlet! b:is_sh b:is_posix b:is_kornshell
-elseif exists('b:is_kornshell')
- unlet! b:is_sh b:is_posix
-elseif exists('b:is_posix')
- unlet! b:is_sh
-endif
-
-" The syntax highlighter seems to flag '/baz' in '"${foo:-"$bar"/baz}"' as an
-" error, which it isn't, at least in POSIX sh, Bash, and Ksh.
-syntax clear shDerefWordError
-
-" The syntax highlighter doesn't match parens for subshells for 'if' tests
-" correctly if they're on separate lines. This happens enough that it's
-" probably not worth keeping the error.
-syntax clear shParenError
-
-" The syntax highlighter flags this code with an error on the final square
-" bracket: `case $foo in [![:ascii:]]) ;; esac`, but that's all legal. I'm not
-" yet sure how to fix it, so will just turn the error group for now.
-syntax clear shTestError
-
-" Highlighting corrections specific to POSIX mode
-if exists('b:is_posix')
-
- " Highlight some commands that are both defined by POSIX and builtin
- " commands in dash, as a rough but useable proxy for 'shell builtins'. This
- " list was mostly wrested from `man 1 dash`. Also include control structure
- " keywords like `break`, `continue`, and `return`.
- syntax clear shStatement
- syntax cluster shCommandSubList add=shStatement
- syntax cluster shCaseList add=shStatement
- syntax keyword shStatement
- \ alias
- \ bg
- \ break
- \ cd
- \ command
- \ continue
- \ echo
- \ eval
- \ exec
- \ exit
- \ export
- \ fc
- \ fg
- \ getopts
- \ hash
- \ kill
- \ printf
- \ pwd
- \ read
- \ readonly
- \ return
- \ set
- \ shift
- \ test
- \ times
- \ trap
- \ true
- \ type
- \ ulimit
- \ umask
- \ unalias
- \ unset
- \ wait
-
- " Core syntax/sh.vim puts IFS and other variables that affect shell function
- " in another color, but a subset of them actually apply to POSIX shell too
- " (and plain Bourne). These are selected by searching the POSIX manpages. I
- " added NLSPATH too, which wasn't in the original.
- syntax clear shShellVariables
- syntax cluster shCommandSubList add=shShellVariables
- syntax keyword shShellVariables
- \ CDPATH
- \ ENV
- \ FCEDIT
- \ HISTFILE
- \ HISTSIZE
- \ HISTTIMEFORMAT
- \ HOME
- \ IFS
- \ LANG
- \ LC_ALL
- \ LC_COLLATE
- \ LC_CTYPE
- \ LC_MESSAGES
- \ LC_NUMERIC
- \ LINENO
- \ MAIL
- \ MAILCHECK
- \ MAILPATH
- \ NLSPATH
- \ OLDPWD
- \ OPTARG
- \ OPTERR
- \ OPTIND
- \ PATH
- \ PS1
- \ PS2
- \ PS3
- \ PS4
- \ PWD
-
- " Core syntax/sh.vim thinks 'until' is a POSIX control structure keyword,
- " but it isn't. Reset shRepeat and rebuild it with just 'while'. I only
- " sort-of understand what this does, but it works.
- syntax clear shRepeat
- syntax region shRepeat
- \ matchgroup=shLoop
- \ start='\<while\_s' end='\<do\>'me=e-2
- \ contains=@shLoopList
-
- " Run some clustering that core syntax/sh.vim thinks doesn't apply to POSIX;
- " this fixes while loops so they can be within other blocks.
- syntax cluster shCaseList add=shRepeat
- syntax cluster shFunctionList add=shRepeat
-
- " ${foo%bar}, ${foo%%bar}, ${foo#bar}, and ${foo##bar} are all valid forms
- " of parameter expansion in POSIX, but sh.vim makes them conditional on
- " Bash or Korn shell. We reinstate them (slightly adapted) here.
- syntax match shDerefOp contained
- \ '##\|#\|%%\|%'
- \ nextgroup=@shDerefPatternList
- syntax match shDerefPattern contained
- \ '[^{}]\+'
- \ contains=shDeref,shDerefEscape,shDerefPattern,shDerefSimple,shDerefString
- \,shDerefString,shCommandSub
- \ nextgroup=shDerefPattern
- syntax region shDerefPattern contained
- \ start='{' end='}'
- \ contains=shDeref,shDerefSimple,shDerefString,shCommandSub
- \ nextgroup=shDerefPattern
-
-endif
-
-" Some corrections for highlighting specific to the Bash mode
-if exists('b:is_bash')
-
- " I don't like bashAdminStatement; these are not keywords, they're just
- " strings for init scripts.
- syntax clear bashAdminStatement
-
- " Reduce bashStatement down to just builtins; highlighting 'grep' is not
- " very useful. This list was taken from `compgen -A helptopic` on Bash
- " 4.4.5.
- syntax clear bashStatement
- syntax keyword bashStatement
- \ .
- \ :
- \ alias
- \ bg
- \ bind
- \ break
- \ builtin
- \ caller
- \ cd
- \ command
- \ compgen
- \ complete
- \ compopt
- \ continue
- \ coproc
- \ dirs
- \ disown
- \ echo
- \ enable
- \ eval
- \ exec
- \ exit
- \ false
- \ fc
- \ fg
- \ function
- \ getopts
- \ hash
- \ help
- \ history
- \ jobs
- \ kill
- \ let
- \ logout
- \ mapfile
- \ popd
- \ printf
- \ pushd
- \ pwd
- \ read
- \ readarray
- \ readonly
- \ return
- \ select
- \ set
- \ shift
- \ shopt
- \ source
- \ suspend
- \ test
- \ time
- \ times
- \ trap
- \ true
- \ type
- \ ulimit
- \ umask
- \ unalias
- \ until
- \ variables
- \ wait
-endif
diff --git a/Makefile b/Makefile
index 696fd72a..df29b947 100644
--- a/Makefile
+++ b/Makefile
@@ -51,7 +51,6 @@
install-vim-compiler \
install-vim-config \
install-vim-filetype \
- install-vim-ftdetect \
install-vim-ftplugin \
install-vim-gui \
install-vim-gui-config \
@@ -531,7 +530,6 @@ install-vim: install-vim-after \
install-vim-compiler \
install-vim-config \
install-vim-filetype \
- install-vim-ftdetect \
install-vim-ftplugin \
install-vim-indent \
install-vim-plugin \
@@ -599,10 +597,6 @@ install-vim-config: install-vim-cache
install-vim-filetype:
cp -p -- vim/filetype.vim vim/scripts.vim $(VIMDIR)
-install-vim-ftdetect:
- mkdir -p -- $(VIMDIR)/ftdetect
- cp -p -- vim/ftdetect/*.vim $(VIMDIR)/ftdetect
-
install-vim-ftplugin:
mkdir -p -- $(VIMDIR)/ftplugin
cp -p -- vim/ftplugin/*.vim $(VIMDIR)/ftplugin
diff --git a/VERSION b/VERSION
index f1f04c8d..83ce6dfe 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-tejr dotfiles v4.31.0
-Fri May 17 11:11:41 UTC 2019
+tejr dotfiles v4.32.0
+Sat May 18 00:40:59 UTC 2019
diff --git a/vim/bundle/sahara b/vim/bundle/sahara
-Subproject 901fdb72c3fe74ee5f0aa49c2fda52af3cbde08
+Subproject 7504b62005330302110ed26f84ac2f588251ca7
diff --git a/vim/filetype.vim b/vim/filetype.vim
index d7ca5255..9d6c6eb7 100644
--- a/vim/filetype.vim
+++ b/vim/filetype.vim
@@ -462,6 +462,16 @@ augroup filetypedetect
\,zshrc
\ setfiletype zsh
+ " If it's a new file in a bin, libexec, or scripts subdir that has a
+ " Makefile.PL sibling, and I'm editing it, it's almost definitely Perl.
+ autocmd BufNewFile
+ \ ?*/bin/?*
+ \,?*/libexec/?*
+ \,?*/scripts/?*
+ \ if filereadable(expand('<afile>:p:h:h') . '/Makefile.PL')
+ \| setfiletype perl
+ \|endif
+
" Load any extra rules in ftdetect directories
runtime! ftdetect/*.vim
diff --git a/vim/ftdetect/perl.vim b/vim/ftdetect/perl.vim
deleted file mode 100644
index 887a9fb6..00000000
--- a/vim/ftdetect/perl.vim
+++ /dev/null
@@ -1,9 +0,0 @@
-" If it's a new file in a bin, libexec, or scripts subdir that has a
-" Makefile.PL sibling, and I'm editing it, it's almost definitely Perl.
-autocmd filetypedetect BufNewFile
- \ ?*/bin/?*
- \,?*/libexec/?*
- \,?*/scripts/?*
- \ if filereadable(expand('<afile>:p:h:h') . '/Makefile.PL')
- \| setfiletype perl
- \|endif
diff --git a/vim/plugin/dist.vim b/vim/plugin/dist.vim
index 7c745e4f..3a84abaa 100644
--- a/vim/plugin/dist.vim
+++ b/vim/plugin/dist.vim
@@ -1,4 +1,5 @@
-" Skip loading some plugins:
+" Skip loading some plugins
+
" I manage plugins myself with Git and a Makefile
let loaded_getscriptPlugin = 1
let loaded_vimballPlugin = 1
diff --git a/vim/plugin/matchit.vim b/vim/plugin/matchit.vim
index 4507640e..f842bd9c 100644
--- a/vim/plugin/matchit.vim
+++ b/vim/plugin/matchit.vim
@@ -2,5 +2,5 @@
if has('packages') && !has('nvim')
packadd matchit
else
- silent! runtime macros/matchit.vim
+ runtime macros/matchit.vim
endif
diff --git a/vim/plugin/wildignore.vim b/vim/plugin/wildignore.vim
deleted file mode 100644
index 36a8f492..00000000
--- a/vim/plugin/wildignore.vim
+++ /dev/null
@@ -1,173 +0,0 @@
-" Don't complete certain files that I'm not likely to want to manipulate from
-" within Vim; this is kind of expensive to reload, so I've made it a plugin
-" with a load guard
-if &compatible || v:version < 700 || !has('wildignore')
- finish
-endif
-if exists('loaded_wildmenu')
- finish
-endif
-let loaded_wildmenu = 1
-
-" Helper function for local scope
-function! s:Wildignore() abort
-
- " New empty array
- let ignores = []
-
- " Archives
- let ignores += [
- \ '*.7z'
- \,'*.bz2'
- \,'*.gz'
- \,'*.jar'
- \,'*.rar'
- \,'*.tar'
- \,'*.xz'
- \,'*.zip'
- \ ]
-
- " Bytecode
- let ignores += [
- \ '*.class'
- \,'*.pyc'
- \ ]
-
- " Databases
- let ignores += [
- \ '*.db'
- \,'*.dbm'
- \,'*.sdbm'
- \,'*.sqlite'
- \ ]
-
- " Disk
- let ignores += [
- \ '*.adf'
- \,'*.bin'
- \,'*.hdf'
- \,'*.iso'
- \ ]
-
- " Documents
- let ignores += [
- \ '*.docx'
- \,'*.djvu'
- \,'*.odp'
- \,'*.ods'
- \,'*.odt'
- \,'*.pdf'
- \,'*.ppt'
- \,'*.xls'
- \,'*.xlsx'
- \ ]
-
- " Encrypted
- let ignores += [
- \ '*.asc'
- \,'*.gpg'
- \ ]
-
- " Executables
- let ignores += [
- \ '*.exe'
- \ ]
-
- " Fonts
- let ignores += [
- \ '*.ttf'
- \ ]
-
- " Images
- let ignores += [
- \ '*.bmp'
- \,'*.gd2'
- \,'*.gif'
- \,'*.ico'
- \,'*.jpeg'
- \,'*.jpg'
- \,'*.pbm'
- \,'*.png'
- \,'*.psd'
- \,'*.tga'
- \,'*.xbm'
- \,'*.xcf'
- \,'*.xpm'
- \ ]
-
- " Incomplete
- let ignores += [
- \ '*.filepart'
- \ ]
-
- " Objects
- let ignores += [
- \ '*.a'
- \,'*.o'
- \ ]
-
- " Sound
- let ignores += [
- \ '*.au'
- \,'*.aup'
- \,'*.flac'
- \,'*.mid'
- \,'*.m4a'
- \,'*.mp3'
- \,'*.ogg'
- \,'*.opus'
- \,'*.s3m'
- \,'*.wav'
- \ ]
-
- " System-specific
- let ignores += [
- \ '.DS_Store'
- \ ]
-
- " Translation
- let ignores += [
- \ '*.gmo'
- \ ]
-
- " Version control
- let ignores += [
- \ '.git'
- \,'.hg'
- \,'.svn'
- \ ]
-
- " Video
- let ignores += [
- \ '*.avi'
- \,'*.gifv'
- \,'*.mp4'
- \,'*.ogv'
- \,'*.rm'
- \,'*.swf'
- \,'*.webm'
- \ ]
-
- " Vim
- let ignores += [
- \ '*~'
- \,'*.swp'
- \ ]
-
- " If on a system where case matters for filenames, for any that had
- " lowercase letters, add their uppercase analogues
- if has('fname_case')
- for ignore in ignores
- if ignore =~# '\l'
- call add(ignores, toupper(ignore))
- endif
- endfor
- endif
-
- " Return the completed setting
- return join(ignores, ',')
-
-endfunction
-
-" Run helper function just defined
-let &wildignore = s:Wildignore()
diff --git a/vim/vimrc b/vim/vimrc
index 6b5fce34..ab4729ec 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -187,7 +187,29 @@ if has('persistent_undo')
set undodir^=$MYVIMRUNTIME/cache/undo//
endif
-" Tab completion settings; see also plugin/wildignore.vim
+" Tab completion settings
+set wildignore=*~
+ \,*.7z
+ \,*.a,*.adf,*.asc,*.au,*.aup,*.avi
+ \,*.bin,*.bmp,*.bz2
+ \,*.class
+ \,*.db,*.dbm,*.djvu,*.docx
+ \,*.exe
+ \,*.filepart,*.flac
+ \,*.gd2,*.gif,*.gifv,*.gmo,*.gpg,*.gz
+ \,*.hdf
+ \,*.ico,*.iso
+ \,*.jar,*.jpeg,*.jpg
+ \,*.m4a,*.mid,*.mp3,*.mp4
+ \,*.o,*.odp,*.ods,*.odt,*.ogg,*.ogv,*.opus
+ \,*.pbm,*.pdf,*.png,*.ppt,*.psd,*.pyc
+ \,*.rar,*.rm
+ \,*.s3m,*.sdbm,*.sqlite,*.swf,*.swp
+ \,*.tar,*.tga,*.ttf
+ \,*.wav,*.webm
+ \,*.xbm,*.xcf,*.xls,*.xlsx,*.xpm,*.xz
+ \,*.zip
+ \,.DS_Store,.git,.hg,.svn
if exists('+wildignorecase')
set wildignorecase " Case insensitive, if supported (v7.3.072)
endif
@@ -432,5 +454,9 @@ nnoremap <Leader>: ^"zyg_:<C-R>z<CR>
" \! executes line with 'shell'
nnoremap <Leader>! ^"zyg_:!<C-R>z<CR>
+" Things I almsot always type wrnog
+inoreabbrev almsot almost
+inoreabbrev wrnog wrong
+
" Source any .vim files from ~/.vim/config
runtime! config/*.vim
diff --git a/vim/vimrc.stub.vim b/vim/vimrc.stub.vim
index b2d8803a..1d8d3d9a 100644
--- a/vim/vimrc.stub.vim
+++ b/vim/vimrc.stub.vim
@@ -1,6 +1,6 @@
" If we have non-tiny Vim version >=7, source real vimrc; this works because
" tiny and/or ancient builds of Vim quietly ignore all code in :if blocks
-if v:version >= 700
+if v:version >= 700 && !&compatible
runtime vimrc
finish
endif