eyeliner.nvim icon indicating copy to clipboard operation
eyeliner.nvim copied to clipboard

feature: highlight_on_key = true breaks clever-f.vim

Open squishram opened this issue 3 years ago • 6 comments

Hi there! Love eyeliner, it's really useful, and fantastic job adding the 'highlight_on_key' feature, it takes some of the visual load off of staring at code all day - so thanks for your work.

I also use clever-f.vim, which allows f, t to replace ; repeat and F, T to replace , repeat, and allows letter searches to traverse multiple lines. This is essential for me as I can then remap ; and , to other uses. Unfortunately, clever-f is broken by {highlight_on_key = true}.

This is kind of a (potentially difficult) feature request - are there any plans for eyeliner.nvim to add the possibility of clever-f functionality? It seems like it'd be a fantastic & complementary accompanying module. Cheers!

squishram avatar Aug 01 '22 17:08 squishram

Hey @squishram , thanks for the issue! clever-f.vim is most likely broken since I forgot to check for previous mappings of f,F,t,T, which means that I am currently overriding any mappings you had. I'll make a fix ASAP :)

jinh0 avatar Aug 02 '22 04:08 jinh0

Hey @squishram sorry for taking so long! The issue seems a lot more complicated than I thought... turns out other plugins have the same issue, since all these plugins override the same f/F/t/T keys. like quick-scope.vim, (see https://github.com/unblevable/quick-scope/issues/55). From what I understand, nobody has a solution to get clever-f.vim work with plugins like eyeliner.nvim or quick-scope.vim.

are there any plans for eyeliner.nvim to add the possibility of clever-f functionality

If you are talking about pressing f/F/t/T as a replacement for repeats with ;, I am interested in adding that as a feature to eyeliner.nvim, thanks for the idea!

If you're talking about how clever-f allows you to press f for lines beyond the current line, I've never had a use case for such a feature. Can you tell me a use case for pressing f for characters beyond the current one? That always seemed inefficient to me since for movement beyond the current line, movement plugins like lightspeed.nvim are more convenient / reliable.

jinh0 avatar Aug 06 '22 21:08 jinh0

No worries at all! I really appreciate you looking into it. I found clever-f.vim because I migrated from lightspeed.nvim (which includes clever-f.vim-like functionality) over to leap.nvim (which doesn't) and couldn't bear to go back to using ;/,-repeat.

If you are talking about pressing f/F/t/T as a replacement for repeats with ;, I am interested in adding that as a feature to eyeliner.nvim, thanks for the idea!

This is what I was talking about - I think it's an awesome feature, as adding 2 new keys (;,) to your roster, without having to map new things to <leader>, is such a big offering. Though again, I recognize that adding such a feature would be a pretty massive undertaking. I really appreciate you considering that - I would offer to help myself, but while I have a basic understanding of Lua, I'm far from fluent and have never written a neovim plugin before, so I'm not sure how useful I'd be.

If you're talking about how clever-f allows you to press f for lines beyond the current line, I've never had a use case for such a feature.

You're absolutely right, there are no real use-cases for such a feature at all. clever-f.vim and lightspeed.nvim both have it as a default functionality, so I assume the philosophy there is simply 'why not?' - but as you say, it's not an important feature.

Thanks again for your great work! :)

squishram avatar Aug 08 '22 10:08 squishram

Possibly related is that I found that this plugin broke abbreviations and macros using f. Example: https://github.com/samhh/dotfiles/blob/657b128801a631779906fc289434100a40012604/headful/cfg/nvim/ftplugin/typescript.vim#L8

samhh avatar Sep 09 '22 10:09 samhh

Hey @samhh , are you talking about if you have highlights only turned on on pressing f? Or do you mean the default mode?

I'm not sure if this will help, but I was thinking I could give the option for users to map "f" with <Plug> commands to interact with eyeliner.nvim . Maybe that'll give more flexibility with working with macros and the like.

So you could just remap f/F/t/T at your liking,

nnoremap f <Plug>Eyeliner_f

with whatever customizations you would want.

(Also, I've been busy in my personal life, but I am hoping to be more active developing this plugin in the future.)

jinh0 avatar Sep 18 '22 02:09 jinh0

If you are talking about pressing f/F/t/T as a replacement for repeats with ;, I am interested in adding that as a feature to eyeliner.nvim, thanks for the idea!

I came here exactly for this request. I don't mind moving multiple lines so much, but being able to repeat with more f is really useful and also frees up ,; for other keymappings

chrisgrieser avatar Jun 23 '23 13:06 chrisgrieser