neoclide / coc-smartf

Make jump to character easier.
72 stars 6 forks source link

make f and T as an operator multiline and add t and T #4

Open desmap opened 5 years ago

desmap commented 5 years ago

example:

This is a 
text in two lines

imagine the cursor is on the T. With clever-f for example dfo would delete till the two in the second line. Now nothing happens.

and it would be awesome to have also t and T Edit: I meant as 'motion' not operator command

chemzqm commented 5 years ago

It's useful, but I don't have time for it right now, PR welcome.

desmap commented 5 years ago

Yes, tbh I started to like smartf, it's really neat and fast and it's JS! IDK, I don't have time either and I don't have a clue how and where to start. I mean I just put a folder in coc/extensions, call it coc-smartf2, clone/fork your code, make npm install and write some node.js?! And how do I use LSP to talk to nvim, is there a good resource to get into that stuff? Or is all I need { Neovim, ExtensionContext, workspace } from 'coc.nvim' and LSP is not used with smartf?

chemzqm commented 5 years ago

There's no LSP stuff with coc-smartf.

For develop coc extensions, it's recommended to use vim's rtp: https://github.com/neoclide/coc.nvim/wiki/Using-coc-extensions#use-vims-plugin-manager-for-coc-extension

It uses webpack to compile the code, so you need run webpack --watch in extension root when developing.

desmap commented 5 years ago

@chemzqm a quick update on this topic:

Getting in your code would be a nice endeavor but I guess, I am as busy as you are. Moreover, I would need much more time to get into your codebase and you are already familiar with it. I looked briefly at the sources and my first thought was that coc-smartf should actually work out of the box as a motion when you map it with omap or just map. So, I guess there must be some deeper architectural problem, otherwise creating a motion/text object should be straightforward.

However, I saw also that you fixed the easymotion bug in the coc.vim repo (btw, great idea to check for the 'Target' string). I just tried easymotion again and it feels good but tbh I now think that coc-smartf is way better! If it had the motion feature it would be by far the best solution on the market, it has the best usability. The last days, I exchanged the three plugins clever-f, easymotion, quick-scope with coc-smartf only. Just now, I had to reinstall them all again because I need this motion feature, I use it all the time with vim operators. It's crucial.

I think coc-smartf could be also a huge opportunity to bring even more people closer to the coc-ecosystem. Like content marketing, it could even create more interest for coc's universe. Because like everything with coc.vim, coc-smartf is quite thought through.

So if it's an easy fix and if I were you, I would add motion to coc-smartf.

chemzqm commented 5 years ago

You're free to use any vim plugin you want to, coc.nvim tried to work with them instead of replace them.

It's not hard, just not high priority for me.