aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-11-23 14:26:08 +1300
committerTom Ryder <tom@sanctum.geek.nz>2019-11-23 14:26:08 +1300
commit167b949d8bc1131a202ea1379cbf0deb056f9fbe (patch)
tree6e8582ed3493808a6ade033f41c69c6bab0a9726
parentMerge branch 'release/v7.18.0' into develop (diff)
downloaddotfiles-167b949d8bc1131a202ea1379cbf0deb056f9fbe.tar.gz
dotfiles-167b949d8bc1131a202ea1379cbf0deb056f9fbe.zip
Refine "sticky star" mapping
-rw-r--r--vim/vimrc8
1 files changed, 6 insertions, 2 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 93efe27c..b4f5243a 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -1496,8 +1496,12 @@ sunmap <Leader>&
map <Leader>7 <Leader>&
ounmap <Leader>7
sunmap <Leader>7
-"" Leader,*/8 is sticky-star: search, highlight, but don’t move
-nnoremap <silent> <Leader>* *N
+"" Leader,*/8 is "sticky star":
+"" - Set search string to word under cursor
+"" - Show search highlighting if it's enabled
+"" - Don't move the cursor
+nnoremap <silent> <Leader>*
+ \ :<C-U>let @/ = expand('<cword>')<CR>:let &hlsearch = &hlsearch<CR>
nmap <Leader>8 <Leader>*
"" Leader,` opens a scratch buffer, horizontally split
nnoremap <silent> <Leader>`