aboutsummaryrefslogtreecommitdiff
path: root/pentadactyl/.pentadactylrc
blob: 65312fab8efd60719723a28be695e0a7d9185ea8 (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
68
loadplugins '\.(js|penta)$'
group user

set guioptions=Cs
set hintkeys=0123456789

map -b j 5j
map -b k 5k

hi clear

hi s_greenfont     color:#aadb0f;
hi s_palegreenfont color:#909737;
hi s_grayback      background:#161616;
hi s_normal        font-size:16px; font-family:Fantasque Sans Mono;

hi -link=s_normal,s_grayback,s_palegreenfont Normal                                   border-top:1px solid #909737;
hi -link=s_normal,s_grayback,s_palegreenfont StatusLine
hi -link=s_normal,s_grayback,s_palegreenfont StatusLineNormal
hi -link=s_normal,s_grayback,s_palegreenfont StatusLineBroken
hi -link=s_normal,s_grayback,s_palegreenfont StatusLineExtended
hi -link=s_normal,s_grayback,s_palegreenfont StatusLineSecure
hi -link=s_normal,s_grayback,s_palegreenfont CompTitle
hi                                           CompTitleSep                             background:#909737;height:1px;
hi                                           Comp                                     border:0;margin:0;
hi -link=s_normal,s_grayback,s_palegreenfont CompItem
hi -link=s_normal,s_grayback,s_palegreenfont CompItem[selected]                       background:#909737;color:#161616;
hi -link=s_normal,s_palegreenfont            CompItem:nth-child(2n+1)                 background:#121212;
hi -link=s_normal,s_grayback,s_palegreenfont CompItem:nth-child(2n+1)[selected]       background:#909737;color:#161616;

hi -link=s_normal,s_greenfont,s_grayback     Hint                                     font-weight:bold; padding:2px;
hi                                           HintElem                                 background:#a5a5a5;
hi                                           Hint[active]                             background:#aadb0f;color:#161616;
hi                                           HintActive                               background:#aadb0f;

command! reader -js <<EOF
if ( buffer.URL.spec.startsWith('about:reader?') ) {
	dactyl.execute('back')
} else {
	dactyl.open('about:reader?url=' + encodeURIComponent(buffer.URL.spec))
}
EOF
map -builtin -ex <F9> :reader

command! push2inbox -js <<EOF
var selection = content.getSelection().toString();
var entry     = '\* ' + buffer.URL;

if ( selection ) {
	entry += '\\n\\t\* ' + selection;
} else if ( content.document.title ) {
	entry += '\\n\\t\* ' + content.document.title;
}

dactyl.execute('!echo -e "' + entry + '" >> ~/note/src/web/inbox.wiki');
EOF
nmap b :push2inbox<CR>

command! cite -js <<EOF
var entry = '\\n'
          + '\ \ \ \ \[...\] ' + content.getSelection().toString() + ' \[...\]\\n'
          + '\ \ \ \ \<br\/\>\<br\/\>\\n'
          + '\ \ \ \ ― ' + buffer.URL
          + '\\n';

dactyl.execute('!echo -e "' + entry + '" >> ~/note/src/web/inbox.wiki');
EOF
nmap c :cite<CR>