diff options
-rw-r--r-- | Makefile | 8 | ||||
-rw-r--r-- | README.md | 52 | ||||
-rw-r--r-- | VERSION | 4 | ||||
-rw-r--r-- | man/man7/dotfiles.7df | 64 | ||||
-rw-r--r-- | vim/vimrc | 77 |
5 files changed, 74 insertions, 131 deletions
@@ -550,12 +550,6 @@ install-vim: install-vim-after \ install-vim-plugin \ install-vim-syntax -install-neovim: - make install-vim \ - VIM=nvim \ - VIMDIR="$${XDG_CONFIG_HOME:-"$$HOME"/.config}/nvim" \ - VIMRC="$${XDG_CONFIG_HOME:-"$$HOME"/.config}/nvim/init.vim" - install-vim-after: install-vim-after-ftplugin \ install-vim-after-indent \ install-vim-after-plugin \ @@ -592,7 +586,9 @@ install-vim-bundle: install-vim-config install-vim-cache: mkdir -p -- \ + $(VIMDIR)/cache \ $(VIMDIR)/cache/backup \ + $(VIMDIR)/cache/spell \ $(VIMDIR)/cache/swap \ $(VIMDIR)/cache/undo @@ -112,7 +112,6 @@ Configuration is included for: * [tidy](http://www.html-tidy.org/) -- HTML/XHTML linter and tidier * [tmux](https://tmux.github.io/) -- Terminal multiplexer similar to GNU Screen * [Vim](https://www.vim.org/) -- Vi IMproved, a text editor - * [Neovim](https://neovim.io/) -- An "emphatic fork" of Vim * [X11](https://www.x.org/wiki/) -- Windowing system with network transparency for Unix @@ -344,17 +343,14 @@ key combination to detach. The majority of the Vim configuration is just setting options, with a fair few mappings and remappings, both global and buffer-local. I try not to deviate too much from the Vim defaults behavior in terms of interactive behavior and -keybindings. It's extensively commented, mostly because I was reading through -it one day and realized I'd forgotten what half of it did. System-specific -configuration files go in `~/.vim/config`. +keybindings. It's extensively commented. #### Filetypes I define my own `filetype.vim` and `scripts.vim`, so that filetype detection -works in a way I like, and loads quickly. They are very unlikely to suit you -as they are, but you might be able to extend them with your favourite -filetypes. If you delete both of them from `~/.vim`, you'll get the stock -filetype detection back. +works in a way I like, and loads quickly. They are unlikely to suit you as +they are, but if you want to use it, you can extend them with your favourite +filetypes in custom `ftdetect` rules. #### Plugins @@ -363,37 +359,31 @@ structures like functions, I like to implement it as a plugin in `~/.vim/plugin` and/or `~/.vim/autoload`, with documentation for each in `~/.vim/doc`. -They eventually get either discarded or spun off into their own repositories, -added to this repository as submodules under `vim/bundle` instead, and uploaded -to [vim.org](https://www.vim.org/account/profile.php?user_id=73687). +They eventually get either discarded if I stop using them, or spun off into +their own repositories if I don't, and added to this repository as submodules +under `vim/bundle` instead. Some of them I upload to +[vim.org](https://www.vim.org/account/profile.php?user_id=73687). #### Filetype plugins -I also define a few rules specific to file types I often edit in -`~/.vim/after/ftplugin`, including some buffer-local mapping targets for -checking, linting, and tidying, and a few more in `~/.vim/after/indent`. There -are also a few tweaks to core syntax files in `~/.vim/after/syntax`, especially -for shell script (`sh.vim`). Some of these filetype plugins are also due to be -separately distributed and installed via submodules instead. +I apply some replacement or supplementary configuration specific to file types +I often edit in `~/.vim` and `~/.vim/after`, in the `ftplugin`, `indent`, and +`syntax` subdirectories. Some of these filetype plugins or extensions will +also eventually be removed to be separately distributed, and installed via +submodules instead. #### Compilers -I define a few of my own `:compiler` scripts for `~/.vim/compiler`, for use for -checking and linting of appropriate filetypes. Because checking (does it -compile?) and linting (is it correct and well-written?) are separate processes -for me, I bind them separately with local leader maps; for example, for `perl` -filetypes, `,c` switches `makprg` to `perl -c`, and `,l` to `perlcritic`. +I define a few of my own `:compiler` scripts for `~/.vim/compiler` to check and +lint appropriate filetypes. I bind checking--"does it run?"--and linting--"is +it good?"--with separate local leader maps; for example, for `perl` filetypes, +`<LocalLeader>c` switches `makeprg` to `perl -c` for checking, and +`<LocalLeader>l` to `perlcritic` for linting. -#### Neovim +#### No Neovim support -I test my configuration every now and then with the [Neovim -fork](https://neovim.io/). There's an `install-neovim` target to run -`install-vim` with the appropriate paths changed. - -Its [godless arrogance](https://twitter.com/tpope/status/437019518444240896) -notwithstanding, I do rather like Neovim overall, but I'm not presently using -it as my daily driver, and so it might balk at recent addenda to my -configuration. +The configuration doesn't explicitly support Neovim, although most of it will +probably work. Scripts ------- @@ -1,2 +1,2 @@ -tejr dotfiles v5.42.1 -Wed Jun 12 01:41:55 UTC 2019 +tejr dotfiles v5.43.0 +Wed Jun 12 23:45:44 UTC 2019 diff --git a/man/man7/dotfiles.7df b/man/man7/dotfiles.7df index fcdb9416..16110f76 100644 --- a/man/man7/dotfiles.7df +++ b/man/man7/dotfiles.7df @@ -170,10 +170,6 @@ tmux (https://tmux.github.io/) \[en] Terminal multiplexer similar to GNU Screen .IP \[bu] 2 Vim (https://www.vim.org/) \[en] Vi IMproved, a text editor -.RS 2 -.IP \[bu] 2 -Neovim (https://neovim.io/) \[en] An \[lq]emphatic fork\[rq] of Vim -.RE .IP \[bu] 2 X11 (https://www.x.org/wiki/) \[en] Windowing system with network transparency for Unix @@ -494,17 +490,14 @@ The majority of the Vim configuration is just setting options, with a fair few mappings and remappings, both global and buffer\-local. I try not to deviate too much from the Vim defaults behavior in terms of interactive behavior and keybindings. -It's extensively commented, mostly because I was reading through it one -day and realized I'd forgotten what half of it did. -System\-specific configuration files go in \f[C]~/.vim/config\f[]. +It's extensively commented. .SS Filetypes .PP I define my own \f[C]filetype.vim\f[] and \f[C]scripts.vim\f[], so that filetype detection works in a way I like, and loads quickly. -They are very unlikely to suit you as they are, but you might be able to -extend them with your favourite filetypes. -If you delete both of them from \f[C]~/.vim\f[], you'll get the stock -filetype detection back. +They are unlikely to suit you as they are, but if you want to use it, +you can extend them with your favourite filetypes in custom +\f[C]ftdetect\f[] rules. .SS Plugins .PP If the logic for doing something involves more than a few lines or any @@ -512,43 +505,32 @@ structures like functions, I like to implement it as a plugin in \f[C]~/.vim/plugin\f[] and/or \f[C]~/.vim/autoload\f[], with documentation for each in \f[C]~/.vim/doc\f[]. .PP -They eventually get either discarded or spun off into their own -repositories, added to this repository as submodules under -\f[C]vim/bundle\f[] instead, and uploaded to +They eventually get either discarded if I stop using them, or spun off +into their own repositories if I don't, and added to this repository as +submodules under \f[C]vim/bundle\f[] instead. +Some of them I upload to vim.org (https://www.vim.org/account/profile.php?user_id=73687). .SS Filetype plugins .PP -I also define a few rules specific to file types I often edit in -\f[C]~/.vim/after/ftplugin\f[], including some buffer\-local mapping -targets for checking, linting, and tidying, and a few more in -\f[C]~/.vim/after/indent\f[]. -There are also a few tweaks to core syntax files in -\f[C]~/.vim/after/syntax\f[], especially for shell script -(\f[C]sh.vim\f[]). -Some of these filetype plugins are also due to be separately distributed -and installed via submodules instead. +I apply some replacement or supplementary configuration specific to file +types I often edit in \f[C]~/.vim\f[] and \f[C]~/.vim/after\f[], in the +\f[C]ftplugin\f[], \f[C]indent\f[], and \f[C]syntax\f[] subdirectories. +Some of these filetype plugins or extensions will also eventually be +removed to be separately distributed, and installed via submodules +instead. .SS Compilers .PP I define a few of my own \f[C]:compiler\f[] scripts for -\f[C]~/.vim/compiler\f[], for use for checking and linting of -appropriate filetypes. -Because checking (does it compile?) and linting (is it correct and -well\-written?) are separate processes for me, I bind them separately -with local leader maps; for example, for \f[C]perl\f[] filetypes, -\f[C],c\f[] switches \f[C]makprg\f[] to \f[C]perl\ \-c\f[], and -\f[C],l\f[] to \f[C]perlcritic\f[]. -.SS Neovim -.PP -I test my configuration every now and then with the Neovim -fork (https://neovim.io/). -There's an \f[C]install\-neovim\f[] target to run \f[C]install\-vim\f[] -with the appropriate paths changed. +\f[C]~/.vim/compiler\f[] to check and lint appropriate filetypes. +I bind checking\[en]\[lq]does it run?\[rq]\[en]and linting\[en]\[lq]is +it good?\[rq]\[en]with separate local leader maps; for example, for +\f[C]perl\f[] filetypes, \f[C]<LocalLeader>c\f[] switches +\f[C]makeprg\f[] to \f[C]perl\ \-c\f[] for checking, and +\f[C]<LocalLeader>l\f[] to \f[C]perlcritic\f[] for linting. +.SS No Neovim support .PP -Its godless -arrogance (https://twitter.com/tpope/status/437019518444240896) -notwithstanding, I do rather like Neovim overall, but I'm not presently -using it as my daily driver, and so it might balk at recent addenda to -my configuration. +The configuration doesn't explicitly support Neovim, although most of it +will probably work. .SS Scripts .PP Where practical, I make short scripts into POSIX (but not Bourne) @@ -324,14 +324,19 @@ else set backupdir^=$MYVIM/cache/backup endif -" Vim doesn't seem to check patterns added to 'backupskip' for uniqueness, so -" adding them repeatedly if this file is reloaded results in duplicate strings -" in the value, due to the absence of the P_NODUP flag for the option's -" definition in src/option.c in the Vim source code. This is likely a bug in -" Vim. For the moment, to work around the problem, we reset the path back to -" its default first. -" -set backupskip& +" Prior to v8.1.1519, Vim didn't check patterns added to 'backupskip' for +" uniqueness, so adding the same path repeatedly resulted in duplicate strings +" in the value. This was due to the absence of the P_NODUP flag for the +" option's definition in src/option.c in the Vim source code. If we're using +" a version older than v8.1.1519, we'll need to explicitly reset 'backupskip' +" to its default value, so that reloading this file doesn't stack up multiple +" copies of any added paths. +" +" <https://github.com/vim/vim/releases/tag/v8.1.1519> +" +if !has('patch-8.1.1519') + set backupskip& +endif " Files in certain directories on Unix-compatible filesystems should not be " backed up, for security reasons. This is particularly important if editing @@ -351,7 +356,7 @@ endif " default of writing them to the same directory as the buffer file. Add two " trailing slashes to the path to prompt Vim to use the full escaped path in " its name, in order to avoid filename collisions, since the 'directory' -" option has supported that hint for much longer than 'backupdir has. We +" option has supported that hint for much longer than 'backupdir' has. We " apply :Establish to attempt to create the path first, if needed. " Establish $MYVIM/cache/swap @@ -548,13 +553,7 @@ set confirm " most or maybe all of the terminals I use, but I don't want those keys in " insert mode, anyway. All of this works fine in the GUI, of course. " -" There's no such option as 'esckeys' in Neovim. I gather that the fork has -" completely overhauled its method of keyboard event handling, so we need to -" check whether the option exists before we try to unset it. -" -if exists('+esckeys') - set noesckeys -endif +set noesckeys " By default, I prefer that figuring out where a region of text to fold away " should be done by the indent level of its lines, since I tend to be careful @@ -699,19 +698,6 @@ nohlsearch " set incsearch -" If there's only one window, I don't need a status line to appear beneath it. -" I very often edit only a few files in one window in a Vim session. I like the -" initial screen for a call to Vim with no arguments to be empty, save for the -" trademark tildes. It gives me an extra screen line, too. It's a reflex for -" me to press CTRL-G in normal mode if I need to see the buffer name, so I don't -" really lose anything. -" -" This value reflects the Vim default, but Neovim changed its default to '2' -" for an 'always-on' status line, so we'll explicitly set it to the original -" Vim default here in case we're using Neovim. -" -set laststatus=1 - " Don't waste cycles and bandwidth redrawing the screen during execution of " aggregate commands in e.g. macros. I think this does amount to the " occasional :redraw needing to be in a script, but it's not too bad, and last @@ -723,13 +709,6 @@ set lazyredraw " Define meta-characters to show in place of characters that are otherwise " invisible, or line wrapping attributes when the 'list' option is enabled. " -" We need to reset the option to its default value first, because the current -" Neovim version at the time of writing (v0.3.5) doesn't check these for -" uniqueness, resulting in duplicates if this file is reloaded. 'backupskip' -" has similar problems in the original Vim v8.1.1487 and earlier. -" -set listchars&vi - " These 'list' characters all correspond to invisible or indistinguishable " characters. We leave the default eol:$ in place to show newlines, and add " a few more. @@ -781,8 +760,8 @@ set nrformats-=octal " the Vim default of 'noruler'. CTRL-G shows me everything I need to know, " and is near-instinctive now. " -" Rude system vimrc files tend to switch this back on, though, and Neovim has -" it on by default, and so we force it off here. +" Rude system vimrc files tend to switch this back on, though, so we force it +" off here. " set noruler @@ -843,12 +822,7 @@ endif " The manual suggests that disabling this should be done by clearing 't_RV', " but that didn't actually seem to work when I tried it. " -" We have to check for the existence of the option first, as it doesn't exist -" in Neovim. -" -if exists('+ttymouse') - set ttymouse= -endif +set ttymouse= " While using virtual block mode, allow me to navigate to any column of the " buffer window; don't confine the boundaries of the block to the coordinates @@ -902,7 +876,7 @@ set wildmode=list:longest,full " sh -c 'for fn ; do " ext=${fn##*.} " case $ext in -" *[^[:alnum:]]*) continue ;; +" *[![:alnum:]]*) continue ;; " ?*) printf "%s\n" "$ext" ;; " esac " done' _ {} + | @@ -1403,12 +1377,13 @@ nnoremap <Leader>j " This ground defines mappings for filtering and batch operations to clean up " buffer text. All of these mappings use commands from my custom plugins: " -" <https://sanctum.geek.nz/cgit/vim-strip-trailing-whitespace.git/about/> -" :StripTrailingWhitespace -" <https://sanctum.geek.nz/cgit/vim-squeeze-repeat-blanks.git/about/> -" :SqueezeRepeatBlanks -" <https://sanctum.geek.nz/cgit/vim-keep-position.git/about/> -" :KeepPosition +" :KeepPosition +" <https://sanctum.geek.nz/cgit/vim-keep-position.git/about/> +" :SqueezeRepeatBlanks +" <https://sanctum.geek.nz/cgit/vim-squeeze-repeat-blanks.git/about/> +" :StripTrailingWhitespace +" <https://sanctum.geek.nz/cgit/vim-strip-trailing-whitespace.git/about/> +" "" Leader,x strips trailing whitespace nnoremap <Leader>x |