Skip to content

Instantly share code, notes, and snippets.

@zhlinh
Last active May 30, 2023 19:34
Show Gist options
  • Save zhlinh/d82bdb0be5990a43ae24 to your computer and use it in GitHub Desktop.
Save zhlinh/d82bdb0be5990a43ae24 to your computer and use it in GitHub Desktop.
Chrome_Extension - cVim.conf
" Updated: 2022-06-25
" Author: zhlinh
" Gist: https://gist.github.com/zhlinh/d82bdb0be5990a43ae24
" ----------------------------------------- Base Settings -------------------------------------------
let mapleader=','
set nosmoothscroll
" autofocus: allows websites to automatically focus an input box when they are first loaded
set noautofocus
" typelinkhints: (numerichints required) type text in the link to narrow down numeric hints
set typelinkhints
"case-insensitive find mode searches except when input contains a capital letter
set smartcase
set incsearch
"use regexp in find mode
set regexp
let barposition = "top"
let previousmatchpattern="((?!last)(上一页|上一頁|上页|上頁|前页|前頁|上一篇|prev(ious)?|newer|back|«|less|<|‹| )+)"
let nextmatchpattern = "((?!first)(下一页|下一頁|下页|下頁|后页|后頁|下一篇|前进|前進|繼續|继续|更多|next|nextpage|nextpagestatic|more|>|›|»|forward| )+)"
let blacklists = ["https://mail.google.com/*","https://workflowy.com/*","https://www.shanbay.com/*","https://*.qcloud.com/*","https://kiwivm.64clouds.com/*"]
let searchlimit = 30
let scrollstep = 70
let zoomfactor = 0.05
"hints when using f
let hintcharacters = "asdfjklh"
" ----------------------------------------- Search Things -------------------------------------------
" cVim already Add Google/IMDB/Wikipedia/Amazon/Duckduckgo/Yahoo/Bing.etc search completion.
" So don't use the same name.You can see all the completionengines in the top when you type 't' for new tab.
" Be able to do :tabopen gm Seattle [:tabopen can be shorted by 't'] or :tabopen w Seattle to look up Seattle on Google Maps or Wikipedia.
let searchengine s = "https://stackoverflow.com/search?q="
let searchengine android = "http://developer.android.com/index.html#q="
let searchengine wk_cn = "https://zh.wikipedia.org/wiki/"
let searchengine wk = "https://en.wikipedia.org/wiki/"
let searchengine mba = "http://wiki.mbalib.com/wiki/"
let searchengine gp = "https://play.google.com/store/search?q="
let searchengine ge = "https://chrome.google.com/webstore/search/"
let searchengine dict = "http://cn.bing.com/dict/?mkt=zh-CN&setlang=ZH&q="
let searchengine rj = "http://xbeta.info/search?cx=008745974804865311006%3Azm_itmaeyj8&cof=FORID%3A9&ie=UTF-8&q="
let searchengine db = "https://www.douban.com/search?source=suggest&q="
let searchengine wp1 = "https://www.iizhi.cn/resource/search/"
let searchengine wp2 = "https://www.56wangpan.net/search/o2kw"
let searchengine wp3 = "https://www.upyunso.com/search.html?page=1&keyword="
let searchengine wp4 = "https://www.yunpanziyuan.com/fontsearch.htm?fontname="
let searchengine zm1 = "http://zmk.pw/search?q="
let searchengine zm2 = "http://subhd.com/search/"
let searchengine zm3 = "http://assrt.net/sub/?searchword="
let searchengine h3c = "http://www.h3c.com.cn/search/basesearch.aspx?q0="
" For now I use Ubuntu, If use other linux distribution,just change it.
let searchengine uman = "http://manpages.ubuntu.com/cgi-bin/search.py?q="
let searchengine ubug = "https://bugs.launchpad.net/ubuntu/"
let searchengine upkg = "http://packages.ubuntu.com/search?suite=default&section=all&arch=any&lang=zh-cn&searchon=names&keywords="
" Linux all distributions:
let searchengine lk = "http://lxr.free-electrons.com/ident?v=3.13;i="
let searchengine lman = "http://man.linuxde.net/"
let searchengine lpkg = "http://pkgs.org/search/"
" let completionengines =[*] means only the completionengines[serchengine] you list in [] will display. No recommended.
"let completionengines = ["android","dict","bug","pkg","pkgc","stack"]
let searchalias a = "android"
let searchalias g = "Google"
let searchalias d = "Duckduckgo"
let searchalias s = "stack"
let defaultengine = "dict"
" ----------------------------------------- Mapping -------------------------------------------
" unmap some duplicates and two-step keys
" d is used to dl, dh, d0 and d$
unmap a
unmap gq
unmap gQ
unmap [[
unmap ]]
unmap <C-p>
" t is also tabnew
map t :open!&<Space>
map T :open!<Space>
map o goToInput
map O goToLastInput
"## ;<*> to setMark and then '<*> go to mark <*>
"## '' can also go to last lastScrollPosition
" close Tab or Tabs.
map x closeTab
map X closeTabsToLeft
map D closeTabsToRight
map U lastClosedTab
map q cancelWebRequest
map Q hideDownloadsShelf
map R reloadAllTabs
map i :history!&<Space>
map I insertMode
map S :viewsource!<CR>
map p openPasteTab
map P openPaste
map > nextMatchPattern
map < previousMatchPattern
"map J lastUsedTab
map J createHint
map K lastClosedTab
map <Space> scrollPageDown
map h previousTab
map l nextTab
map H goBack
map L goForward
map + zoomPageIn
map - zoomPageOut
map _ zoomPageOut
map = zoomOrig
map [ moveTabLeft
map ] moveTabRight
map <Backspace> clearSearchHighlight
"CTL + <Number>, switch to tab <Number>, provided by chrome.
map <C-u> rootFrame
"input mode, make it more vim like
imap <C-h> backwardChar
imap <C-l> forwardChar
imap <C-f> forwardWord
imap <C-b> backwardWord
" make it similar to the setting of AHK using CapLock
imap <C-m> deleteForwardWord
" Code blocks
getIP() -> {{
httpRequest({url: 'http://api.ipify.org/?format=json', json: true},
function(res) { Status.setMessage('IP: ' + res.ip ,5); });
}}
" Displays your public IP address in the status bar
map ci :call getIP<CR>
" go to Chrome Pages.like ge: extentions;gd: downloads; gh: history.
map ga :tabopen chrome://apps<CR>
map gh :tabnew chrome://history<CR>
map gb :tabnew chrome://bookmarks<CR>
map cc :tabopen chrome://settings/clearBrowserData<CR>
" ----------------------------------------- Quick Visit -------------------------------------------
" Then you can vist https://github.com/ by 'gog'[in current tab] or 'gng'[in a new tab]
"let qmark g = [https://github.com"]
" But the following ways is more effective!
map <Leader>ge :tabopen https://chrome.google.com/webstore/category/apps?hl=en-US&gl=US<CR>
map <Leader>ga :tabopen https://play.google.com/store<CR>
map <Leader>gm :tabopen https://mail.google.com/mail/u/0/#inbox<CR>
" ----------------------------;
map <Leader>gh :tabopen https://github.com/zhlinh<CR>
map <Leader>gp :tabopen https://getpocket.com/a/queue/list<CR>
map <Leader>zh :tabopen https://www.zhihu.com<CR>
map <Leader>dd :tabopen https://www.dida365.com/#q/all/today<CR>
map <Leader>sb :tabopen https://www.shanbay.com/bdc/vocabulary/add/batch/<CR>
map <Leader>yt :tabopen https://www.youtube.com<CR>
map <Leader>gd :tabopen http://guangdiu.com<CR>
map <Leader>rs :tabopen http://rs.xidian.edu.cn/forum.php<CR>
map <Leader>cx :tabopen http://ss.zhizhen.com<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment