Skip to content
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

Browser: add caret browsing to smart select text area #345

Merged
merged 1 commit into from
Jul 22, 2020

Conversation

HollowMan6
Copy link
Contributor

Add caret browsing function for EAF browser. It can be used to smart select text area.

The core/js/caret_browsing.js is derived from qutebrowser's caret.js under GPL-3.0.

Usage

Under my configuration, Press M-c to activate caret browsing, C-q to deactivate. Caret browsing is deactivated by default.

If caret browsing is activated, press C-i to toggle mark. if mark is on, the cursor will be used to select. If mark is off, the cursor will only move around according to commands. Mark is off by default.

Here is a list of keybindings under my configuration for caret browsing, it will work only if caret browsing is activated.

Key Action
z move cursor to next line
Z move cursor to previous line
a move cursor to next character
A move cursor to previous character
w move cursor to next word
W move cursor to previous word
b move cursor to the bottom of the page
B move cursor to the top of the page

If mark is on and caret browsing is activated, Press / to search text forward and select, ? to search text backward and select. C-. to clear current searching text.

Example

Take here https://superuser.com/questions/1236864/how-to-use-vimium-to-select-text-from-a-page for example, if we want to achieve the same result, you can do as follows:

  • Firstly, press M-c to activate caret browsing, then press C-i to set mark on.
  • Secondly, press / to open search and select, enter mailto in the minibuffer and then press enter to confirm.
  • Thirdly, press C-. to clear current searching text, and again press / to open search and select, enter very in the minibuffer and then press enter to confirm.
  • Forthly, press w to select one word at a time or a to gradually select it.
  • Finally, press M-w to yank the text verycomplicatedandlonganduglydomainthatiwontsearachfor.com

Signed-off-by: Hollow Man hollowman186@vip.qq.com

Signed-off-by: Hollow Man <hollowman186@vip.qq.com>
@manateelazycat
Copy link
Member

Wow

@manateelazycat manateelazycat merged commit a5aa3fb into emacs-eaf:master Jul 22, 2020
@MatthewZMD
Copy link
Member

建议做一个minor mode叫做eaf-browser-caret-mode,继续通过M-c开启关闭,开启时覆盖Emacs熟悉的C-nC-pC-fC-b进行光标控制,现在default的keybinding太难受了。

@manateelazycat
Copy link
Member

建议做一个minor mode叫做eaf-browser-caret-mode,继续通过M-c开启关闭,开启时覆盖Emacs熟悉的C-nC-pC-fC-b进行光标控制,现在default的keybinding太难受了。

建议很好

@HollowMan6
Copy link
Contributor Author

建议做一个minor mode叫做eaf-browser-caret-mode,继续通过M-c开启关闭,开启时覆盖Emacs熟悉的C-nC-pC-fC-b进行光标控制,现在default的keybinding太难受了。

建议很好

OK,我后面会做一下

@MatthewZMD
Copy link
Member

我终于修好了webengine的错误,用上了caret browsing,很赞!但是发现有些时候caret选中的文本是灰色的,而不是蓝色的,感觉focus出了点问题,我必须拿鼠标点一下网页,然后重新caret选择才行。

Screen Capture_select-area_20200806111435

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants