aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-06-25 20:44:31 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-06-25 20:44:31 +1200
commit62aaa4eb10340bd2597b35307abc978f20cefc9c (patch)
treed292886b57e1800fb5e340340407b34d65a4af1a
parent4195ce53f3454c1ed5b85bd29fa75af84d3c455f (diff)
parent48a935b448063bcd4d4a64fe145783fae9f10c3e (diff)
downloaddotfiles-62aaa4eb10340bd2597b35307abc978f20cefc9c.tar.gz
Merge branch 'release/v1.4.0'v1.4.0
* release/v1.4.0: Bump VERSION Rebuild dotfiles(7) manual page Update README.md about Vim mappings Add and apply new clear_local_maps.vim plugin Use <Leader> in vimrc where reasonable Reindent and refactor local leader mappings
-rw-r--r--.gitmodules3
-rw-r--r--README.md21
-rw-r--r--VERSION4
-rw-r--r--man/man7/dotfiles.7df6
m---------vim/bundle/clear_local_maps0
-rw-r--r--vim/vimrc61
6 files changed, 49 insertions, 46 deletions
diff --git a/.gitmodules b/.gitmodules
index dd10f0e4..46810091 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -5,6 +5,9 @@
[submodule "vim/bundle/big_file_options"]
path = vim/bundle/big_file_options
url = https://sanctum.geek.nz/code/vim-big-file-options.git
+[submodule "vim/bundle/clear_local_maps"]
+ path = vim/bundle/clear_local_maps
+ url = https://sanctum.geek.nz/code/vim-clear-local-maps.git
[submodule "vim/bundle/copy_linebreak"]
path = vim/bundle/copy_linebreak
url = https://sanctum.geek.nz/code/vim-copy-linebreak.git
diff --git a/README.md b/README.md
index b8f2f801..e8f6b2c1 100644
--- a/README.md
+++ b/README.md
@@ -334,11 +334,12 @@ combination to detach.
### Vim
-The majority of the Vim configuration is just setting options, with a few
-mappings. 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`.
+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`.
#### Filetypes
@@ -372,11 +373,11 @@ implemented in or bundled with Vim itself many years ago.
#### Filetype plugins
I also define a few rules specific to file types I often edit in
-`~/.vim/after/ftplugin`, including some local mappings 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.
+`~/.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.
#### Compilers
diff --git a/VERSION b/VERSION
index 1dcd1d76..63582f6a 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-tejr dotfiles v1.3.0
-Mon Jun 25 02:01:41 UTC 2018
+tejr dotfiles v1.4.0
+Mon Jun 25 08:40:45 UTC 2018
diff --git a/man/man7/dotfiles.7df b/man/man7/dotfiles.7df
index 4daf288d..af533838 100644
--- a/man/man7/dotfiles.7df
+++ b/man/man7/dotfiles.7df
@@ -474,7 +474,7 @@ binds the same key combination to detach.
.SS Vim
.PP
The majority of the Vim configuration is just setting options, with a
-few mappings.
+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
@@ -515,8 +515,8 @@ ago.
.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 local mappings for
-checking, linting, and tidying, and a few more 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
diff --git a/vim/bundle/clear_local_maps b/vim/bundle/clear_local_maps
new file mode 160000
+Subproject b1038f42ef051f2829464b60d3a4aa13f3020d3
diff --git a/vim/vimrc b/vim/vimrc
index 86f13359..12892474 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -219,12 +219,12 @@ if has('digraphs')
endif
" Normal mode leader mappings below; use a literal backslash rather than
-" <Leader> so that the non-plugin mappings work on vim-tiny
+" <Leader> on the non-plugin maps so that they work on vim-tiny
" \a toggles 'formatoptions' 'a' flag using a plugin
-nnoremap \a :<C-U>ToggleOptionFlagLocal formatoptions a<CR>
+nnoremap <Leader>a :<C-U>ToggleOptionFlagLocal formatoptions a<CR>
" \b toggles copy-pasteable linebreak settings
-nmap \b <Plug>CopyLinebreakToggle
+nmap <Leader>b <Plug>CopyLinebreakToggle
" \c toggles 'cursorcolumn', \C toggles 'cursorline'
nnoremap \c :<C-U>set cursorcolumn! cursorcolumn?<CR>
nnoremap \C :<C-U>set cursorline! cursorline?<CR>
@@ -250,8 +250,8 @@ nnoremap \l :<C-U>set list! list?<CR>
" \n toggles line numbers
nnoremap \n :<C-U>set number! number?<CR>
" \o and \O open 'pasted insert' lines
-nmap \o <Plug>PasteOpenBelow
-nmap \O <Plug>PasteOpenAbove
+nmap <Leader>o <Plug>PasteOpenBelow
+nmap <Leader>O <Plug>PasteOpenAbove
" \p toggles paste mode
nnoremap \p :<C-U>set paste! paste?<CR>
" \r reloads .vimrc
@@ -265,7 +265,7 @@ nnoremap \u :<C-U>setlocal spelllang=en_us spelllang?<CR>
" \w toggles wrapping
nnoremap \w :<C-U>set wrap! wrap?<CR>
" \x strips trailing whitespace via a custom plugin
-nmap \x <Plug>StripTrailingWhitespace
+nmap <Leader>x <Plug>StripTrailingWhitespace
" \z sets NZ English spelling (compare \u)
nnoremap \z :<C-U>setlocal spelllang=en_nz spelllang?<CR>
@@ -274,41 +274,40 @@ if 1
let g:maplocalleader = '_'
endif
-" Filetype-specific mappings below; use a literal underscore rather than
-" <LocalLeader> to keep the commands short
+" Filetype-specific mappings
if has('autocmd') && v:version >= 700
augroup vimrc_filetype_mappings
- autocmd!
+ autocmd!
- " Clear existing local leader maps
- autocmd FileType * call vimrc#ClearLocalLeaderMaps()
+ " Clear existing local leader maps
+ autocmd FileType * silent! call clear_local_maps#Clear()
- " Diff: prune sections
- autocmd FileType diff nmap <buffer> _p <Plug>DiffPrune
- autocmd FileType diff xmap <buffer> _p <Plug>DiffPrune
+ " Diff: prune sections
+ autocmd FileType diff nmap <buffer> <LocalLeader>p <Plug>DiffPrune
+ autocmd FileType diff xmap <buffer> <LocalLeader>p <Plug>DiffPrune
- " HTML: lint, URL-to-link, tidy
- autocmd FileType html nmap <buffer> _l <Plug>HtmlLint
- autocmd FileType html nmap <buffer> _r <Plug>HtmlUrlLink
- autocmd FileType html nmap <buffer> _t <Plug>HtmlTidy
+ " HTML: lint, URL-to-link, tidy
+ autocmd FileType html nmap <buffer> <LocalLeader>l <Plug>HtmlLint
+ autocmd FileType html nmap <buffer> <LocalLeader>r <Plug>HtmlUrlLink
+ autocmd FileType html nmap <buffer> <LocalLeader>t <Plug>HtmlTidy
- " Perl: check, lint, and tidy
- autocmd FileType perl nmap <buffer> _c <Plug>PerlCheck
- autocmd FileType perl nmap <buffer> _l <Plug>PerlLint
- autocmd FileType perl nmap <buffer> _t <Plug>PerlTidy
+ " Perl: check, lint, and tidy
+ autocmd FileType perl nmap <buffer> <LocalLeader>c <Plug>PerlCheck
+ autocmd FileType perl nmap <buffer> <LocalLeader>l <Plug>PerlLint
+ autocmd FileType perl nmap <buffer> <LocalLeader>t <Plug>PerlTidy
- " PHP: check
- autocmd FileType php nmap <buffer> _c <Plug>PhpCheck
+ " PHP: check
+ autocmd FileType php nmap <buffer> <LocalLeader>c <Plug>PhpCheck
- " Shell: check and lint
- autocmd FileType sh nmap <buffer> _c <Plug>ShCheck
- autocmd FileType sh nmap <buffer> _l <Plug>ShLint
+ " Shell: check and lint
+ autocmd FileType sh nmap <buffer> <LocalLeader>c <Plug>ShCheck
+ autocmd FileType sh nmap <buffer> <LocalLeader>l <Plug>ShLint
- " VimL: lint
- autocmd FileType vim nmap <buffer> _l <Plug>VimLint
+ " VimL: lint
+ autocmd FileType vim nmap <buffer> <LocalLeader>l <Plug>VimLint
- " Zsh: check
- autocmd FileType zsh nmap <buffer> _c <Plug>ZshCheck
+ " Zsh: check
+ autocmd FileType zsh nmap <buffer> <LocalLeader>c <Plug>ZshCheck
augroup END
endif