-
Notifications
You must be signed in to change notification settings - Fork 34
Repeated star movement should move to the next word #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Repeated star movement should move to the next word #9
Conversation
|
Thanks, I like the idea.
|
|
0426d8d to
b322817
Compare
Makes sense, though I always use Here's a simpler patch. diff --git a/plugin/slash.vim b/plugin/slash.vim
index 6b99444..2949564 100644
--- a/plugin/slash.vim
+++ b/plugin/slash.vim
@@ -30,14 +30,19 @@ function! s:wrap(seq)
endfunction
function! s:immobile(seq)
+ let class = len(a:seq[:2])
+ if get(b:, 'slash_prev_immobile') == class
+ return a:seq
+ endif
let s:winline = winline()
+ let b:slash_prev_immobile = class
return a:seq."\<plug>(slash-prev)"
endfunction
function! s:trailer()
augroup slash
autocmd!
- autocmd CursorMoved,CursorMovedI * set nohlsearch | autocmd! slash
+ autocmd CursorMoved,CursorMovedI * set nohlsearch | unlet! b:slash_prev_immobile | autocmd! slash
augroup END
let seq = foldclosed('.') != -1 ? 'zo' : '' |
|
@junegunn I believe your implementation and my implementation do different things, at least when I tried to test the behavior in my machine. My intention was to simulate the
This is achieved by:
The goal with this is to make it possible for users go star search using the |
|
Oh, I see, thanks for clarification. I don't think I'm going to need it though, because I always use n and N to move between the matches and I've never tried or wanted to use * and # instead, so I don't want extra code. I suggest that you use your fork if it suits your needs. Thanks. |
|
@junegunn Just to let you know, in my fork of vim-slash (which I named vim-slasher), I've included some extra features, such as enhanced In case you're interested in taking a look: https://github.com/thalesmello/vim-slasher |
|
Cool, thanks for sharing. |
This pull request:
Even though this changes a core intent of the plugin, which is to change how the star key works, it provides a sane default for people used to the old star behavior.
Let me know what you think.