-
Notifications
You must be signed in to change notification settings - Fork 16
/
.pentadactylrc
94 lines (73 loc) · 2.37 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
"1.0rc1
loadplugins '\.(js|penta)$'
group user
map -count -modes=n,v <A-h> -builtin <count>:tabNext<CR>
map -count -modes=n,v <A-l> -builtin <count>:tabnext<CR>
map -count -modes=n,v <S-j> -builtin <count>:tabNext<CR>
map -count -modes=n,v <S-k> -builtin <count>:tabnext<CR>
map -count -modes=n,v <A-Left> -builtin <count>:tabNext<CR>
map -count -modes=n,v <A-Right> -builtin <count>:tabnext<CR>
" Move faster
nmap -builtin j 3j
nmap -builtin k 3k
" Open help in new tab
set newtab='help'
" Only show tab line when there are multiple tabs
set showtabline=multitab
" Multiple URLs are comma-separated
set urlseparator=', '
nmap -builtin <bs> <nop>
set defsearch=duckduckgo
set hlfind
nmap -builtin ,<space> <esc>:noh<CR>
silent bma -tags searchengine -title 'Google Translate' http://translate.google.com/#auto|fr|%s -k 'Google Translate'
" Smarter 'd' key
if config.OS.isMacOSX
nmap d <M-w>
else
nmap d <C-w>
end
colorscheme vimium
" workaround for github command bar
set passkeys+=github.com:<Return>
autocmd LocationChange 'elas\.tc\/console/' :normal! <C-z>
if config.OS.isMacOSX
set editor='/Applications/MacVim.app/Contents/MacOS/Vim -g -f +<line> +"sil! call cursor(0, <column>)" <file>'
end
autocmd Fullscreen .* :set guioptions+=s
" URL based filetype detection in external editor
" http://ingo-karkat.de/blog/2012/05/22/Pentadactyl%20set%20filetype%20in%20external%20Vim%20editor%20based%20on%20URL.html
Imap -builtin <C-i> -javascript editExternallyWithFiletype()
javascript <<EOF
function editExternallyWithFiletype() {
var save_editor = options["editor"];
var filetype = editExternallyFiletype();
if (filetype) {
options["editor"] += " \"+setf " + filetype + "\"";
}
editor.editFieldExternally();
options["editor"] = save_editor;
}
function editExternallyFiletype() {
var host = buffer.URL.host
switch(host.replace(/^www\./, "")) {
case "github.com":
if (! buffer.URL.path.match("/wiki/"))
return "markdown";
case "mail.google.com":
return "mail";
}
if (host.match(/.*\.wikia\.com$/) || host.match(/.*\.wikipedia\.org$/))
return "mediawiki";
}
EOF
nmap r :smartReload<CR>
" smart reload
command! smartReload
\:javascript <<EOF
\if (buffer.URL.spec.indexOf('#') >= 0)
\ dactyl.execute("reload");
\else
\ dactyl.open(buffer.URL.spec);
\EOF
" vim: set ft=pentadactyl: