diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-10 00:11:18 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-10 00:11:18 +1200 |
commit | 9a9b19dc0c734e4304f492656241e8c593d654a1 (patch) | |
tree | cf215be98f89b92bfc3a1ca2975ffd2e53db416e /vim/vimrc | |
parent | Flesh out comment on persistent undo (diff) | |
download | dotfiles-9a9b19dc0c734e4304f492656241e8c593d654a1.tar.gz dotfiles-9a9b19dc0c734e4304f492656241e8c593d654a1.zip |
Add opening notes for the mapping section
Diffstat (limited to 'vim/vimrc')
-rw-r--r-- | vim/vimrc | 36 |
1 files changed, 36 insertions, 0 deletions
@@ -899,6 +899,42 @@ catch set nocursorline endtry +" My mapping definitions begin here. I have some general personal rules for +" approaches to mappings: +" +" * Use the configured Leader key as a prefix for mappings as much as +" possible. +" +" * Use only the configured LocalLeader key as a prefix for mappings that are +" defined as local to a buffer, which for me are almost always based on +" &filetype and set up by ftplugin files. +" +" * If a normal mode map would make sense in visual mode, take the time to +" configure that too. Use :xmap and its analogues rather :vmap to avoid +" defining unusable select-mode mappings, even though I never actually use +" selection mode directly. +" +" * Avoid mapping in insert mode; let characters be literal to the greatest +" extent possible, and avoid "doing more" in insert mode besides merely +" inserting text as it's typed. +" +" * Avoid chording with Ctrl in favour of leader keys. +" +" * Never use Alt/Meta chording; the terminal support for them is just too +" confusing and flaky. +" +" * Don't suppress display of mapped commands for no reason; it's OK to show +" the user the command that's being run under the hood. Do avoid HIT-ENTER +" prompts, though. +" +" * Avoid shadowing any of Vim's existing functionality. If possible, extend +" or supplement what Vim does, rather than replacing it. +" + +" We'll start with the non-leader mappings. Ideally there shouldn't be too +" many of these. +" + " Space bar scrolls down a page, :next at buffer's end if plugin available if globpath(&runtimepath, 'plugin/scroll_next.vim') !=# '' \ && &loadplugins |