aboutsummaryrefslogtreecommitdiff
path: root/vimperatorrc.dot.link
blob: 889d3bb3f9792b31e4a6ea5771c559e77e7bb046 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
" References:
" https://vimpr.github.io
" http://sheet.shiar.nl/vimperator

" Basic configuration
set gui=tabs,nonavigation
set tabnumbers
set titlestring=
set defsearch=duckduckgo

" Theme
"colorscheme zenburn

" See https://github.com/vimperator/vimperator-labs/issues/88
set focuscontent

" Copy page title to the clipboard (with yt)
" http://www.mozdev.org/pipermail/vimperator/2008-October/002546.html
map yt :js util.copyToClipboard(content.document.title, true)<cr>

" Copy page as a Markdown link
map ym :js util.copyToClipboard('[' + content.document.title + '](' + content.document.location + ')', true)<cr>

" Copy page as a Trac wiki link
map yr :js util.copyToClipboard('[' + content.document.location content.document.title + ']', true)<cr>

" Copy page for sharing
map ys :js util.copyToClipboard(content.document.title + ' - ' + content.document.location, true)<cr>

" Open a new tab or the homepage
map e :tabopen about:newtab<cr>
map h gH

" Quit
map q :quitall<cr>

" Show all bookmarks shortcut
command bmarksshow :emenu Bookmarks.Show All Bookmarks

" Bookmark this page shortcut
command bmarkthis :emenu Bookmarks.Bookmark This Page

" Bookmark all tabs shortcut
command bmarkall :emenu Bookmarks.Bookmark All Tabs…

" Send Tab URLs shortcut
" https://addons.mozilla.org/en-US/firefox/addon/send-tab-urls/
command sendtabs :emenu File.Send Tab URLs...

" Copy URLs shortcut
" https://addons.mozilla.org/en-US/firefox/addon/copyurls/
command copyurls :emenu Edit.Copy Urls Expert.Tabs In This Window

" FIXME
" Post to Links Saraventos
command! -nargs=* link js link(<args>);
:js <<EOJS
  link = function(args) {
    var instance = 'https://links.sarava.org/bookmarks?action=add&address=';
    var doc      = content.document;
    var href     = encodeURIComponent(content.document.location);
    var title    = encodeURIComponent(content.document.title);
    var desc     = encodeURIComponent(doc.getSelection());
    var tags     = encodeURIComponent(args.toString().replace(/,,/g, ';').replace(/,/g, ' ').replace(/;/g, ', '));
    commands.execute('tabopen ' + instance + href + '&title=' + title + '&description=' + desc + '&tags=' + tags);
  }
EOJS