forked from livibetter/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pentadactylrc
144 lines (127 loc) · 5.06 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
colorscheme dactyLgray
set defsearch=g
set editor="urxvt -name vimp-ext-editor -e vim"
" Remove all key mappings (1.0b7pre+) as mapclear in Vimperator and older
" versions.
unmap!
" guioptions!=s controls and options.showtabline control all windows, not what
" I need. I need to control each individually.
map <silent> <C-F8> :js toggle_toolbar('addon-bar');<CR>
map <silent> <S-F8> :js toggle_toolbar('TabsToolbar');<CR>
map <silent> <F8> :js toggle_toolbars(['PersonalToolbar', 'nav-bar', 'toolbar-menubar']);<CR>
" Tab order rearragement
map <silent> <C-S-PageUp> :tabm -1<CR>
map <silent> <C-S-PageDown> :tabm +1<CR>
" I hate when I want to press <C-w> but I hit q instead
map <C-q> <Nop>
" Toggle app tab
map <C-A-a> :pintab!<CR>
" Grooveshark
map gsn :js if((gs = gBrowser.tabs[0].linkedBrowser.contentWindow.wrappedJSObject.Grooveshark) != undefined) gs.next();<CR>
map gsp :js if((gs = gBrowser.tabs[0].linkedBrowser.contentWindow.wrappedJSObject.Grooveshark) != undefined) gs.togglePlayPause();<CR>
" Clean up all auto commands
autocmd!
js <<EOF
window.toggle_toolbar = function(id) {
var tb = document.getElementById(id);
if (tb._visible === undefined)
tb._visible = id == 'addon-bar' || id == 'TabsToolbar';
tb._visible = !tb._visible;
window.setToolbarVisibility(tb, tb._visible);
}
window.toggle_toolbars = function(ids) {
for (var i in ids)
window.toggle_toolbar(ids[i]);
}
window.one_unpinned_tab = function(event) {
for (idx in gBrowser.tabs) {
var tab = gBrowser.tabs[idx];
if (!tab.pinned && !tab.closing) {
return;
}
}
gBrowser.addTab('about:blank');
}
gBrowser.mTabContainer.addEventListener('TabClose', one_unpinned_tab, false);
gBrowser.mTabContainer.addEventListener('TabPinned', one_unpinned_tab, false);
EOF
:if config.profileName == "Normal"
" Enter passthrough mode automatically in Gmail, Reader, and GrooveShark
au LocationChange (mail|groups)\.google\.com normal! <C-z>
au LocationChange www\.google\.com\/reader\/ normal! <C-z>
au LocationChange code\.google\.com\/p\/[a-z0-9-]+\/issues\/ normal! <C-z>
au LocationChange github\.com\/[a-zA-Z]+\/[a-zA-Z0-9-]+\/(issues|network) normal! <C-z>
au LocationChange grooveshark\.com normal! <C-z>
" Enter Insert mode
au LocationChange docs\.google\.com :normal gi
" Auto reload
au PageLoad tw\.finance\.yahoo.com\/pf\/mypf js (function(){var t=getBrowser().tabs[<tab>-1];if (!t.pinned) getBrowser().pinTab(t);window.setTimeout(function(){getBrowser().reloadTab(t)},60000)})()
"
" Auto-pin
au PageLoad grooveshark.com js (function(){ var b = getBrowser(); var t = b.tabs[<tab>-1]; b.pinTab(t);})()
au PageLoad about:blank js tabs.getTab(<tab>-1).linkedBrowser.contentDocument.body.style.backgroundColor = "#333";
" PageLoad isn't fired when browser is launched
:if getBrowser().contentDocument.location.href == 'about:blank'
js getBrowser().contentDocument.body.style.backgroundColor = "#333";
:endif
" The following line is simple but has problem with Blogger post editor, it
" causes the background color of editor becomes #333.
" style -name blank about:blank body { background-color: #333 !important }
:elif config.profileName == "Test"
" Make command line red
js <<EOF
for ([k, v] in Iterator(highlight))
highlight.set(k, highlight.get(k).value.replace('background: #333', 'background: #633'));
EOF
au PageLoad about:blank js tabs.getTab(<tab>-1).linkedBrowser.contentDocument.body.style.backgroundColor = "#633";
" PageLoad isn't fired when browser is launched
:if getBrowser().contentDocument.location.href == 'about:blank'
js getBrowser().contentDocument.body.style.backgroundColor = "#633";
:endif
source '~/.pentadactyl-Test.rc'
:endif
" Styles
" fix gmail doesn't have readable monospace theme, Terminal uses Courier New which is horrible to read.
" fix groups, it is... ahm... never mind.
style mail.google.com,groups.google.com -name google-monospace * { font-family: 'Envy Code R' !important }
" fix Google+ annoyance
style .*.google.com/.* <<EOF
/* below black top bar, in gray area */
#gbvg > ol.gbtc > li.gbt:nth-child(2),
#gbvg > ol.gbtc > li.gbt:nth-child(3) {
display: none !important;
}
/* in the black top bar */
#gbg > ol.gbtc > li.gbt:nth-child(2),
#gbg > ol.gbtc > li.gbt:nth-child(3),
#gbg > ol.gbtc > li.gbt:nth-child(4),
#gbg > ol.gbtc > li.gbt:nth-child(5) {
display: none !important;
}
EOF
" fix Blogger template editing
style draft.blogger.com textarea[kind=change] { font-family: 'Envy Code R' !important; }
" get rid of clickTrap of Blogger post writing preview
style blog.yjl.im div.blogger-clickTrap { display: none }
" maximize Labels popup in Blogger
style http://draft.blogger.com/blogger.g* <<EOF
div.blogg-menu-popup {
left: 0 !important;
}
div[role="listbox"] {
max-width: none !important;
}
div[role="listbox"] > div > div {
display: inline-block;
}
EOF
" maximize Labels popup in Google Reader
style https://www.google.com/reader/view/* <<EOF
.subscription-folders-menu {
left: 0 !important;
}
.subscription-folders-menu div[role="menuitem"] {
display: inline-block;
}
EOF
" vim: sts=2:sw=2:et:ai:smarttab