-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpentadactylrc
114 lines (111 loc) · 7.33 KB
/
pentadactylrc
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
loadplugins '\.(js|penta)$'
colorscheme lucius
command! config -description "Edit .pentadactylrc file" -js editor.editFileExternally("file://~/.pentadactylrc")
command! view-config -description "Open .pentadactylrc file" :tabopen ~/.pentadactylrc
command! cfg config
command! print dialog print
command! p dialog print
command! play2 execute "!vlc --qt-minimal-view '" + buffer.URL + "' &"
command! play execute "!smplayer '" + buffer.URL + "' &"
command! issues -nargs=1 :tabopen! https://code.google.com/p/dactyl/issues/detail?id=<args>
command! tabrename -nargs=1 -literal=0 -js content.document.title = args[0];
command! hide :tabdo tabrename Wikipedia
command! related execute "tabopen related:" + window.content.location.hostname
command! -nargs=* siteSearch execute "tabopen <args> site:" + window.content.location.hostname
command! -nargs=* -complete=search search execute 'tabopen <args> ' + content.getSelection().toString()
command! jstoggle -js (function() { var p = "javascript.enabled"; prefs.set(p, !prefs.get(p)); dactyl.echo(p+" is now set to "+prefs.get(p)+"\n") })()
command! imgtoggle -js (function() { var p = "permissions.default.image"; prefs.set(p, prefs.get(p)==1 ? 2 : 1); dactyl.echo(p+" is now set to "+prefs.get(p)+"\n") })()
command! smartReload -js if (buffer.URL.spec.indexOf('#') > 0) { dactyl.execute("reload"); } else { dactyl.open(buffer.URL.spec); }
command! flushdns set! network.dnsCacheExpiration=0 | set! network.dnsCacheExpiration&
command! unload -js unloadTabObj.bContextUnloadTab(gBrowser.mCurrentTab)
command! unloadOthers -js unloadTabObj.bContextUnloadOther(gBrowser.mCurrentTab)
command! unpause -description "Reload/unpause unloaded tabs" tabdo echo
command! copyAllURLsToClipboard yank :tabdo :echo buffer.uri.spec
command! openAllURLsInClipboard -js (function() { var urls = dactyl.clipboardRead(); var urlsArray = urls.split(options.get("urlseparator").value); for(var i in urlsArray) { dactyl.open(urlsArray[i], { from: "paste", where: dactyl.NEW_TAB }); } })()
command! scihub -js content.document.location = content.document.location.href.replace(/([^\/:])\//, "$1.sci-hub.io/")
group user
map -count -modes=n,v <Space> -builtin <count>F
map -count -modes=i,n,v <C-Left> -builtin <count><C-p>
map -count -modes=i,n,v <C-Right> -builtin <count><C-n>
map -count -modes=n <Right> -builtin <count><C-n>
map -count -modes=n <Left> -builtin <count><C-p>
map -count -modes=n,v <C-l> -builtin <count><C-n>
map -count -modes=n,v <C-h> -builtin <count><C-p>
map -count -modes=n <S-l> -builtin -ex :tabmove +1
map -count -modes=n <S-h> -builtin -ex :tabmove -1
map -count -modes=n <S-Right> -builtin -ex :tabmove +1
map -count -modes=n <S-Left> -builtin -ex :tabmove -1
map -count -modes=n,v <M-Down> -builtin <count>G
map -count -modes=n,v <M-Up> -builtin <count>gg
map -count -modes=n,v '-' -builtin <count>zo
map -count -modes=n ,p -builtin <count>:set<Space>private!<Return>
map -count -modes=n ; -builtin :
map -count -modes=n,v <F2> -builtin <count>:noh<Return>
map -count -modes=n,v = -builtin <count>zi
map -count -modes=n,v r -builtin <count>R
map -count -modes=n,v R -builtin <count>r
map -modes=i,c <C-f> -builtin <Right>
map -modes=i,c <C-b> -builtin <Left>
map -modes=c <C-e> -builtin <C-t>$<Esc>
map -modes=c <C-a> -builtin <C-t>0<Esc>
map -modes=c <C-S-a> -builtin <C-t>Gvgg
map -modes=i <C-S-a> -builtin <C-t>0<Esc>
map -modes=i <C-S-e> -builtin <C-t>$<Esc>
map -modes=i,t <C-a> -builtin <C-t>Gvgg
map -modes=i,c <C-h> -builtin <C-t>hx<Esc>
map -modes=i,c <A-f> -builtin <C-t>e<Esc>
map -modes=i,c <A-b> -builtin <C-t>b<Esc>
map -modes=i,c <A-d> -builtin <C-t>dw<Esc>
map -modes=i,c <C-w> -builtin <C-t>vbx<Esc><Esc>
map -modes=i,c <C-k> -builtin <C-t>D<Esc>
map -modes=i,c <C-u> -builtin <C-t>vggx<Esc><Esc>
map -description "Reload pentadactyl config" ,r :so ~/.pentadactylrc<CR>:echo "Loaded config"<CR>
map -description "Copy" <C-c> -builtin Y
map -description "Paste" <C-v> -modes=i,t -builtin <C-v><C-v>
map -description "Pass-through mode (next key only)" <C-S-z> -builtin <C-v>
map -description "Go sourcecode: toggle on/off the view of the page source code" gs -builtin gf
map -description "Go sourcecode: toggle on/off the view of the page source code (external editor)" gS -builtin gF
map -description "Go input: go to the last used or first input field. (originally gi)" gI -builtin gi
map -description "Go iframe: replace the current page by the content of the first iframe found." gi -javascript content.document.location = content.document.getElementsByTagName('iframe')[0].src;
map -description "Go fullscreen: put the movie in fullscreen. (works with flash and html5)" gf -javascript (content.document.getElementsByTagName('object')[0] || content.document.getElementsByTagName('embed')[0]).style = 'position:fixed; top:0; left:0; width:100%; height:100%; clear:both; zindex=9999999999;'
map -description "(github) Download the current file in raw format to the download folder." -silent gF :echo 'Downloading...'<CR>:js "url=content.document.getElementById('raw-url').href; filename=url.match('([^/?]*)\?([^/]*)$')[1]; Downloads.getPreferredDownloadsDirectory().then(function(dir){ Downloads.fetch(url, dir+'/'+filename); })"<CR>
map -description "(github) Clone the github repository to ~/Downloads/." -silent gcl :echo 'Cloning github repository...'<CR>:exec '!cd ~/Downloads/; git clone -q '+content.document.location.href.match('https?://(www.)?github.com(/[^/?#]+){2}')[0]+' >/dev/null &';<CR>
map -description "(solarmovies) Search for the trailer of the movie on youtube." gt -javascript _=content.document.getElementsByTagName('h1')[0].innerHTML.match('</span>[ \t\n]*([^<>]+?)[ \t\n]*<a[^>]*>[ \t\n]*([^<>+?]*)[ \t\n]*');title=_[1];year=_[2]; content.document.location = 'https://www.youtube.com/results?search_query=trailer ' + title + ' (' + year + ')'
map -description "Open the video/link in vlc" -silent gv :play<enter>d
map -description='Yank all locations to the clipboard' -modes=n,v,c <C-y> -ex :copyAllURLsToClipboard
map -description='Open all locations from the clipboard' -modes=n,v,c <C-p> -ex :openAllURLsInClipboard
nmap <Leader>l -description='Select all http/ftp urls' /\r((htt|f)ps?:\/\/[^ '"]*|www\.[^ '"]*|[A-Za-z0-9._-]*\.com(/[^ '"]*| ))<cr>
cmap <C-Return> -builtin <End>.com<Home><C-Right><Right>www.<Return>
nmap <Leader>d -builtin -ex :downloads
nmap <Leader>h -builtin -ex :history
nmap <Leader>a -builtin -ex :dialog addons
nmap <Leader>s -builtin -ex :tab viewsource
nmap <Leader>c -builtin -ex :tabopen about:config
nmap <Leader>p -builtin -ex :private winopen
nmap gd -description "Download on sci-hub" -ex scihub
nmap gp -ex :private winopen
nmap <Leader>r -ex :related
nmap s -ex :search
nmap <C-/> :siteSearch<space>
nmap U -builtin :undo<Space>
nmap r -builtin -ex :smartReload
nmap <esc><esc> -ex unpause
set cdpath=''
set complete=search,location,bookmark
set hintkeys=asdfjkl;
set hlfind
set passkeys=
set passkeys+='mail.google.com':jkv<CR>rau#T/<space><S-space>?,gi,gl,*u,*i,*n,gi,gc,gl
set passkeys+='youtube.com':<space>
set scrolltime=0
set showstatuslinks=command
set showtabline=multitab
set strictfocus=google.com:laissez-faire,*:moderate,'chrome:*':laissez-faire,*:moderate
set titlestring='Mozilla Firefox'
set guioptions=Cnrs
set! browser.pocket.enabled=false
set! network.http.pipelining=true
set! network.http.pipelining.ssl=true
"set! browser.newtab.url=~/.pentadactyl/home.html
"set! browser.startup.homepage=~/.pentadactyl/home.html
" vim: set ft=pentadactyl: