-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pentadactylrc
313 lines (282 loc) · 7.73 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
"hg7127
loadplugins '\.(js|penta)$'
group user
" vim: set ft=pentadactyl:
" Command to validate XHTML
command! -description='Validate XHTML' valid :open javascript:void(location='http://validator.w3.org/check?uri='+escape(location))
" I never use marks, but always use quickmarks
nmap -builtin "'" go
nmap -builtin '"' gn
" Show pattern matches as you type,
set incfind
" Ignore case in search unless pattern has uppercase chars,
set findcase=smart
" Highlight all search matches, not just the first
set hlfind
" Configure the command line and the look
" set maxitems=20
set showtabline=never
set showstatuslinks=command
set guioptions=Cs
" Editor, C-e invokes it in text fields
set editor="emacsclient -c"
" Shift is hard.
" nmap -builtin ; :
" Colorscheme
" colorscheme molokai
" Shortcuts to frequently used bookmarks,
" Email current url
command email-url :open gmail-this
" Save to org-mode Read Later Tree
" command read-later :open org-capture-read-later
" Open link in a private tab,
command private-tab -nargs=+ -description "Open Private Tab" -javascript <<EOF
privateTab.readyToOpenTab(true);
gBrowser.addTab("about:blank");
dactyl.execute(":tablast");
dactyl.execute(":open " + args);
privateTab.stopToOpenTabs();
EOF
" Toggle plugins.clicktoplay,
command toggle-click-to-play -js <<EOF
if(Services.prefs.getBoolPref("plugins.click_to_play"))
Services.prefs.setBoolPref("plugins.click_to_play", false);
else
Services.prefs.setBoolPref("plugins.click_to_play", true);
dactyl.execute(":reload");
EOF
" Convert given time to local time using wolfram alpha,
command local-time -nargs=+ -description "Convert Date to Local Time" -javascript <<EOF
dactyl.execute(":tabopen");
dactyl.open("http://www.wolframalpha.com/input/?i=" + args + " in local time");
EOF
" Youtube Controls
command! -nargs=* youtubejumppvideo -description "Jump to Percentage of Youtube Video Position" :open javascript:
\\ (function(){
\\
\\ /*
\\ Salta a la posición del video
\\ 1) En minutos
\\ 2) En segundos
\\ 3) En horas
\\ 4) En reloj
\\ 5) En porcentaje
\\
\\ Falta función para cambiar el volumen, la calidad, y el tamaño
\\
\\ */
\\ if("<args>".trim() !== "") {
\\ var args="<args>".split(" ");
\\ var count=args[0];
\\
\\ var vid =content.document.getElementById('movie_player');
\\
\\ var videourl=vid.getVideoUrl();
\\ var duration=vid.getDuration();
\\ var currenttime=vid.getCurrentTime();
\\ var availableQualityLevels=vid.getAvailableQualityLevels();
\\
\\ /* Salta un porcentaje */
\\ if(count>100){
\\ count=100;
\\ }
\\ if(count<0){
\\ count=0;
\\ }
\\ var jump=(duration*count)/100;
\\
\\ if(jump>duration){
\\ jump=duration
\\ }
\\
\\ vid.seekTo(jump, true);
\\
\\ }
\\
\\ })()
command! -nargs=* youtubejumpsvideo -description "Jump to Seconds of Youtube Video Position" :open javascript:
\\ (function(){
\\
\\ /*
\\ Salta a la posición del video
\\ 1) En minutos
\\ 2) En segundos
\\ 3) En horas
\\ 4) En reloj
\\ 5) En porcentaje
\\
\\ Falta función para cambiar el volumen, la calidad, y el tamaño
\\
\\ */
\\ if("<args>".trim() !== "") {
\\ var args="<args>".split(" ");
\\ var count=args[0];
\\
\\ var vid =content.document.getElementById('movie_player');
\\
\\ var videourl=vid.getVideoUrl();
\\ var duration=vid.getDuration();
\\ var currenttime=vid.getCurrentTime();
\\ var availableQualityLevels=vid.getAvailableQualityLevels();
\\
\\ if(count<0){
\\ count=0;
\\ }
\\ /* Salta unos segundos */
\\ jump=count;
\\
\\ if(jump>duration){
\\ jump=duration
\\ }
\\
\\ vid.seekTo(jump, true);
\\
\\ }
\\
\\ })()
command! -nargs=* youtubejumpmvideo -description "Jump to Minutes of Youtube Video Position" :open javascript:
\\ (function(){
\\
\\ /*
\\ Salta a la posición del video
\\ 1) En minutos
\\ 2) En segundos
\\ 3) En horas
\\ 4) En reloj
\\ 5) En porcentaje
\\
\\ Falta función para cambiar el volumen, la calidad, y el tamaño
\\
\\ */
\\ if("<args>".trim() !== "") {
\\ var args="<args>".split(" ");
\\ var count=args[0];
\\
\\ var vid =content.document.getElementById('movie_player');
\\
\\ var videourl=vid.getVideoUrl();
\\ var duration=vid.getDuration();
\\ var currenttime=vid.getCurrentTime();
\\ var availableQualityLevels=vid.getAvailableQualityLevels();
\\
\\ if(count<0){
\\ count=0;
\\ }
\\ /* Salta unos minutos */
\\ jump=count*60;
\\
\\ if(jump>duration){
\\ jump=duration
\\ }
\\
\\ vid.seekTo(jump, true);
\\
\\ }
\\
\\ })()
command! -nargs=* youtubejumphvideo -description "Jump to Hours of Youtube Video Position" :open javascript:
\\ (function(){
\\
\\ /*
\\ Salta a la posición del video
\\ 1) En minutos
\\ 2) En segundos
\\ 3) En horas
\\ 4) En reloj
\\ 5) En porcentaje
\\
\\ Falta función para cambiar el volumen, la calidad, y el tamaño
\\
\\ */
\\ if("<args>".trim() !== "") {
\\ var args="<args>".split(" ");
\\ var count=args[0];
\\
\\ var vid =content.document.getElementById('movie_player');
\\
\\ var videourl=vid.getVideoUrl();
\\ var duration=vid.getDuration();
\\ var currenttime=vid.getCurrentTime();
\\ var availableQualityLevels=vid.getAvailableQualityLevels();
\\
\\ if(count<0){
\\ count=0;
\\ }
\\ /* Salta unos horas */
\\ jump=count*3600;
\\
\\ if(jump>duration){
\\ jump=duration
\\ }
\\
\\ vid.seekTo(jump, true);
\\
\\ }
\\
\\ })()
nmap -count <A-S-p> :youtubejumppvideo <count> <CR>
nmap -count <A-S-s> :youtubejumpsvideo <count> <CR>
nmap -count <A-S-m> :youtubejumpmvideo <count> <CR>
nmap -count <A-S-h> :youtubejumphvideo <count> <CR>
command! youtubetogglevideo -description "Toggle Youtube Video Status" :open javascript:
\\ (function(){
\\ /*
\\ Caracteristicas para notar de PentaDactyl
\\ 1) No funciona jQuery
\\ 2) Cada nueva linea tiene que empezar con dos back slash
\\ 3) los comentarios solo funcionan con slash asterisco
\\ 4) El código tiene que estar envuelto (wrapp) en un método, y este
\\ envuelto en un self-invoking
\\ 5) Los argumentos no son tratados como cadenas (Strings)
\\ 6) Algunas funciones como alerts necesitan punto y coma (;) al final, o es antes de definir una variable
\\ 7) Si no se manda un argumento llega una cadena vacia
\\ 8) Los argumentos se separan con espacio y se mandan tal cual por los parametros
\\ 9) los argumentos llegan en una variable args entre mayor y menor que
\\ 10) El nombre del método envolvente (wrap) puede tener o no nombre (función anónima)
\\ 11) Hay varias formas de utilizar javascript dependiendo del contexto
\\ */
\\ var vid =content.document.getElementById("movie_player");
\\ var sStatus=vid.getPlayerState();
\\ if (sStatus == -1) {
\\ /* alert ("Video has not started."); */
\\ vid.playVideo()
\\ }
\\ else if (sStatus == 0){
\\ /* alert ("Video has ended."); */
\\ vid.playVideo()
\\ }
\\ else if (sStatus == 1){
\\ /* alert ("Video is playing."); */
\\ vid.pauseVideo()
\\ }
\\ else if (sStatus == 2){
\\ /* alert ("Video is paused."); */
\\ vid.playVideo()
\\ }
\\ else if (sStatus == 3){
\\ /* alert ("Video is buffering."); */
\\ vid.playVideo()
\\ }
\\ else if (sStatus == 5){
\\ /* alert ("Video is cued."); */
\\ vid.playVideo()
\\ }
\\ })()
nmap <A-S-t> :youtubetogglevideo <CR>
command! youtubefullscreenvideo -description "Request FullScreen Youtube Video" -js <<EOF
/*
Request FullScreen YouTube Video Player
*/
var vid =content.document.getElementById("movie_player");
/* Once the user clicks a custom fullscreen button */
if (vid.requestFullScreen) {
vid.requestFullScreen();
} else if (vid.mozRequestFullScreen) {
vid.mozRequestFullScreen();
} else if (vid.webkitRequestFullScreen) {
vid.webkitRequestFullScreen();
}
EOF
nmap <A-S-f> :youtubefullscreenvideo <CR>
"Press yt to view a YouTube video as fullscreened within the window (Embeded)
map yt -js dactyl.open( String.replace(buffer.URL, /watch/, "watch_popup"))