Giter Club home page Giter Club logo

chromium-vim's Introduction

What is cVim?

Vim for Google Chrome. I hate using the mouse, especially after learning Vim. With my desktop (Linux), I have a lot of key bindings that make doing things easier: I open Chrome with Alt+w, I close a window with Alt+Shift+d, I open a terminal with Alt+t. This is harder to do with Chrome because it has no section for customizing keyboard shortcuts, and it is still necessary to use the mouse to do things like click links. cVim aims to eliminate this problem as best as the Chrome extensions API will allow it to.

Where can I get cVim?

  • There are two ways:
  • You can install it through the Chrome web store
  • You can download the .zip file here and enable cVim by going to the chrome://extensions URL and checking developer mode, then pointing Chrome to the unzipped folder via the Load unpacked extensions... button.

Why is this different than Vimium, ViChrome, or Vrome?

These extensions do a wonderful job of adding Vim-like keybindings to Google Chrome, but they lack many of the features that Firefox Addon, Pentadactyl, have.

  • What features does cVim add to Chrome?
  • Google/IMDB/Wikipedia/Amazon/Duckduckgo/Yahoo/Bing search completion
  • Support for custom search engines
  • History and Bookmark search/completion with bookmark folder support
  • Caret/Visual mode
  • Efficient link hints (with support for custom mappings)
  • Support for custom keyboard mappings
  • Regex page search with highlighting
  • Command bar with tab-completion
  • Smooth scrolling

cVim Help

cVimrc

  • Boolean cVimrc settings are enabled with the command 'set' + <SETTING_NAME> and disabled with the command 'set' + no<SETTING_NAME> (for example, set regexp and set noregexp)
  • Boolean cVimrc settings can be inversed by adding "!" to the end
  • Other settings are defined with = used as a separator and are prefixed by let (for example, let hintcharacters="abc")
setting type description default
searchlimit integer set the amount of results displayed in the command bar 25
scrollstep integer set the amount of pixels scrolled when using the scrollUp and scrollDown commands 70
timeoutlen integer The amount of time to wait for a <Leader> mapping in milliseconds 1000
fullpagescrollpercent integer set the percent of the page to be scrolled by when using the scrollFullPageUp and scrollFullPageDown commands 0
typelinkhintsdelay integer the amount of time (in milliseconds) to wait before taking input after opening a link hint with typelinkhints and numerichints enabled 300
scrollduration integer the duration of smooth scrolling 500
vimport integer set the port to be used with the editWithVim insert mode command 8001
zoomfactor integer / double the step size when zooming the page in/out 0.1
scalehints boolean animate link hints as they appear false
hud boolean show the heads-up-display true
regexp boolean use regexp in find mode true
ignorecase boolean ignore search case in find mode true
linkanimations boolean show fade effect when link hints open and close false
numerichints boolean use numbers for link hints instead of a set of characters false
dimhintcharacters boolean dim letter matches in hint characters rather than remove them from the hint true
defaultnewtabpage boolean use the default chrome://newtab page instead of a blank page false
cncpcompletion boolean use <C-n> and <C-p> to cycle through completion results (requires you to set the nextCompletionResult keybinding in the chrome://extensions page (bottom right) false
smartcase boolean case-insensitive find mode searches except when input contains a capital letter true
incsearch boolean begin auto-highlighting find mode matches when input length is greater thant two characters true
typelinkhints boolean (numerichints required) type text in the link to narrow down numeric hints false
autohidecursor boolean hide the mouse cursor when scrolling (useful for Linux, which doesn't auto-hide the cursor on keydown) false
autofocus boolean allows websites to automatically focus an input box when they are first loaded true
insertmappings boolean use insert mappings to navigate the cursor in text boxes (see bindings below) true
smoothscroll boolean use smooth scrolling false
autoupdategist boolean if a GitHub Gist is used to sync settings, pull updates every hour (and when Chrome restarts) false
nativelinkorder boolean Open new tabs like Chrome does rather than next to the currently opened tab false
showtabindices boolean Display the tab index in the tab's title false
sortlinkhints boolean Sort link hint lettering by the link's distance from the top-left corner of the page false
localconfig boolean Read the cVimrc config from configpath (when this is set, you connot save from cVim's options page false
completeonopen boolean Automatically show a list of command completions when the command bar is opened false
configpath string Read the cVimrc from this local file when configpath is set ""
changelog boolean Auto open the changelog when cVim is updated true
completionengines array of strings use only the specified search engines ["google", "duckduckgo", "wikipedia", "amazon"]
blacklists array of strings disable cVim on the sites matching one of the patterns []
mapleader string The default <Leader> key \
defaultengine string set the default search engine "google"
locale string set the locale of the site being completed/searched on (see example configuration below) ""
homedirectory string the directory to replace ~ when using the file command ""
qmark <alphanumeric charcter> string add a persistent QuickMark (e.g. let qmark a = ["http://google.com", "http://reddit.com"]) none
previousmatchpattern string (regexp) the pattern looked for when navigating a page's back button ((?!last)(prev(ious)?|newer|back|«|less|<|‹| )+)
nextmatchpattern string (regexp) the pattern looked for when navigation a page's next button ((?!first)(next|older|more|>|›|»|forward| )+)
hintcharacters string (alphanumeric) set the default characters to be used in link hint mode "asdfgqwertzxcvb"
barposition string ["top", "bottom"] set the default position of the command bar "top"
langmap string set a list of characters to be remapped (see vims langmap) ""

Example configuration

" 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

Blacklists

Site-specific Configuration

  • You can enable certain rc settings for sites using the blacklist match pattern as described above
" this will enable the config block below on the domain 'reddit.com'
site '*://*.reddit.com/*' {
      unmap j
      unmap k
      set numerichints
}

Running commands when a page loads

  • In a similar fashion to the site-specific configuration described above, cVim can run commands when a page is loaded with the call keyword
" 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
}

Mappings

  • Normal mappings are defined with the following structure: map <KEY> <MAPPING_NAME>
  • Insert mappings use the same structure, but use the command "imap" instead of "map"
  • Control, meta, and alt can be used also:
<C-u> " Ctrl + u
<M-u> " Meta + u
<A-u> " Alt  + u
  • It is also possible to unmap default bindings with unmap <KEY> and insert bindings with iunmap <KEY>
  • To unmap all default keybindings, use unmapAll. To unmap all default insert bindings, use iunmapAll

Tabs

  • Commands that open links (:tabnew and :open) have three different properties
  • ! => Open in a new tab
  • $ => Open in a new window
  • | => Open in an incognito window
  • & => Open in a new tab (inactive/unfocused)
  • * => Pin the tab
  • ? => Treat the query as a search
  • = => Treat the query as a URL
  • The use of these properties are best explained with examples:
: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

Code blocks

  • Code blocks allow you to interact with cVim's content scripts via the cVimrc.
  • Since code blocks use eval(...), you should only use them if you know what you're doing.
" 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>

Completion Engines

  • These are a list of completion engines that can be used in the command bar. They can be set by assigning their names to an array with the completionengines variable.
    • google, wikipedia, youtube, imdb, amazon, google-maps, wolframalpha, google-image, ebay, webster, wictionary, urbandictionary, duckduckgo, answers, google-trends, google-finance, yahoo, bing, themoviedb
  • Example usage:
let completionengines = ['google', 'google-image', 'youtube'] " Show only these engines in the command bar

Keybindings

Movement Mapping name
j, s scroll down scrollDown
k, w scroll up scrollUp
h scroll left scrollLeft
l scroll right scrollRight
d scroll half-page down scrollPageDown
unmapped scroll full-page down scrollFullPageDown
u, e scroll half-page up scrollPageUp
unmapped scroll full-page up scrollFullPageUp
gg scroll to the top of the page scrollToTop
G scroll to the bottom of the page scrollToBottom
0 scroll to the left of the page scrollToLeft
$ scroll to the right of the page scrollToRight
# reset the scroll focus to the main page resetScrollFocus
gi go to first input box goToInput
gI go to the last focused input box by gi goToLastInput
zz center page to current search match (middle) centerMatchH
zt center page to current search match (top) centerMatchT
zb center page to current search match (bottom) centerMatchB
Link Hints
f open link in current tab createHint
F open link in new tab createTabbedHint
unmapped open link in new tab (active) createActiveTabbedHint
W open link in new window createHintWindow
A repeat last hint command openLastHint
q trigger a hover event (mouseover + mouseenter) createHoverHint
Q trigger a unhover event (mouseout + mouseleave) createUnhoverHint
mf open multiple links createMultiHint
unmapped edit text with external editor createEditHint
unmapped call a code block with the link as the first argument createScriptHint(<FUNCTION_NAME>)
unmapped opens images in a new tab fullImageHint
mr reverse image search multiple links multiReverseImage
my yank multiple links (open the list of links with P) multiYankUrl
gy copy URL from link to clipboard yankUrl
gr reverse image search (google images) reverseImage
; change the link hint focus
QuickMarks
M<*> create quickmark <*> addQuickMark
go<*> open quickmark <*> in the current tab openQuickMark
gn<*> open quickmark <*> in a new tab openQuickMarkTabbed
gw<*> open quickmark <*> in a new window openQuickMarkWindowed
Miscellaneous
a alias to ":tabnew google " :tabnew google
. repeat the last command repeatCommand
: open command bar openCommandBar
/ open search bar openSearchBar
? open search bar (reverse search) openSearchBarReverse
unmapped open link search bar (same as pressing /?) openLinkSearchBar
I search through browser history :history
<N>g% scroll <N> percent down the page percentScroll
<N>unmapped pass <N> keys through to the current page passKeys
i enter insert mode (escape to exit) insertMode
r reload the current tab reloadTab
gR reload the current tab + local cache reloadTabUncached
;<*> create mark <*> setMark
'' go to last scroll position lastScrollPosition
<C-o> go to previous scroll position previousScrollPosition
<C-i> go to next scroll position nextScrollPosition
'<*> go to mark <*> goToMark
cm mute/unmute a tab muteTab
none reload all tabs reloadAllTabs
cr reload all tabs but current reloadAllButCurrent
zi zoom page in zoomPageIn
zo zoom page out zoomPageOut
z0 zoom page to original size zoomOrig
z<Enter> toggle image zoom (same as clicking the image on image-only pages) toggleImageZoom
gd alias to :chrome://downloads<CR> :chrome://downloads<CR>
ge alias to :chrome://extensions<CR> :chrome://extensions<CR>
yy copy the URL of the current page to the clipboard yankDocumentUrl
yY copy the URL of the current frame to the clipboard yankRootUrl
ya copy the URLs in the current window yankWindowUrls
yh copy the currently matched text from find mode (if any) yankHighlight
b search through bookmarks :bookmarks
p open the clipboard selection openPaste
P open the clipboard selection in a new tab openPasteTab
gj hide the download shelf hideDownloadsShelf
gf cycle through iframes nextFrame
gF go to the root frame rootFrame
gq stop the current tab from loading cancelWebRequest
gQ stop all tabs from loading cancelAllWebRequests
gu go up one path in the URL goUpUrl
gU go to to the base URL goToRootUrl
gs go to the view-source:// page for the current Url :viewsource!
<C-b> create or toggle a bookmark for the current URL createBookmark
unmapped close all browser windows quitChrome
g- decrement the first number in the URL path (e.g www.example.com/5 => www.example.com/4) decrementURLPath
g+ increment the first number in the URL path incrementURLPath
Tab Navigation
gt, K, R navigate to the next tab nextTab
gT, J, E navigate to the previous tab previousTab
g0, g$ go to the first/last tab firstTab, lastTab
<C-S-h>, gh open the last URL in the current tab's history in a new tab openLastLinkInTab
<C-S-l>, gl open the next URL from the current tab's history in a new tab openNextLinkInTab
x close the current tab closeTab
gxT close the tab to the left of the current tab closeTabLeft
gxt close the tab to the right of the current tab closeTabRight
gx0 close all tabs to the left of the current tab closeTabsToLeft
gx$ close all tabs to the right of the current tab closeTabsToRight
X open the last closed tab lastClosedTab
t :tabnew :tabnew
T :tabnew <CURRENT URL> :tabnew @%
O :open <CURRENT URL> :open @%
<N>% switch to tab <N> goToTab
H, S go back goBack
L, D go forward goForward
B search for another active tab :buffer
< move current tab left moveTabLeft
> move current tab right moveTabRight
]] click the "next" link on the page (see nextmatchpattern above) nextMatchPattern
[[ click the "back" link on the page (see previousmatchpattern above) previousMatchPattern
gp pin/unpin the current tab pinTab
<C-6> toggle the focus between the last used tabs lastUsedTab
Find Mode
n next search result nextSearchResult
N previous search result previousSearchResult
v enter visual/caret mode (highlight current search/selection) toggleVisualMode
V enter visual line mode from caret mode/currently highlighted search toggleVisualLineMode
unmapped clear search mode highlighting clearSearchHighlight
Visual/Caret Mode
<Esc> exit visual mode to caret mode/exit caret mode to normal mode
v toggle between visual/caret mode
h, j, k, l move the caret position/extend the visual selection
y copys the current selection
n select the next search result
N select the previous search result
p open highlighted text in current tab
P open highlighted text in new tab
Text boxes
<C-i> move cursor to the beginning of the line beginningOfLine
<C-e> move cursor to the end of the line endOfLine
<C-u> delete to the beginning of the line deleteToBeginning
<C-o> delete to the end of the line deleteToEnd
<C-y> delete back one word deleteWord
<C-p> delete forward one word deleteForwardWord
unmapped delete back one character deleteChar
unmapped delete forward one character deleteForwardChar
<C-h> move cursor back one word backwardWord
<C-l> move cursor forward one word forwardWord
<C-f> move cursor forward one letter forwardChar
<C-b> move cursor back one letter backwardChar
<C-j> move cursor forward one line forwardLine
<C-k> move cursor back one line backwardLine
unmapped select input text (equivalent to <C-a>) selectAll
unmapped edit with Vim in a terminal (need the cvim_server.py script running for this to work and the VIM_COMMAND set inside that script) editWithVim

Command Mode

Command Description
:tabnew (autocomplete) open a new tab with the typed/completed search
:new (autocomplete) open a new window with the typed/completed search
:open (autocomplete) open the typed/completed URL/google search
:history (autocomplete) search through browser history
:bookmarks (autocomplete) search through bookmarks
:bookmarks /<folder> (autocomplete) browse bookmarks by folder/open all bookmarks from folder
:set (autocomplete) temporarily change a cVim setting
:chrome:// (autocomplete) open a chrome:// URL
:tabhistory (autocomplete) browse the different history states of the current tab
:command <NAME> <ACTION> aliases :<NAME> to :<ACTION>
:quit close the current tab
:qall close the current window
:restore (autocomplete) restore a previously closed tab (newer versions of Chrome only)
:tabattach (autocomplete) move the current tab to another open window
:tabdetach move the current tab to a new window
:file (autocomplete) open a local file
:source (autocomplete) load a cVimrc file into memory (this will overwrite the settings in the options page if the localconfig setting had been set previously
:duplicate duplicate the current tab
:settings open the settings page
:nohlsearch clear the highlighted text from the last search
:execute execute a sequence of keys (Useful for mappings. For example, "map j :execute 2j")
:buffer (autocomplete) change to a different tab
:mksession create a new session from the current tabs in the active window
:delsession (autocomplete) delete a saved session
:session (autocomplete) open the tabs from a saved session in a new window
:script run JavaScript on the current page
:togglepin toggle the pin state of the current tab
:pintab pin the current tab
:unpintab unpin the current tab

Tips

  • You can use @% in "open" commands to specify the current URL. For example, :open @% would essentially refresh the current page.
  • Prepend a number to the command to repeat that command N times
  • Use the up/down arrows in command/find mode to navigate through previously executed commands/searches -- you can also use this to search for previously executed commands starting with a certain combination of letters (for example, entering ta in the command bar and pressing the up arrow will search command history for all matches beginning with ta

Contributing

Nice that you want to spend some time improving this extension. Solving issues is always appreciated. If you're going to add a feature, it would be best to submit an issue. You'll get feedback whether it will likely be merged.

  1. Run npm install in the repository's root folder
  2. Run make
  3. Navigate to chrome://extensions
  4. Toggle into Developer Mode
  5. Click on "Load Unpacked Extension..."
  6. Select the cVim directory.

chromium-vim's People

Contributors

1995eaton avatar a-nguyen avatar ape avatar brookhong avatar corngood avatar dhda avatar elig0n avatar fightingdreamer avatar freeo avatar gogu avatar harababurel avatar hpurmann avatar itchyny avatar jayphen avatar lehmacdj avatar linuus avatar mrmr1993 avatar narrator0 avatar nikofil avatar nkgm avatar paulhybryant avatar pcworld avatar quiwamu avatar soli avatar stoeffel avatar the-compiler avatar tmsanrinsha avatar tsfoster avatar unc0 avatar zapster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chromium-vim's Issues

Version control custom mappings

What I mean by that is: load custom mappings from a file.

I guess this can be tricky due to Chrome's limitations, but I think I might have some ideas.

One possibility would be to load the mappings manually from the settings page by the press of a button. This can potentially be tedious and impractical if the user changes the custom mappings regularly, but I think it's a good compromise.

Another potential solution would be to pull the mappings directly from the internet (either the raw version of a file from github, or a gist, or whatever..)

I really don't know if either of those potential solutions can be implemented, but it's worth it to try in my opinion. I recently uninstalled cVim and installed the latest version from github. And I lost all my mappings. The idea is to prevent stuff like that to happen.

Quickmarks/Search broken (take III- the revenge off.. ;-) )

Hya :)

quick marks and searches are broken again here

for single quickmarks they do work but dont launch the site but rather a google search
same for seach engines...it launches a google search
quickmark
multiple quickmark (for multiple sites) seem completely broken (maybe my syntax is wrong? though i followed the docu)

here is my current relevant section:

"Quick marks

let qmark 0 = "http=//www.weather.com/weather/today/Chestnut+Hill+MA+02467"
let qmark 1 = "https=//mail.google.com/mail/u/0/?tab=cm&zx=1a9kkuzmcil0m&shva=1#inbox"
let qmark 2 = "https=//ttrss.server-speed.net/#f=-3am"
let qmark 3 = "https=//www.google.com/calendar/b/0/render?tab=mc"

let qmark 5 = "https=//www.google.com/contacts/#contacts

let qmark 6 = ["http=//woot.com" ,"http=//1saleaday.com/" , "http=//mobile.dailysteals.com/" , "http=//slickdeals.net/", "http=//www.priceplunge.com/" , "http=//www.amazon.com/mobile-apps/b?ie=UTF8&node=2350149011" , "http=//deals.woot.com/"]

let qmark 7 = ["https=//groups.google.com/forum/?fromgroups=#!forum/", "https=//plus.google.com/u/0/", "https=//bbs.archlinux.org/viewforum.php?id=27"]

let qmark 9 = ["http=//www.walla.co.il/", "http=//www.ynet.co.il/", "http=//www.nrg.co.il/", "http=//sports.walla.co.il/", "http=//espn.go.com/", "http=//soccernet.espn.go.com/", "http=//www.cnn.com/", "http=//kde-apps.org/", "http=//kde-look.org/", "w"="http=//www.walla.co.il/"]

let qmark o = "http=//sports.walla.co.il/"
let qmark e = "http=//espn.go.com/"
let qmark s = "http=//soccernet.espn.go.com/?cc=5901"
let qmark c = "http=//www.cnn.com/"
let qmark l = "http=//www.livescore.com/default.dll?page=home"
let qmark L = "http=//www.firstrowsports.eu/"
let qmark S = "http=//subforge.org/projects/subtle/wiki"
let qmark E = "http=//espn.go.com/espn3/index"
let qmark P = "http=//paste.xinu.at/"
let qmark Y = "http=//picasaweb.google.com/ykloog"
let qmark d = "http=//debuzzer.com/"
let qmark R = "https=//bbs.archlinux.org/viewtopic.php?pid=875820#p875820"
let qmark F = "http=//192.168.0.44/"
let qmark D = "http=//www.dropbox.com/"
let qmark W = "192.168.0.100"
let qmark M = "http=//www.nrg.co.il/online/55/ART2/334/648.html?hp=55&cat=302&loc=11"
let qmark m = "http=//talk.maemo.org/"
let qmark a = "http=//forum.mobilism.org/viewforum.php?f=398&sid=458ecb73421dcafe102bc23ef5f955fe"
let qmark q = "http=//slickdeals.net/"
let qmark x = "http=//forum.xbmc.org/"
let qmark h = "http=//www.haaretz.co.il/"
let qmark U = "http=//gmusicbrowser.org/layout_doc.html"
let qmark i = "http=//boston.craigslist.org/"
let qmark K = "http=//livetv.ru/en/"
let qmark f = "https=//bbs.archlinux.org/viewforum.php?id=27"
let qmark g = "https=//plus.google.com/u/0/"
let qmark y = "www.ynet.co.il"
let qmark r = "http=//lists.gnu.org/archive/html/emacs-orgmode/"
let qmark u = "https=//github.com/zeltak"
let qmark v = "https=//vpn.bgu.ac.il/extender.html"

"internal chrome marks
let qmark x = :chrome://extensions

" Search engines
let searchengine im = "http://www.imdb.com/find?q=%s&s=all"

penta/vimperator like quickmarks and a way to launch them

OMG finally a worthy pentadactyl/vimperator solution, thank you so much for this :)

i would love to finally ditch FF to chrome but i cant live without quickmarks :) can i request support for quickmarking sites like in penta/vimp where g-o-a would launch site a and g-n-b would launch site b in a new tab etc. also crucial is a way to launch multiple sites together so g-n-0 would launch the associated quickmarks in multiple tabs

thxa alot again its truly epic

Z

let barposition = "bottom" hides incremental search

When using a bottom command bar, the incremental search gets hidden…

Once the search expression is complete, I can zz out of behind the command bar, but I wonder if centering the incremental search hits wouldn't be better. At least, I think you should move it above the command bar.

Request: Make current search app-wide rather than local to the tab

With previous vim-like browser plugins, I often would search for something, then hit n some number of times. Then switch to another tab to continue hitting n and searching for the text I searched for. This doesn't work with cVim because the current search that is repeated with n appears to be local to each tab

Automatically enter/leave insert mode when text input gain/lose focus

Somehow this extension seems to override the JavaScript keyboard event listeners for text inputs in normal mode, even when noinsertmappings is set.

This makes it hard to interact with text inputs. For example, user can not navigate the auto completion menu with arrow keys, and the regular "hit enter to submit" stuff does not work on some sites.

It would be nice to make the extension automatically enter / leave insert mode as text inputs gain / lose focus. Or just stop overriding the keyboard listeners for text inputs.

Can't remap 'gg' and 'G'

I can see that gg and G are mapped by default to start and end of page. But I see no way to customize this.

[REQUESTS] a few small requests

Hi again

i have a few small ideas over the last few days id like to raise and see what you guys think:

  1. more vim like visual mode: is it possible to have V and C-v like vim visual binds to start visual block/line selections in cvim's visual mode?
  2. add some visual feedback to some command like : copied link to clip (yy) etc so a notification or something similar appears

3/ :bookmarks / (autocomplete) , how does that work, can we browse bookmark with levels so you can manually enter folders?

  1. add a restart chrome command
  2. add a reload all tabs command
  3. add a keybind to quickly enable/disable cvim

thx alot

Z

Localhost gets redirected to Google.

I've just installed your plugin after having seen your post on /r/vim (great job, by the way!) So far this is removing any need I had for vimium, with only one shortcoming. Currently, :tabopen localhost:5000 or :tabopen http://localhost:5000 will detect that a search is desired and redirect the user to google, when this is a valid network request and should be treated as such. I suspect that this problem extends to other local DNS mappings as well, though I don't have any way to test that currently.

Vim bindings for textarea/input elements

I've created a branch that adds very basic support for vim key bindings in normal HTML <textarea> and <input> elements. This is a pretty big change, so it would be great if some of you guys could test it out before I push the commit to master. Thanks!

When textareas/input elements are focused, they enter normal mode. Press 'i' to begin typing and escape to go back to normal mode (press escape/<-[> in normal or visual mode to unfocus the text box.

cVim loads after the page is loaded, but not quite...

As discussed in issue #17 there is a "problem" with the loading of the extension. cVim loads after the web page loads, but not quite; Let me explain with a simple example. A feature was recently added to disable text inputs from getting the focus automatically. This created an annoyance: if the page is still loading and the user manually focuses the text field, cVim will "unfocus" it continuously until both cVim and the Web page are fully loaded. This is just one aspect of the problem. A lot of cVim's functionality suffers from the same issue. There are two potential solutions to this problems that come to my mind as of now, one of which is not viable or difficult to implement:

  1. Load cVim before the Web page. (This is the solution that is not viable as discussed in issue #17)
  2. Load cVim after the Web page. And by that I mean after the Web page is fully loaded.

Bug: cvimrc config not parsed correctly

The cvimrc config appears to not be parsed correctly if certain combinations of settings are used:
If I use the dogpile search engine definition from your example, it works.

let searchengine dogpile = "http://www.dogpile.com/search/web?q="

If I use it with the completionengines setting also specified in your example, it doesn't work.

let searchengine dogpile = "http://www.dogpile.com/search/web?q="
let completionengines = ["google", "amazon", "imdb"]

It doesn't get picked up at all, and if I manually type it in with a query:

:open dogpile cake

I just get a google search for "dogpile cake".
These entries are the only lines in my cVimrc config, and the issue is still present.

OS: Windows 7
Browser: Chrome Stable Version 35.0.1916.114 m
Extension: Chrome Store Version

Request: Ability to disable address bar?

One thing I really liked about some of the firefox vim-plugins is that you can disable the address bar. The biggest source of frustration I find is that I sometimes get 'trapped' in the address bar and do not have access to cVim commands. cVim has a command for open so the address bar seems redundant. Is there a way to disable it?

cvim keys are unresponsive until full site is loaded

Hi

I dont know if this is by design or a bug but as opposed to FF and penta etc i cant use my cvim keys when i launch a website until its has been fully loaded (~2-3 seconds). this is slightly annoying when you launch multiple websites and want to start moving/scrolling etc.

thx!

Z

Contents of cVimrc gets cleared after restarting chrome

I'm finding that every time I restart chrome I have to re-enter all the cVimrc commands that I added previously (cVimrc becomes empty).

Here is the cVimrc I'm using:

set scrollstep=150
set autofocus=false

unmap d
map d :open

unmap j
map j scrollDown

unmap o
map o scrollPageUp

unmap i
map i scrollPageDown

unmap <C-i>
map <C-i> scrollUp

unmap s
map s createHint

unmap S
map S createTabbedHint

unmap Y
map Y yankUrl

unmap /
map / openSearchBar

unmap ?
map ? openSearchBarReverse

unmap I
map I insertMode

unmap l
map l scrollRight

unmap h
map h scrollLeft

unmap gi
map gi goToInput

unmap <C-v>
map <C-v> centerMatchH

unmap m
map m createMultiHint

unmap r
map r reloadTab

unmap R
map R reloadTabUncached

unmap yy
map yy yankDocumentUrl

unmap b
map b :bookmarks

unmap p
map p openPaste

unmap P
map P openPasteTab

unmap x
map x closeTab

unmap t
map t :tabopen

unmap H
map H goBack

unmap L
map L goForward

unmap ]]
map ]] nextMatchPattern

unmap [[
map [[ previousMatchPattern

unmap n
map n nextSearchResult

unmap N
map N previousSearchResult

unmap :
map : openCommandBar

unmap D
map D scrollToTop

unmap V
map V scrollToBottom

unmap f
map f :open

cVim prevents the Stylish from working

cVim conflicts with Stylish and some similar custom-CSS extensions I've tried - at least when my cVimrc is applied. I only found cVim yesterday so my cvimrc is still a work in progress, but I don't believe the content is invalid.

Stylish works fine without cVim installed. After install, things look fine when a page is first loaded, but upon scrolling or typing : to bring up the HUD, the page content disappears and I just see the base page colour.

The page content does re-appear, but only after a 10+ second wait - rather annoying.

After some considerable trial and error, I've determined that the setting autohidecursor is the cause of this conflict - commenting it out removes the problem.

OS: Windows 7 Enterprise N (32 bit)
Browser: Chrome Stable

I also use Linux, hence the use of this setting, but I haven't noticed the problem there.

Questions and feature request: built in search engines

Questions:
I want to use cvim as I do pentadactyl for searches = e.g.

:open g cake

to search google for cake.

I know that there's a default search engine "google" with the "completion engine" (suggestions) enabled, and it'd be great if I could use this or easily modify it's name/keyword to "g".

Is there any way I can make a shortcut / alternate name to use the default google search in cVim? e.g. search for cake by typing:

:open g cake

I'd prefer to use different keywords to the default for many of the existing ones I find useful, and I'd like to delete all the ones i don't use.

I'm aware of the setting "completionengines" and this helps a little in avoiding cluttered results in the HUD, but it doesn't let me use completion with my preferred search keywords.

A few questions:

  1. What are all the defined default search engines, and is there any way I can modify, rename or delete them via the config file? e.g. I'd like to rename the google one to "g" and retain the search completion. I'd like to change the domain to google.co.uk to enable local results too.
  2. Is there any reason these can't be exposed in the configuration file? i.e. None of them exist without entries in the config file, using the current syntax for "let searchengine", or an improved one.
  3. If I were to simply ignore the default search engines and define my own duplicate ones using my preferred names, is there any way I can enable completion for these (assuming they're the same engines that you already have configured for this functionality)?

Thanks
OS: Windows 7
Browser: Chrome Stable Version 35.0.1916.114 m
Extension: Chrome Store Version

What happened to undo closed tab ;-)

Hya

i cant seem to find in the Docu any reference to the undo close tab command, is this by design? i seem to remember we had such a command to bind to a key

off topic, can the hints be customized (color, size etc)?

best

Z

Big switch in main.js

The background_script main.js has a really big switch, which handles the actions.
I would refactor it as followed, to remove some repeations and clearify the code.
And maybe I would move the actions to a separate file.
This would make it easier to write some unittests for the actions.

// all actions are in the actions object.
// they have access to the request, url and the sender
actions.openLink = function() {
  chrome.tabs.update({
    url: this.url
  });
};

actions.openLinkTab = function() {
  chrome.tabs.create({
    url: this.url,
    active: this.request.active,
    index: this.sender.tab.index + 1
  });
};

chrome.runtime.onMessage.addListener(function(request, sender, callback) {
  var url = request.url;
// repeats and converting the url is handled for all requests
  if (isRepeat(request)) request.repeats = 1;
  if (url && !request.noconvert)  url = url.convertLink();

  actions.url = url;
  actions.request = request;
  actions.sender = sender;
  if (actions[request.action]) {
    for (var i = 0; i < request.repeats; i++) { // repeation is handled here for all requests
      actions[request.action](); // calls the correct action
    }
   ...

Do you see any problems?

Alert boxes with "undefined" when resuming a Chrome session

Hi, first thanks a lot for this great extension.

I'm trying to migrate completely away from Vimium, but there are still a few issues that bother me, I'll try to characterize them as precisely as possible.

First, I have Chrome set up so that it reopens the tabs that were open when I last quit on opening.

When I enable cVim, I usually get a couple (not as many as my tabs, but usually at least 3 or 4) alert boxes while the tabs are all reloading. The only content is "undefined"…

I guess that cVim is trying to access something too early. May be its settings are the issue since I've had cases where if I don't manually reload a page, it seems that my cvimrc is ignored…

BTW, I'm using chromium-vim stable (from the store) on a Canary version of Chrome on MacOS (currently that's 37.0.2008.0).

CSS Changes

Just wanted to know what everyone thinks about the command bar CSS. Any suggestions or changes that could be used to make it look a little better?

Feature request: Enhance syntax for defining search engines

The syntax for defining a new search engine is currently not sufficient for all sites.

In firefox/pentadactyl, search engines are exposed as bookmarks, and use the following syntax with %s as the search query parameter.

https://play.google.com/store/search?q=%s&c=apps

In cVim if I understand correctly the syntax is currently simpler, so I can only use search engines if the syntax has the query term as the last item following the URL.
Please confirm if I'm wrong about that - If not, any chance the syntax can be modified to match the firefox / pentadactyl standard?

Alternately do you intend to add a feature to use Chrome's native search keywords in cVim in the same way Pentadactyl works with Firefox search shortcuts?
I'd suggest this would save a lot of re-configuration - though I do appreciate being able to have all my configuration in text files that I can sync.

OS: Windows 7
Browser: Chrome Stable Version 35.0.1916.114 m
Extension: Chrome Store Version

Support for user defined download targets

Hi,

You said to post all ideas i had so here is another one ;-)

what do you think about user defined download folders when using hints?
lets say im using hints to download a file. what if there was an option to define in the RC file something like this:
set dl_dir1 = /home/zeltak/Downloads
set dl_dir2 = /home/zeltak/ISO

then i could prefix/postfix the hint with the a number/key and auto download to that dir, so something like ; >>2 >> HINTCHAR would download the file to the ISO dir?

any thoughts

thx

Z

[IDEA] hints for tabs and jumping to tabs

Hya

This may be totally undoable so im just putting it out there :)

wouldn't it be cool to have hints similar to link hints for tabs? that is you have a bunch of tabs open you press a key (lets say w/e etc) and numbers/alpha_chars appear overlaid/beside tabs. press 1/a/etc and it jumps to the first tab. press 5 the 5th etc

just a thought :)

best

Z

Support :listcommands, :listoptions, :listkeys

I use Chrome and Firefox so I switch between cVim and Pentadactyl. I just started using both and they seem pretty comparable (although I prefer cVim's hint notation), but it would be nice if cVim supported the various list commands. As a beginner, I find them very useful.

#31 again (cant seem to re-open issue on github)

Hya

sorry to bother you with this this but even after latest update it still give me an error and dosent work. current syntax tried in config:

let qmark a = ["http://www.reddit.com", "http://www.google.com", "http://twitter.com"]
let qmark w = ["http://www.cnn.com"]
let qmark e = "http://www.espn.com"

also the search engines dont seem to quite work as expetced. btw have you thought maybe on using the built in chrome search engine/keyword database as in FF/penta. that way the user dosent need to define it twice
current config:

let searchengine im = "http://www.imdb.com/find?q=%s&s=all"

ill be happy to help debug this

thx Jake

Z

Enable to fuzzy-match links to follow

When you press f/F (by default) to follow a link, it displays letters that you need to press to follow one. It would be cool if it was possible to also type (part of) the text of a link to decide which one to follow. I imagine this would probably be a problem if the hints are letters (there would be conflicts), so I guess this feature should only work if the hints are numbers (i.e.: setting the numerichints setting).

Unable to remap the ' key

I hope you don't mind me spamming you with issues

I can't seem to remap the single quote key. The command I'm trying:

map ' previousSearchResult

.completion-item .right {font-style: italic;} rule gets overrided

In the cVim options I see a rule

.completion-item .right {
 font-style: italic;
 color: #888;
 width: 47%;
}

But the italic font-style does not get applied. In the inspector, I see a "user stylesheet" section that's overriding this:

.completion-item .right {
min-height: 0px;
border-radius: 0px;
box-sizing: content-box;
box-shadow: none;
margin: 0px;
-webkit-appearance: none;
letter-spacing: normal;
word-spacing: normal;
text-transform: none;
text-indent: 0px;
text-shadow: none;
text-align: start;
outline: none 0px;
border: 0px;
border-image-source: initial;
border-image-slice: initial;
border-image-width: initial;
border-image-outset: initial;
border-image-repeat: initial;
line-height: 1;
font-style: normal;
}

See screenshot:
cvim-inspector

Where is this coming from?

support for "userscripts"

Hi again

i would like to present an idea of scripts ive used in some alternative linux lightweight browsers that make it very easy to create small bash/js/other scripts from browser input.
warning: i know nothing about programming so the following could be a total mess ;-)
these bash/js/other scripts could be mapped/assigned to cvim key binds for quick launching. for example here are some scripts from dwb (http://portix.bitbucket.org/dwb/resources/manpage.html)

The following script will download the current webpage:

!/bin/bash

dwb: Control w

wget $DWB_URI

Popup an alert dialog:

!/bin/bash

dwb: Control h

echo "js window.alert('Hello world');" > ${DWB_FIFO}

maybe cvim could provide similar variables: DWB_URI, DWB_TITLE, DWB_PROFILE, DWB_NUMMOD, DWB_ARGUMENT

would love to hear input from everyone

Z

Disable cVim pagenavigation on this domain

If you disable cVim on a page (i.e. reddit),
it would be nice when the tabnavigation and commandline stayed enabled.

It breaks the workflow if you switch tabs using J or K, and land on a disabled tab and you have to switch back to ctrl tab.

Maybe it would be nice to add a new function for this 'Disable cVim pagenavigation on this domain' or something like that.

confusion over quickmarks

Hi again

im a little confused on what im doing wrong with qmarks
i have tried these 3 types in my config:

let qmark a = ["http://www.reddit.com", "http://www.google.com", "http://twitter.com"]
let qmark w = ["http://www.cnn.com"]
let qmark e = "http://www.espn.com"

yet none seem to work using gna/gnw/gne it always gives me an: Error: mark not set

what am i missing here

best

Z

launch searches using chrome built in default search engines

Hi again

lovin' cvim alot :)

the current search works great but i was wondering why limit it to 4-5 engines? why not take the penta approach where one can launch a search using FF user added search engines (where here we can use chromes default search engines). in chrome you can assign a keyword to each search engine (ie google image search will be 'gi').
then like in penta i could use :gi wookie to launch a google image search for wookies etc

thx

Z

cvim stops working sporadicly

Hi

i cant quite put my finger on it but it seems that every X minutes/hours cvim stops working. all hotkeys, quickmakrs etc dont work until i restart chrome. any idea how one goes on debugging this? does anyone else have these issues

also is there a way in new chrome version to have cvim work in new tabs etc or will that never work?

best

Z

[BUG} Every update wipes my config

Hya

seems like each update of cvim wipes my config options.
also ive noticed there is a Sync cVimrc with GitHub Gist options which isnt editable, could that be the cause of the issue?

thx

Z

Compatibility of hjkl navigation with PDF viewer

Hi there,

Is it possible to make the hjkl nagivation compatible with the PDF Viewer extension?

This extension uses HTML5 to display PDF files. However, cvim does currently not allow me to scroll the PDF files continously but only page-wise.

Thanks!

Mapping keys to commands requires use of literal whitespace character

In my cVimrc I wanted to remap keys to use b instead of B to bring up the :buffers menu.
After unmapping both keys, I map b to the new action with

    map b :buffers

After saving and refreshing a page, this doesn't work (no action at all).

After revisiting some pentadactylrc documention I tried:

    map b :buffers<Space>

and various similar codes to put a space after the :buffers command, , , , . This didn't work either.

The solution was to put a real " " space character after the :buffers command

 map b :buffers 

This works fine, but is clearly not easy to read, communicate to others or debug.

Suggested solution:

  1. Add code to recognise as a space character, in the same way that means return.
  2. Add an example like this into the example cVimrc config in the readme.

cVim appears as Image Zoom after today's update

It seems that cVim now shows up as Image Zoom (both in the Chrome store as well as in my Extensions list). Even the options are for Image Zoom. cVim functionality has stopped working at this point.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.