机器翻译正文由机器翻译自项目原始文档(英文),排版经程序统一处理,可能存在偏差,请以原项目仓库为准。
喜欢 cVim 吗?考虑捐赠!https://www.paypal.me/1995eaton
cVim是什么?
Google Chrome 的 Vim。我讨厌用鼠标,尤其是在学会 Vim 之后。我的桌面(Linux)有很多按键绑定,让操作更简单:我用 Alt+w 打开 Chrome,用 Alt+Shift+d 关闭窗口,用 Alt+t 打开终端。Chrome 更难做到这一点,因为它没有自定义键盘快捷键的部分,而且点击链接等操作仍然需要用鼠标。cVim 旨在尽力消除这个问题,尽力通过 Chrome 扩展 API 实现。
我在哪里可以获得cVim?
- 有两种方式:
- 你可以通过[Chrome网店]安装(https://chrome.google.com/webstore/detail/cvim/ihlenndgcmojhcghmfjfneahoeklbjjh )
- 你可以下载
.zip文件[这里]( https://github.com/1995eaton/chromium-vim/archive/master.zip)并启用cVim,方法是进入`chrome://extensions`网址,选择开发者模式,然后通过`Load unpacked extensions...`按钮将Chrome指向解压文件夹。
为什么这和Vimium、ViChrome或Vrome不同?
这些扩展在为 Google Chrome 添加类似 Vim 的快捷键方面做得非常出色,但它们缺少 Firefox 插件 Pentadactyl 所具备的许多功能。
- cVim 为 Chrome 添加了哪些功能?
- Google/IMDB/维基百科/Amazon/Duckduckgo/Yahoo/Bing搜索完成
- 支持自定义搜索引擎
- 历史和书签搜索/完成,支持书签文件夹
- Caret/可视化模式
- 高效的链接提示(支持自定义映射)
- 支持自定义键盘映射
- 带高亮的正则表达式页面搜索
- 带制表符补全的命令栏
- 平滑滚动
cVim 帮助
cVimrc
- 布尔cVimrc设置在命令
'set' + <SETTING_NAME>启用,命令'set' + no<SETTING_NAME>禁用(例如set regexp和set noregexp) - 布尔cVimrc设置可以通过在末尾加上“!”来反转
- 其他设置则用
=作为分隔符定义,并以let前缀(例如,let hintcharacters="abc")
| 设置 | 类型 | 描述 | 默认 |
|---|---|---|---|
| 搜索限制 | 整数 | 设置命令栏中显示的结果数量 | 25 |
| 滚动步 | 整数 | 使用 scrollUp 和 scrollDown 命令时设置滚动的像素数 | 70 |
| 时间外定 | 整数 | 等待 <Leader> 映射的时间(毫秒) |
1000 |
| FullPageScroll% | 整数 | 使用 scrollFullPageUp 和 scrollFullPageDown 命令时,设置页面被滚动的百分比 | 0 |
| TypeLink提示延迟 | 整数 | 在启用TypeLinkHints和NumeriChints后,打开链接提示后等待输入所需的时间(以毫秒计) | 300 |
| 滚动时长 | 整数 | 平滑滚动时长 | 500 |
| vimport | 整数 | 将端口设置为与 editWithVim 插入模式命令一起使用 |
8001 |
| 放大因子 | 整数 / 双倍 | 放大页面时的步长 | 0.1 |
| 比例提示 | 布尔 | 动态链接提示出现 | 错误 |
| hud | 布尔值 | 显示抬头显示器 | true |
| 正则表达式 | 布尔值 | 在查找模式中使用正则表达式 | 真 |
| ignorecase | 布尔值 | 在查找模式中忽略搜索大小写 | true |
| linkanimations | 布尔值 | 当链接提示打开和关闭时显示淡入淡出效果 | false |
| numerichints | 布尔值 | 使用数字作为链接提示而不是一组字符 | false |
| dimhintcharacters | 布尔值 | 在提示字符中淡化字母匹配,而不是将其从提示中移除 | true |
| defaultnewtabpage | 布尔值 | 使用默认的 chrome://newtab 页面而不是空白页 | false |
| cncpcompletion | 布尔值 | 使用 <C-n> 和 <C-p> 在完成结果中循环(需要你在 chrome://extensions 页面设置 nextCompletionResult 快捷键(右下角)) |
false |
| smartcase | 布尔值 | 区分大小写的搜索模式,除非输入包含大写字母 | true |
| incsearch | 布尔值 | 当输入长度超过两个字符时,开始自动高亮查找模式匹配 | true |
| typelinkhints | 布尔值 | (需要 numerichints)在链接中输入文本以缩小数字提示范围 | false |
| autohidecursor | 布尔值 | 滚动时隐藏鼠标光标(对 Linux 有用,因为它在按键时不会自动隐藏光标) | false |
| 自动聚焦 | 布尔值 | 允许网站在首次加载时自动聚焦输入框 | true |
| insertmappings | 布尔值 | 使用插入映射在文本框中移动光标(见下方绑定) | true |
| smoothscroll | 布尔值 | 使用平滑滚动 | false |
| autoupdategist | 布尔值 | 如果使用 GitHub Gist 来同步设置,则每小时拉取更新(以及在 Chrome 重启时) | false |
| nativelinkorder | 布尔值 | 像 Chrome 一样在新标签页中打开,而不是在当前打开的标签旁边打开 | false |
| showtabindices | 布尔值 | 在标签标题中显示标签索引 | false |
| sortlinkhints | 布尔值 | 根据链接距离页面左上角的距离对链接提示字母进行排序 | false |
| localconfig | 布尔值 | 从 configpath 读取 cVimrc 配置(当设置此项时,无法从 cVim 的选项页面保存) |
false |
| completeonopen | 布尔值 | 当命令栏打开时自动显示命令完成列表 | 假 |
| configpath | 字符串 | 当设置了 configpath 时,从此本地文件读取 cVimrc | "" |
| 更新日志 | 布尔值 | 当 cVim 更新时自动打开更新日志 | true |
| completionengines | 字符串数组 | 仅使用指定的搜索引擎 | ["google", "duckduckgo", "wikipedia", "amazon"] |
| 黑名单 | 字符串数组 | 在匹配任一模式的网站上禁用 cVim | [] |
| 地图引导 | 字符串 | 默认<Leader>键 |
\ |
| defaultengine | 字符串 | 设置默认搜索引擎 | "google" |
| locale | string | set the locale of the site being completed/searched on (see example configuration below) | "" |
| homedirectory | 字符串 | 使用 file 命令时,用于替换 ~ 的目录 |
"" |
| qmark <字母数字字符> | 字符串 | 添加一个持久的快速标记(例如 let qmark a = ["http://google.com", "http://reddit.com"]) |
无 |
| previousmatchpattern | 字符串(正则表达式) | 在使用页面后退按钮导航时寻找的模式 | ((?!last)(prev(ious)?|newer|back|«|less|<|‹| ) ) |
| nextmatchpattern | 字符串 (正则表达式) | 导航页面“下一页”按钮时搜索的模式 | ((?!first)(next|older|more|>|›|»|forward| ) ) |
| hintcharacters | 字符串(字母数字) | 设置链接提示模式中默认使用的字符 | "asdfgqwertzxcvb" |
| barposition | 字符串 ["top", "bottom"] | 设置命令栏的默认位置 | "top" |
| langmap | 字符串 | 设置要重新映射的字符列表(参见 vim 的 langmap) | "" |
示例配置
" Settings
set nohud
set nosmoothscroll
set noautofocus " The opposite of autofocus; this setting stops
" sites from focusing on an input box when they load
set typelinkhints
let searchlimit = 30
let scrollstep = 70
let barposition = "bottom"
let locale = "uk" " Current choices are 'jp' and 'uk'. This allows cVim to use sites like google.co.uk
" or google.co.jp to search rather than google.com. Support is currently limited.
" Let me know if you need a different locale for one of the completion/search engines
let hintcharacters = "abc123"
let searchengine dogpile = "http://www.dogpile.com/search/web?q=%s" " If you leave out the '%s' at the end of the URL,
" your query will be appended to the link.
" Otherwise, your query will replace the '%s'.
" This will do the same thing as above, except typing ':tabnew withbase' into to command bar
" without any search parameters will open 'http://www.dogpile.com'
let searchengine withbase = ["http://www.dogpile.com", "http://www.dogpile.com/search/web?q=%s"]
" alias ':g' to ':tabnew google'
command g tabnew google
let completionengines = ["google", "amazon", "imdb", "dogpile"]
let searchalias g = "google" " Create a shortcut for search engines.
" For example, typing ':tabnew g example'
" would act the same way as ':tabnew google example'
" Open all of these in a tab with `gna` or open one of these with <N>goa where <N>
let qmark a = ["http://www.reddit.com", "http://www.google.com", "http://twitter.com"]
let blacklists = ["https://mail.google.com/*", "*://mail.google.com/*", "@https://mail.google.com/mail/*"]
" blacklists prefixed by '@' act as a whitelist
let mapleader = ","
" Mappings
map <Leader>r reloadTabUncached
map <Leader>x :restore<Space>
" This remaps the default 'j' mapping
map j scrollUp
" You can use <Space>, which is interpreted as a
" literal " " character, to enter buffer completion mode
map gb :buffer<Space>
" This unmaps the default 'k' mapping
unmap k
" This unmaps the default 'h', 'j', 'k', and 'l' mappings
unmap h j k l
" This remaps the default 'f' mapping to the current 'F' mapping
map f F
" Toggle the current HUD display value
map <C-h> :set hud!<CR>
" Switch between alphabetical hint characters and numeric hints
map <C-i> :set numerichints!<CR>
map <C-u> rootFrame
map <M-h> previousTab
map <C-d> scrollPageDown
map <C-e> scrollPageUp
iunmap <C-y>
imap <C-m> deleteWord
" Create a variable that can be used/referenced in the command bar
let @@reddit_prog = 'http://www.reddit.com/r/programming'
let @@top_all = 'top?sort=top&t=all'
let @@top_day = 'top?sort=top&t=day'
" TA binding opens 'http://www.reddit.com/r/programming/top?sort=top&t=all' in a new tab
map TA :tabnew @@reddit_prog/@@top_all<CR>
map TD :tabnew @@reddit_prog/@@top_day<CR>
" Use paste buffer in mappings
map T :tabnew wikipedia @"<CR>
" Code blocks (see below for more info)
getIP() -> {{
httpRequest({url: 'http://api.ipify.org/?format=json', json: true},
function(res) { Status.setMessage('IP: ' + res.ip); });
}}
" Displays your public IP address in the status bar
map ci :call getIP<CR>
" Script hints
echo(link) -> {{
alert(link.href);
}}
map <C-f> createScriptHint(echo)
let configpath = '/path/to/your/.cvimrc'
set localconfig " Update settings via a local file (and the `:source` command) rather
" than the default options page in chrome
" As long as localconfig is set in the .cvimrc file. cVim will continue to read
" settings from there
黑名单
- 黑名单设置使用了 Chrome @match 模式指南的自定义实现。有关语法描述,请参见 https://developer.chrome.com/extensions/match_patterns。
站点特定配置
- 您可以为使用上述描述的黑名单匹配模式的网站启用某些 rc 设置
" this will enable the config block below on the domain 'reddit.com' site '*://*.reddit.com/*' { unmap j unmap k set numerichints }
页面加载时运行命令
- 与上面描述的特定网站配置类似,cVim 可以在页面加载时使用
call关键字运行命令" In this case, when pages with a file ending in '.js' are loaded, " cVim will pin the tab and then scroll down site '*://*/*.js' { call :pintab call scrollDown }
映射
- 普通映射使用以下结构定义:
map <KEY> <MAPPING_NAME> - 插入映射使用相同的结构,但使用命令 "imap" 而不是 "map"
- Control、Meta 和 Alt 也可以使用:
<C-u> " Ctrl + u <M-u> " Meta + u <A-u> " Alt + u - 也可以使用
unmap <KEY>取消默认绑定,并使用iunmap <KEY>插入绑定 - 要取消映射所有默认键绑定,请使用
unmapAll。要取消映射所有默认插入绑定,请使用iunmapAll
标签
- 打开链接的命令(
:tabnew和:open)有三种不同的属性!=> 在新标签页中打开$=> 在新窗口中打开|=> 在隐身窗口中打开&=> 在新标签页中打开(未激活/未聚焦)*=> 固定标签?=> 将查询视为搜索==> 将查询视为 URL
- 这些属性的使用通过示例来解释最好:
:open! google<CR> " This is the same as :tabnew google<CR>
:open google!<CR> " This is another way of writing the above
" (these flags can can be added to either
" the base command or the end of the final command)
:open& google<CR> " This will open Google in a new inactive tab
:open$ google<CR> " This will open Google in a new window
:open&* google<CR> " The will open Google in a new inactive, pinned tab
:tabnew google&*<CR> " Once again, this will do the same thing as the above command
:open google&*<CR> " Again, same as above
:open google!& " Here, the & flag will cancel out the ! flag,
" opening Google in a new inactive tab
" More examples
:bookmarks my_bookmark.com& " inactive,new tab
:bookmarks&* my_bookmark.com " inactive,pinned,new tab
:bookmarks! my_bookmark.com " new tab
:bookmarks$ my_bookmark.com " new window
:bookmarks my_bookmark.com " same tab
代码块
- 代码块允许你通过 cVimrc 与 cVim 的内容脚本进行交互。
- 由于代码块使用
eval(...),你只有在清楚自己在做什么时才应该使用它们。
" To be used by the code block
set hintset_a
" Create a code block named switchHintCharacters
switchHintCharacters -> {{
// We are now in JavaScript mode
// Settings are contained in an object named settings
settings.hintset_a = !settings.hintset_a;
if (settings.hintset_a) {
settings.hintcharacters = 'abc'; // equivalent to "let hintcharacters = 'abc'"
} else {
settings.hintcharacters = 'xyz';
}
// Propagate the current settings to all tabs for the
// rest of the session
PORT('syncSettings', { settings: settings });
// Display cVim's status bar for 2 seconds.
Status.setMessage('Hint Set: ' + (true ? 'a' : 'b'), 2);
}}
" Run the JavaScript block
map <Tab> :call switchHintCharacters<CR>
补全引擎
- 这些是可以在命令栏中使用的补全引擎列表。可以通过将它们的名称分配给
completionengines变量的数组来设置它们。- 谷歌,维基百科,优酷,IMDb,亚马逊,谷歌地图,沃尔夫勒姆阿尔法,谷歌图片,易趣,韦氏词典,维基词典,城市词典,鸭鸭搜索,答案,谷歌趋势,谷歌财经,雅虎,必应,电影数据库
- 示例用法:
let completionengines = ['google', 'google-image', 'youtube'] " Show only these engines in the command bar
按键绑定
| 动作 | 映射名称 | |
|---|---|---|
j, s |
向下滚动 | scrollDown |
k, w |
向上滚动 | scrollUp |
h |
向左滚动 | scrollLeft |
l |
向右滚动 | scrollRight |
d |
向下滚动半页 | scrollPageDown |
| 未映射 | 向下滚动整页 | scrollFullPageDown |
u、e |
向上滚动半页 | scrollPageUp |
| 未映射 | 向上滚动整页 | scrollFullPageUp |
gg |
滚动到页面顶部 | scrollToTop |
G |
滚动到页面底部 | scrollToBottom |
0 |
滚动到页面的左侧 | scrollToLeft |
$ |
滚动到页面右侧 | scrollToRight |
# |
将滚动焦点重置到主页面 | resetScrollFocus |
gi |
转到第一个输入框 | goToInput |
gI |
跳转到上次通过 gi 聚焦的输入框 |
goToLastInput |
zz |
将页面居中到当前搜索匹配项(中间) | centerMatchH |
zt |
将页面居中至当前搜索匹配项(顶部) | centerMatchT |
zb |
将页面居中至当前搜索匹配项(底部) | centerMatchB |
| 链接提示 | ||
f |
在当前标签页打开链接 | createHint |
F |
在新标签页中打开链接 | createTabbedHint |
| 未映射 | 在新标签页中打开链接(活动) | 创建活动标签提示 |
W |
在新窗口中打开链接 | createHintWindow |
A |
重复上一个提示命令 | openLastHint |
q |
触发悬停事件(鼠标悬停 mouseenter) | createHoverHint |
Q |
触发取消悬停事件(mouseout mouseleave) | createUnhoverHint |
mf |
打开多个链接 | createMultiHint |
| 未映射 | 使用外部编辑器编辑文本 | createEditHint |
| 未映射 | 使用链接作为第一个参数调用代码块 | createScriptHint(<FUNCTION_NAME>) |
| 未映射 | 在新标签页中打开图像 | fullImageHint |
mr |
反向图片搜索多个链接 | multiReverseImage |
my |
拷贝多个链接(使用 P 打开链接列表) | multiYankUrl |
gy |
将链接的 URL 复制到剪贴板 | yankUrl |
gr |
反向图像搜索(谷歌图片) | reverseImage |
; |
更改链接提示焦点 | |
| 快捷标记 | ||
M<*> |
创建快速标记 <*> | addQuickMark |
go<*> |
在当前标签页打开 quickmark <*> | openQuickMark |
gn<*> |
在新标签页中打开快速标记 <*> | openQuickMarkTabbed |
gw<*> |
在新窗口中打开快速标记 <*> | openQuickMarkWindowed |
| 杂项 | ||
a |
别名为 ":tabnew google " | :tabnew google |
. |
重复上一个命令 | repeatCommand |
: |
打开命令栏 | openCommandBar |
/ |
打开搜索栏 | openSearchBar |
? |
打开搜索栏(反向搜索) | openSearchBarReverse |
| 未映射 | 打开链接搜索栏(与按 /? 相同) |
openLinkSearchBar |
I |
浏览器历史记录搜索 | :history |
<N>g% |
页面向下滚动 <N> 百分比 | percentScroll |
<N>未映射 |
将 <N> 键传递到当前页面 |
passKeys |
i |
进入插入模式(按 Esc 键退出) | insertMode |
r |
重新加载当前标签页 | reloadTab |
gR |
重新加载当前标签页本地缓存 | reloadTabUncached |
;<*> |
创建标记 <*> | setMark |
'' |
转到最后滚动位置 | lastScrollPosition |
<C-o> |
跳转到上一个滚动位置 | previousScrollPosition |
<C-i> |
跳转到下一个滚动位置 | nextScrollPosition |
'<*> |
跳转到标记 <*> | goToMark |
cm |
静音/取消静音标签页 | muteTab |
| 无 | 重新加载所有标签页 | reloadAllTabs |
cr |
重新加载除当前之外的所有标签页 | reloadAllButCurrent |
zi |
放大页面 | zoomPageIn |
zo |
缩小页面 | 缩小页面 |
z0 |
将页面缩放到原始大小 | zoomOrig |
z<Enter> |
切换图片缩放(与在仅图片页面点击图片相同) | toggleImageZoom |
gd |
别名到 :chrome://downloads<CR> | :chrome://downloads<CR> |
ge |
别名到 :chrome://extensions<CR> | :chrome://extensions<CR> |
yy |
将当前页面的 URL 复制到剪贴板 | yankDocumentUrl |
yY |
将当前帧的 URL 复制到剪贴板 | yankRootUrl |
ya |
复制当前窗口中的 URL | yankWindowUrls |
yh |
从查找模式中复制当前匹配的文本(如果有的话) | yankHighlight |
b |
在书签中搜索 | :bookmarks |
p |
打开剪贴板选择 | openPaste |
P |
在新标签中打开剪贴板选择 | openPasteTab |
gj |
隐藏下载栏 | hideDownloadsShelf |
gf |
在 iframes 中循环 | nextFrame |
gF |
跳转到根帧 | rootFrame |
gq |
停止当前标签页加载 | cancelWebRequest |
gQ |
停止所有标签页加载 | cancelAllWebRequests |
gu |
在 URL 中向上移动一层路径 | goUpUrl |
gU |
转到根 URL | goToRootUrl |
gs |
转到当前网址的 view-source:// 页面 | :viewsource! |
<C-b> |
为当前 URL 创建或切换书签 | createBookmark |
| 未映射 | 关闭所有浏览器窗口 | 退出Chrome |
g- |
URL路径中的第一个数字减一(例如 www.example.com/5 => www.example.com/4) |
decrementURLPath |
g+ |
增加 URL 路径中的第一个数字 | incrementURLPath |
| 标签导航 | ||
gt, K, R |
跳转到下一个标签页 | nextTab |
gT, J, E |
导航到上一个标签页 | previousTab |
g0, g$ |
转到第一个/最后一个标签页 | firstTab, lastTab |
<C-S-h>, gh |
在新标签页中打开当前标签页历史记录中的最后一个URL | openLastLinkInTab |
<C-S-l>, gl |
在新标签页中打开当前标签页历史记录中的下一个URL | openNextLinkInTab |
x |
关闭当前标签页 | closeTab |
gxT |
关闭当前标签左侧的标签 | closeTabLeft |
gxt |
关闭当前标签右侧的标签 | closeTabRight |
gx0 |
关闭当前标签左侧的所有标签 | closeTabsToLeft |
gx$ |
关闭当前标签右侧的所有标签 | closeTabsToRight |
X |
打开最后关闭的标签页 | lastClosedTab |
t |
:tabnew | :tabnew |
T |
:tabnew <当前网址> | :tabnew @% |
O |
:打开 <当前网址> | :打开 @% |
<N>% |
切换到标签 <N> | goToTab |
H, S |
返回 | goBack |
L, D |
前进 | goForward |
B |
搜索另一个活动标签页 | :buffer |
< |
将当前标签页向左移动 | moveTabLeft |
> |
将当前标签页向右移动 | moveTabRight |
]] |
点击页面上的“下一步”链接(见上面的 nextmatchpattern) | nextMatchPattern |
[[ |
点击页面上的“返回”链接(见上面的 previousmatchpattern) | previousMatchPattern |
gp |
固定/取消固定当前标签页 | pinTab |
<C-6> |
在最近使用的标签之间切换焦点 | lastUsedTab |
| 查找模式 | ||
n |
下一个搜索结果 | nextSearchResult |
N |
上一次搜索结果 | previousSearchResult |
v |
进入可视/光标模式(高亮当前搜索/选区) | toggleVisualMode |
V |
从光标模式/当前高亮搜索进入可视行模式 | toggleVisualLineMode |
| 未映射 | 清除搜索模式高亮 | clearSearchHighlight |
| 视觉/插入模式 | ||
<Esc> |
从可视模式退出到插入点模式/从插入点模式退出到普通模式 | |
v |
在可视模式和插入点模式之间切换 | |
h、j、k、l |
移动插入点位置/扩展视觉选区 | |
y |
复制当前选中的内容 | |
n |
选择下一个搜索结果 | |
N |
选择上一个搜索结果 | |
p |
在当前标签页中打开高亮文本 | |
P |
在新标签页中打开高亮文本 | |
| 文本框 | ||
<C-i> |
将光标移动到行首 | beginningOfLine |
<C-e> |
将光标移动到行尾 | endOfLine |
<C-u> |
删除到行首 | deleteToBeginning |
<C-o> |
删除到行尾 | deleteToEnd |
<C-y> |
删除前一个单词 | 删除单词 |
<C-p> |
向前删除一个单词 | deleteForwardWord |
| 未映射 | 删除前一个字符 | deleteChar |
| 未映射 | 向前删除一个字符 | deleteForwardChar |
<C-h> |
将光标向后移动一个词 | backwardWord |
<C-l> |
光标向前移动一个单词 | forwardWord |
<C-f> |
光标向前移动一个字母 | forwardChar |
<C-b> |
将光标向后移动一个字母 | backwardChar |
<C-j> |
光标向下移动一行 | forwardLine |
<C-k> |
将光标上移一行 | backwardLine |
| 未映射 | 选择输入文本(相当于 <C-a>) |
全选 |
| 未映射 | 在终端中使用 Vim 编辑(需要运行 cvim_server.py 脚本才能工作,并且需要在该脚本中设置 VIM_COMMAND) | 使用 Vim 编辑 |
命令模式
| 命令 | 描述 |
|---|---|
| :tabnew(自动完成) | 使用已输入/自动完成的搜索打开一个新标签页 |
| :new(自动完成) | 使用输入/完成的搜索打开一个新窗口 |
| :open(自动完成) | 打开已输入/已完成的 URL/谷歌搜索 |
| :history(自动完成) | 浏览器历史记录搜索 |
| :书签 (自动完成) | 搜索书签 |
| :bookmarks /<folder>(自动补全) | 按文件夹浏览书签/打开文件夹中的所有书签 |
| :set (自动完成) | 临时更改 cVim 设置 |
| :chrome://(自动完成) | 打开一个 chrome:// URL |
| :tabhistory(自动完成) | 浏览当前标签页的不同历史状态 |
:command <NAME> <ACTION> |
别名 :<NAME> 指向 :<ACTION> |
| :quit | 关闭当前标签页 |
| :qall | 关闭当前窗口 |
| :restore(自动完成) | 恢复之前关闭的标签页(仅适用于较新版本的 Chrome) |
| :tabattach(自动完成) | 将当前标签页移动到另一个已打开的窗口 |
| :tabdetach | 将当前标签页移动到新窗口 |
| :file(自动完成) | 打开本地文件 |
| :source(自动完成) | 将 cVimrc 文件加载到内存中(如果之前设置过 localconfig,这将覆盖选项页面中的设置) |
| :duplicate | 复制当前标签页 |
| :settings | 打开设置页面 |
| :nohlsearch | 清除上次搜索中高亮显示的文本 |
| :execute | 执行一系列按键(对映射很有用。例如,"map j :execute 2j |
| :buffer (自动完成) | 切换到不同的标签页 |
| :mksession | 从活动窗口的当前标签创建一个新会话 |
| :delsession(自动完成) | 删除已保存的会话 |
| :session (自动完成) | 在新窗口中打开已保存会话的标签页 |
| :script | 在当前页面运行 JavaScript |
| :togglepin | 切换当前标签页的固定状态 |
| :pintab | 固定当前标签页 |
| :unpintab | 取消固定当前标签页 |
小贴士
- 你可以在“open”命令中使用
@%来指定当前 URL。例如,:open @%实际上会刷新当前页面。 - 在命令前加一个数字以将该命令重复 N 次
- 在命令/查找模式下使用上/下箭头浏览之前执行的命令/搜索 — 你也可以使用它来搜索以特定字母组合开头的先前执行的命令(例如,在命令栏中输入
ta并按上箭头,将在命令历史中搜索所有以ta开头的匹配项)
贡献
很高兴你想花一些时间来改进这个扩展。解决问题总是受到欢迎的。如果你打算添加一个功能,最好提交一个问题。你会得到反馈,是否有可能被合并。
- 在仓库的根文件夹中运行
npm install - 运行
make - 导航到
chrome://extensions - 切换到开发者模式
- 点击“加载已解压的扩展程序...”
- 选择 cVim 目录。
本站来源与版权声明
- 本文标题:chromium-vim - 适用于 Google Chrome 的 Vim 绑定
- 本文链接:https://www.cn121.com/browser/1995eaton-chromium-vim.html
- 原项目:1995eaton/chromium-vim 版权归原作者 1995eaton 及贡献者所有
- 收录信息:本站于 2026-11-06 收录本项目,本页所列协议与仓库指标均为收录当时的状态;该日期之后原项目的版本更新与协议变更,本页不作同步。
- 开源协议:收录时本项目采用 MIT(查看 LICENSE 原文),本站译文为其衍生内容;使用、修改、分发请以该仓库 LICENSE 原文为准。
- 站点出处:本文首发于 OneTwoOne,收录自 GitHub 开源项目 1995eaton/chromium-vim。
- 翻译说明:本页正文为人工智能生成内容——由机器翻译对原项目 README 初译、经程序校验排版,可能存在错漏,请以原项目文档为准。
- 引用声明:商业转载、第三方聚合或 AI 检索训练引用时,请务必保留以上来源出处、本文永久链接,以及原项目的版权声明与许可信息。
- 下架通道:若原项目此后变更或收紧了许可协议、或作者/权利人认为本站的收录方式(译文、排版适配、简介翻译等)超出其授权范围,请通过 xyd3302001@163.com 发送下架通知,并附上项目地址与本页链接。本站核实后将第一时间删除本页内容,或改为不复制原文的目录性收录;署名更正等其他要求可一并提出。