-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.pentadactylrc
140 lines (129 loc) · 5.22 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
" <C-H>への対応
"map -builtin <C-H> <BS>
" タブ移動
nmap -builtin <C-1> :b 1<CR>
nmap -builtin <C-2> :b 2<CR>
nmap -builtin <C-3> :b 3<CR>
nmap -builtin <C-4> :b 4<CR>
nmap -builtin <C-5> :b 5<CR>
nmap -builtin <C-6> :b 6<CR>
nmap -builtin <C-7> :b 7<CR>
nmap -builtin <C-8> :b 8<CR>
nmap -builtin <C-9> :b 9<CR>
nmap -builtin <C-0> :b 10<CR>
" コマンドライン
cmap -builtin <C-p> <Up>
cmap -builtin <C-n> <Down>
cmap -builtin <C-f> <Right>
cmap -builtin <C-b> <Left>
cmap -builtin <C-a> <Home>
cmap -builtin <C-e> <End>
cmap -builtin <C-h> <BS>
cmap -builtin <A-f> <C-Right>
cmap -builtin <A-b> <C-Left>
" マッピング
map -builtin m :mark
" タブグループ
"nmap -builtin <C-;> <C-`>
"nmap -builtin <C-'> <C-S-`>
" タブ切り替え
nmap -builtin # :b #<CR>
" メール表示
nmap -builtin <C-m> :buffer mail<CR>
"
set go-=br
set go+=T
" スクロール量
set scroll=5
" タブは表示
set showtabline=always
" ヒントに使う文字
set hintkeys=HJKLASDFGYUIOPQWERTNMZXCVB
" GVimへのパス
"set editor=X:/Utilities/vim/gvim.exe
set editor="/Applications/MacVim.app/Contents/MacOS/Vim -g -f"
" ツールバーとタブをトグル
" http://d.hatena.ne.jp/oogatta/20110910/1315653308
"map <C-S-t> :toolbartoggle ナビゲーションツールバー<CR>
" タブをトグル
"map <C-t> :se stal!=always,never<CR>
" Gmail 対応
"set passkeys+=mail.google.com:'!#*+-./<C-Down><C-s><Enter>?INU[]acefjk lmnopqrsuvxyz',*a,*n,*r,*s,*t,*u,ga,gc,gd,gi,gl,gs,gt,yo
" Gmail の方で、転送を w|W に、ゴミ箱へ移動を $ に変更した。
" ` と ~ を追加
" q を削除
set passkeys+=mail.google.com:'`~!$*+-./<C-Down><C-s><Enter>?INU[]acewjk lmnoprsuvxyz',*a,*n,*r,*s,*t,*u,ga,gc,gd,gi,gl,gs,gt,yo
"set passkeys+=www.google.com/calendar:'kpjnrt12345dwmxace<Backspace><Delete><C-z>z/+q<C-p>s<C-?>?'
set passkeys+=www.google.com/calendar:'kpjnrt12345dwmxace<Backspace><Delete><C-z>z/+s<C-?>?'
" live.com
set passkeys+=live.com:'!#*+-./<C-Down><C-s><Enter>?INU[]acefjk lmnoprsuvxyz',*a,*n,*r,*s,*t,*u,ga,gc,gd,gi,gl,gs,gt,yo
" github.com
set passkeys+='github(?:(?:\.[-a-z\d]+)+|\.com)':'/?LMPceijkloprstuwxy',gc,gi,gn,gp
" github のための代替
nmap <c-t> :tabopen
nmap <c-s> :open google
nmap Y y
" http://vimperator.g.hatena.ne.jp/teramako/20090311/1236776437
" ime-controller.jsの代わり
style -name commandline-ime chrome://* #dactyl-commandline-command input {ime-mode: inactive;}
" カラースキーム
" 参照 : http://d.hatena.ne.jp/tlync/20090222/1235313891
" リンク先のカラースキームファイルを以下のファイル名で保存する。
" $HOME/pentadactyl/colors/vimplight.penta
colorscheme solarized-light
" tab-options-plugin
" http://dactyl.sourceforge.net/pentadactyl/plugins#tab-options-plugin
" タブを開くときはいかなる場合も現在のタブの右側
set tabopen=link:right,orphan:right,external:right
" copy.js
javascript <<EOM
dactyl.globalVariables.copy_templates = [
{ label: 'titleAndURL', value: '%TITLE%\n%URL%', map: ',Y' }
,{ label: 'title', value: '%TITLE%', map: ',y' }
,{ label: 'anchor', value: '<a href="%URL%">%TITLE%</a>', map: ',a' }
,{ label: 'selanchor', value: '<a href="%URL%" title="%TITLE%">%SEL%</a>', map: ',A' }
,{ label: 'markdown', value: '[%TITLE%](%URL% "%TITLE%")', map: ',M' }
,{ label: 'github', value: 'copy commit URL from Github',
custom: function(){
var m = content.document.title.split(' · ');
if (m) {
return '[' + m[0] + '][' + m[1] + ']\n\n[' + m[1] + ']: ' + content.location.href;
} else { return ''; }
}, map: ',C' }
,{ label: 'htmlblockquote', value: '<blockquote cite="%URL%" title="%TITLE%">%HTMLSEL%</blockquote>' }
,{ label: 'htmlblockquote2',
value: '<blockquote>\n<p>%TITLE%<br />\n<a href="%URL%">%URL%</a></p>\n</blockquote>',
map:',q' }
,{ label: 'ASIN', value: 'copy ASIN code from Amazon',
custom: function(){return content.document.getElementById('ASIN').value;} }
];
EOM
" はてなブックマーク
javascript <<JS
if ( typeof window.hBookmark != 'undefined' )
dactyl.loadScript(
'chrome://hatenabookmark/content/vimperator/plugin/hatenabookmark.js',
{__proto__: this} );
JS
" Instapaper
js <<EOF
commands.addUserCommand(['readlater', 'rl'],
'Send current page to Instapaper',
function (args) {
try {
let doc = content.document;
dactyl.assert(doc.body);
doc.title = '(Saving...) ' + doc.title;
doc.body.appendChild(util.xmlToDom( /* instapaper api url */
String('<script type="application/javascript"
src="http://www.instapaper.com/j/gvo5f1niyk"/>'),
doc));
} catch(e) {
dactyl.echoerr('Please wait until the page has loaded. : ' + e);
}
}, {}, true);
EOF
" Hint
hi Hint font-family: "Source Code Pro",monospace; font-size: 13px; padding: 0 0.25em; margin: -0.5em 0 0 -1em; background-color: rgba(240,126,0,0.9); border: 1px rgba(255,125,0,0.9) solid; border-radius: 4px; color: maroon; font-weight: 200;
hi HintElem background-color: #fdffc3; color: #222;
hi HintActive color: black; background-color: #ffdcdc; border: 1px #ef6f6f dotted; border-radius: 3px; padding: 0.1em; font-weight: bold;