CARET mode
ヒントを自力実装して行単位分割しました。
pre,code そして text/plain も いけます。
ただし、ヒントの
文字による絞り込みも無いよりはいいかなって程度の微妙な実装になってます。
(TextNode に対して行なっているので、text/plain だったりすると 絞り込めません)
一切 map 等を振っていないので
js mappings.addUserMap([modes.NORMAL], ["
"], "", function () plugins.hintsCaret.showCaret());
と map を 適当に振る必要があります。
無理して hint に 組込むなら
hints.addMode("c", "", null, function() {commandline.close(); window.setTimeout(function () plugins.hintsCaret.showCaret(), 0); throw 0;});
showCaret を showVisual に 変更で いきなり VISUAL mode に入れます。
Firefox 4 から の 機能として以下を使って実現してます
- nsIDOMWindowUtils#nodesFromRectで 画面全体のNodeを取得
- Range.getClientRectsを使ってTextNode を 行毎の box を取得
- Selection.modifyで行移動や行頭移動
https://github.com/caisui/vimperator/blob/master/plugin/hints-caret.js
http://vimperator.org/vimperator
before
http://vimperator-labs.googlecode.com/hg/vimperator/NEWS
text/plain