forked from hadashiA/dotfiles
/
vimperatorrc
executable file
·153 lines (130 loc) · 4.54 KB
/
vimperatorrc
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
:set toolbars=nomenu,nonavigation,addons,nobookmarks
colorscheme vimplight
set titlestring=Mozilla Firefox 3
set visualbell
"set visualbellstyle=display:none;
set verbose=7
set complete=sl
set defsearch=google
set suggestengines=google
set hlsearch
set history=1000
set activate=homepage,quickmark,tabopen,paste
set hintchars=asdfjklgh
" noremap , :set hintchars=jkl;uiop<CR>f
" noremap f :set hintchars=asdfjkl;<CR>f
noremap j 5<C-e>
noremap k 5<C-y>
noremap J <PageDown>
noremap K <PageUp>
noremap h <A-Left>
noremap l <A-Right>
noremap H gT
noremap L gt
map <Left> <C-p>
map <Right> <C-n>
map <S-Right> :tabmove! +1<CR>
map <S-Left> :tabmove! -1<CR>
"コピー&ペーストなどOSのショートカットが効くように
inoremap <C-a> <C-v><C-a>
inoremap <C-z> <C-v><C-z>
inoremap <C-x> <C-v><C-x>
inoremap <C-c> <C-v><C-c>
inoremap <C-v> <C-v><C-v>
cnoremap <C-a> <C-v><C-a>
cnoremap <C-z> <C-v><C-z>
cnoremap <C-x> <C-v><C-x>
cnoremap <C-c> <C-v><C-c>
cnoremap <C-v> <C-v><C-v>
"LDRize_Cooperationをトグル
map q <esc>:toggleldrc<cr>
"ダイアログ表示してブックマーク追加
map ,a <esc>:dialog addbookmark<cr>
"タブを閉じる(browser_object.js)
map x dd
"Vimperatorからminibufferコマンド
map <C-:> :m<Space>
"Ctrl+rで再起動,Ctrl+hでヘルプ
map <C-r> :restart<CR>
"map <C-h> :help<CR>
"Gmail と Google Reader で使用するキーを設定
" autocmd LocationChange .* :fmapc
" autocmd LocationChange 'mail\.google\.com/mail' :fmap c / j k n p o u e x s r a y # [ ] z ? gi gs gt gd ga gc
" autocmd LocationChange 'www\.google\.com/reader' :fmap! -vkey j k n p m s t v A r S N P X O gh ga gs gt gu / ?
" autocmd LocationChange 'www\.google\.co\.jp/reader' :fmap! -vkey j k n p m s t v A r S N P
" autocmd LocationChange .* :js modes.passAllKeys = /feedly\.com/.test(buffer.URL)
" Plugins
" ===================================================
" ime_controller.js
let g:ex_ime_mode = "inactive"
let g:textarea_ime_mode = "inactive"
" googlesuggest.js
map s :google<Space>
" migemo_hint.js
" set hintmatching=custom
"Appearance Change with StyleChanger.js
let g:styles = "vimperator"
" _smooziee.js
let g:smooziee_scroll_amount="200"
let g:smooziee_scroll_interval="10"
"" hatenabookmark
" https://github.com/hatena/hatena-bookmark-xul/wiki/Vimperator-%E3%81%A7%E3%81%AF%E3%81%A6%E3%81%AA%E3%83%96%E3%83%83%E3%82%AF%E3%83%9E%E3%83%BC%E3%82%AF%E6%8B%A1%E5%BC%B5%E3%82%92%E4%BD%BF%E3%81%86
javascript if (typeof hBookmark != 'undefined') liberator.loadScript('chrome://hatenabookmark/content/vimperator/plugin/hatenabookmark.js', {__proto__: this});
"nnoremap s :hbt<Space>
"nnoremap S :hbtc<Space>
nnoremap s :hbsearch<Space>
nnoremap S :hbtabsearch<Space>
nnoremap m :bmarks<Space>
set complete+=H
"" copy.js
javascript <<EOM
(function () {
function findTextContent(re, e) {
if (!e) e = content.document.body;
var m = e.textContent.match(re);
if (m) return m[0];
for (var i = 0; i < e.children.length; i++) {
var result = arguments.callee(re, e.children[i]);
if (result) return result;
}
return null;
}
liberator.globalVariables.copy_templates = [
{ label: 'titleAndURL', value: '%TITLE%\n%URL%' },
{ label: 'title', value: '%TITLE%', map: ',y' },
{ label: 'anchor', value: '<a href="%URL%">%TITLE%</a>' },
{ label: 'selanchor', value: '<a href="%URL%" title="%TITLE%">%SEL%</a>' },
{ label: 'htmlblockquote', value: '<blockquote cite="%URL%" title="%TITLE%">%HTMLSEL%</blockquote>' },
{ label: 'amazon', value: 'copy clean amazon url from current page',
custom: function() {
var m = content.document.location.pathname.match(/dp\/(\w+)/);
return m ? ('http://amazon.jp/dp/' + m[1]) : null;
}
},
{ label: 'PA', value: 'copy account_id from CMSP', map: ',pa',
custom: function() {
return findTextContent(/PA\d{8}/);
}},
{ label: 'CI', value: 'copy inq ID from CMSP', map: ',ci',
custom: function() {
return findTextContent(/CI\d{8}/);
}},
{ label: 'sinsei', value: 'リリース承認おねがいします。>カラーミー開発 %URL%', map: ',xp'},
{ label: 'webistrano', value: 'copy deploy 宣言', map: ',we',
custom: function() {
var title = content.document.title;
var proj = '',
stage = '',
m;
if (m = title.match(/Project\s+(.+?)\s*?-/)) {
proj = m[1];
}
if (m = title.match(/[^-]+?$/)) {
stage = m[0];
}
return proj + " " + stage + " デプロイします。";
}
}
];
})();
EOM