Home

Tips (wip)

Cool custom scripts

customize mapping per domain

site '*://mail.google.com/*' {
  set ignorenumerickeys
  unmap `
}
site '*://*.reddit.com/*' {
      " use reddit RES extension instead
      unmap j
      unmap k
      unmap J
      unmap K
      unmap s
}

custom hints detection per domain

" site filters
siteFilters() -> {{
 var filters = {
  '*://*.reddit.com/*': {
    reject: [
      'a:not([href])',
      '*[onclick^=click_thing]',
    ],
    accept: [
      '.grippy'
    ],
  },
  '*://*.google.*/*': {
    reject: [
      'li[class$="_dropdownitem"]',
      'div[class$="_dropdown"]',
      'div[aria-label="Apps"]',
      '.hdtbna.notl',
      '.irc_rit',
      'a[href^="imgres"]',
      'div[id=hdtbMenus]',
      'div[aria-label="Account Information"]',
      'img[jsaction^="load:"]'
    ],
  },
  '*://github.com/*': {
    reject: [
      '.select-menu-modal-holder.js-menu-content'
    ],
    accept: [
      '.js-menu-close',
    ],
  },
  '*://twitter.com/*': {
    accept: [
      '.new-tweets-bar.js-new-tweets-bar'
    ],
  },
  '*://imgur.com/*': {
    accept: [
      '.thumb-title',
      '.carousel-button'
    ],
  },
  '*://www.pogdesign.co.uk/*': {
    accept: ['.largemenutext', '.dropdown', '.icon-heart selectison']
  }
};
  return filters;
}}

reload configuration on demand

reloadcvim() -> {{
console.log('reloading cvim ' + (new Date()));
var value = "call :source /home/hassen/.cvimrc<CR>";
Mappings.parseLine(value);
window.location.reload(true);
}}
copyDescription(elem) -> {{
var text = elem.innerText || elem.value;
RUNTIME('copy', {text: text});
}}
map yd createScriptHint(copyDescription)

focus on element

focusElem(elem) -> {{
elem.focus();
}}
map ys createScriptHint(focusElem)
openLinkIncognito(link) -> {{
var value = "call :tabopen " + link.href + " |<CR>"
Mappings.parseLine(value);
}}

reopen current tab in incognito

reopenInIncognito(link) -> {{
var value = "call :tabopen " + window.location.href + " |<CR>"
Mappings.parseLine(value);
}}

turn current youtube in fullscreen

(bypassing age restriction when not authenticated)

" youtube
youtubeFullscreen() -> {{
        var location=window.location.href;
        location = location.replace('watch', 'watch_popup')
        window.location.href=location;
}}
map ;yt :call youtubeFullscreen<CR>

General tips

How to use python server for extra commands?

A python server is required. Start it using nohup python /home/hassen/workspace/mouseless/cvim_server.py > /dev/null 2>&1 & on boot

Example config

hbt cvimrc configuration example

Developer tips

What do the branches mean?

  • dev = active development branch and could be unstable

  • master = stable code and latest stable release

How to instant reload extension while developing?

  • ./scripts/watch.sh

  • Uncomment loop in background_scripts/extension-reloader.js:25

  • reload extension or restart browser

  • tabs reload whenever a file is saved

How to generate the documentation?

Original files are in adoc, generated files are in HTML. We store both instead of relying on github pages.

cd docs
bundle
asciidoctor -v  -B docs/ *.adoc

How to review pull request?

  1. review diffs + quality

  2. merge on dev branch

    1. git checkout -b rosshadden-fix/editing-divs master

    2. git pull git://github.com/rosshadden/mouseless.git fix/editing-divs

    3. git co dev

    4. git merge fix/editing-divs

    5. rebase + amend if needed - verify ticket number + code quality

  3. add to commands.adoc

  4. update changelog.adoc

  5. add user to thanks.adoc

  6. render all adoc files

FAQ

Check issues labeled question