diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-10 00:11:31 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-10 00:11:31 +1200 |
commit | 291cbab91f86b3343102d8231fbfe4dfd9105b64 (patch) | |
tree | 70973f04a9a462e9886ee89d79a04e4b95ed7777 | |
parent | Add opening notes for the mapping section (diff) | |
download | dotfiles-291cbab91f86b3343102d8231fbfe4dfd9105b64.tar.gz dotfiles-291cbab91f86b3343102d8231fbfe4dfd9105b64.zip |
Document <Space> mapping
-rw-r--r-- | vim/vimrc | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -935,7 +935,23 @@ endtry " many of these. " -" Space bar scrolls down a page, :next at buffer's end if plugin available +" I like the space bar to scroll down a page, so I can lazily tap it to read +" documents, and I find its default behaviour of moving right one character to +" be useless. +" +" I also have a custom plugin named scroll_next.vim that issues :next to have +" it move to the next file in the arglist if the bottom line of the buffer is +" visible, for reading multiple buffers. +" +" However, I only want that plugin mapped if the plugin is actually going to +" load, so I check that it's available and that the 'loadplugin' option is set +" before using its provided map target, otherwise it kills the space key. If +" the plugin doesn't look like it's going to load, I just bind Space to do the +" same thing as PageDown. +" +" Either way, the downside of this arrangement is it's an easy key to hit +" accidentally. I'm keeping it for the moment, though. +" if globpath(&runtimepath, 'plugin/scroll_next.vim') !=# '' \ && &loadplugins nmap <Space> <Plug>(ScrollNext) |