Open abbood opened 6 years ago
You can try visual mode: https://github.com/philc/vimium/wiki/Visual-Mode.
Tip: start by searching (/
) for the start of the text you want to select. Tip 2: search also works in visual mode itself.
@smblott-github this is awesome.. there is a small problem though that is preventing me from being able to use this feature. Maybe you can show me how to make it work. First let me explain the use case:
f
, which gives me a letter for each link, i'm interested in contact info:
the problem is that clicking on Esc
dismisses that dialogue.. following the instructions in the visual-mode, I need to do the following
v
/
to search for the emailw
or something like thatEsc
to exit visual mode <---- this is my problem, b/c escape dismisses the dialoguey
to yank the texthow do i go around this?
Sounds like we might be leaking an <Escape>
to the page.
I'll look into it.
ok great, please keep me posted (I'm curious as to how I can update my vimium to reflect your changes for example)
Wait, why did you need to exit visual mode before yank? Text yanking works within visual mode.
Edit: I see, the way the wiki lists the commands must had you misunderstood.
Exiting visual mode:
Esc
- just exit visual modey
- yank the selected text to the clipboardp
/P
- send the selected text to the default search engine
It simply is listing commands that will result in exiting visual mode, not instructing a set of steps to follow.
Perhaps the Exiting visual mode: line should be removed, it is not really something totally unexpected to be pointed out.
I think it would be much better if we can use the acejump/avy (emacs) or easymotion (vim) way of selecting text. Which mean to move the cursor, you can type a character first and the hint will appear at the locations of said character and we get the cursor at exactly where we look at, much like when using a mouse. I do not know if it is possible to implement with Webextension though.
Find mode pretty much does that, doesn't it? (/
still works while visual mode is operating)
E.g. if I want to copy the Webextension in your comment, I do the following:
v
to activate visual mode or caret mode./
to evoke find mode and type web
, hit Enter.@innaterebel not really, if there are many words have the same prefix, it might scroll the page somewhere else, this is because unlike in VIM the cursor is not always on the visible part of the page. Thus a quite few "n" might be needed. The page scrolling also make the experience not consistent, and I found myself many times resorted to mouse more because of this. With something similar to acejump I can almost just look and the cursor move there.
Another solution is to allow moving the cursor to the beginning of the line/paragraph with hints when starting visual mode (surfingkeys does exact this). This guarantee the search will land on the correct words faster and the most important part is that the page will not scroll, resulted in a stable experience.
The second solution might be more desirable for more people. I've seen many coders adopted a similar flow in different text editors, which is move to the line - search for the word.
I find that what @innaterebel suggests usually works well in practice. It's usually possible to come up with a search that picks exactly what you want. Also, Vimium uses smartcase for search, so throwing in a suitable capital letter can help.
(Another tip: in visual mode, use o
to select and move the other end of the selection.)
there seems to be a bug when copying text in visual mode. For instance, try to copy the 3rd paragraph on snippins comment of Aug 11: "The second..". when I press 'y' (and then paste it somewhere) it only gets yanked the first letter: 'T'..
Its weird since at the bottom it says: 181 characters yanked..
I believe the first letter gets copied in the primary clipboard.. and the entire content in the C-c clipboard..
The second solution might be more desirable for more people. I've seen many coders adopted a similar flow in different text editors, which is move to the line - search for the word.
Perhaps others are experiencing something different, but for me, the quoted text above was selected with visual mode. I tried pasting both with <c-v>
, and with <s-INSERT>
. No difference.
I believe the first letter gets copied in the primary clipboard.. and the entire content in the C-c clipboard..
Does anybody understand how that could happen? Code is here.
In my case, it is selected also, the thing is that is not yanked correctly..
I think Tridactyl
's interface to copy (yank) out text elements (e.g. paragraphs) is superb. It is simply hint mode for the elements, that looks like this:
I imagine something like that isn't hard to create, as it is essentially the hint mode but instead of for links, it is for text elements (layered in div
's etc.)
- type
v
- type
/
to search for the email- select the email using
w
or something like that- hit
Esc
to exit visual mode <---- this is my problem, b/c escape dismisses the dialogue- hit
y
to yank the text
after typing '/' & typing in the email to search, hit 'Enter' then hit 'y' to copy the selected text.
This is so complicated. The small things like these, preventing me to completely shift to keeb. I must have to use mouse to be on browser. There's no good way, even though I appreciate you guys developing great tools like vimium.
Vimium now supports map xxx LinkHints.activateMode action=copy-text
to copt text of links.
Hello, my customized version of Vimium, named Vimium C (https://github.com/gdh1995/vimium-c), has added LinkHints.activateModeToSelect
to select any text slice and enter VisualMode, which might be more convenient. It has also LinkHints.activateCopyLinkText
to select link and copy text directly.
I was wondering if there is a way to select text from a page without using a mouse? for example if there is an email email@domain.com, i would like to simply copy the text of that email