.vimperatorrc
author Shingo W. Kagami
Fri, 10 Feb 2012 03:41:30 +0900
changeset 25 ddae43088f41
parent 23 d82f8c4f1fad
permissions -rw-r--r--
Defaults to UTF-8.
Shingo@12
     1
set guioptions+=mT
Shingo@12
     2
set titlestring=Firefox
Shingo@12
     3
set hlsearch
Shingo@12
     4
set wildoptions=auto
Shingo@12
     5
set complete=sl
Shingo@12
     6
set visualbell
Shingo@20
     7
highlight Bell display: none;
Shingo@18
     8
"set visualbellstyle=display:none;
Shingo@12
     9
set showstatuslinks=2
Shingo@12
    10
Shingo@12
    11
map <C-c> Y
Shingo@12
    12
map <C-9> :tablast<CR>
Shingo@12
    13
map ,R :source ~/.vimperatorrc
Shingo@18
    14
map d <C-w>
Shingo@24
    15
map ,h ohb<CR>
Shingo@12
    16
Shingo@12
    17
inoremap <C-v>  <C-v><C-v>
Shingo@12
    18
inoremap <C-q>  <C-v>
Shingo@12
    19
cnoremap <C-v>  <C-v><C-v>
Shingo@12
    20
cnoremap <C-q>  <C-v>
Shingo@12
    21
cmap <Up> <S-TAB>
Shingo@12
    22
cmap <Down> <TAB>
Shingo@12
    23
Shingo@12
    24
javascript <<EOM
Shingo@12
    25
(function(){
Shingo@12
    26
 var feedPanel = document.createElement('statusbarpanel');
Shingo@12
    27
 var feedButton = document.getElementById('feed-button');
Shingo@12
    28
 feedPanel.setAttribute('id','feed-panel-clone');
Shingo@12
    29
 feedPanel.appendChild(feedButton.cloneNode(true));
Shingo@12
    30
 feedButton.parentNode.removeChild(feedButton);
Shingo@12
    31
 document.getElementById('status-bar').insertBefore(feedPanel,document.getElementById('security-button'));
Shingo@12
    32
})();
Shingo@12
    33
EOM
Shingo@12
    34
Shingo@12
    35
Shingo@12
    36
" plugin/ime_controller.js 
Shingo@12
    37
let g:ex_ime_mode = "inactive"
Shingo@12
    38
let g:textarea_ime_mode = "inactive" 
Shingo@12
    39
Shingo@12
    40
" plugin/copy.js
Shingo@18
    41
map ,c :copy<Space>
Shingo@12
    42
javascript <<EOM
Shingo@12
    43
(function(){
Shingo@12
    44
function get_tus(w, d) {
Shingo@14
    45
    var t = content.document.title;
Shingo@14
    46
    var u = content.location.href;
Shingo@14
    47
    var s = content.window.getSelection().getRangeAt(0).toString();
Shingo@12
    48
    return [t, u, s];
Shingo@12
    49
}
Shingo@12
    50
liberator.globalVariables.copy_templates = [
Shingo@12
    51
   { label: 't',         value: '%TITLE%' },
Shingo@12
    52
   { label: 'tu',        value: '%TITLE% - %URL%' },
Shingo@12
    53
   { label: 'asin', custom: function(){
Shingo@12
    54
       return content.document.getElementById('ASIN').value;
Shingo@12
    55
   }}, 
Shingo@12
    56
   { label: 'wiki', custom: function() {
Shingo@12
    57
       var [t, u, s] = get_tus(window, document);
Shingo@12
    58
       s = s.replace(/\n/, "\n> ");
Shingo@12
    59
       return t + "\n- " + u + (s? ("\n> " + s): '');
Shingo@12
    60
   }},
Shingo@12
    61
   { label: 'my',  custom: function() {
Shingo@12
    62
       var [t, u, s] = get_tus(window, document);
Shingo@12
    63
       s = s.replace(/\n/, "\n  ");
Shingo@12
    64
       return t + ":\n  - " + u + (s? ("\n  >>\n  " + s + "\n  <<"): '');
Shingo@12
    65
   }},
Shingo@23
    66
   { label: 'sc',  custom: function() {
Shingo@23
    67
       var t = content.document.title;
Shingo@23
    68
       var u = content.location.href.replace(/^.+ScrapBook\/data\//, '');
Shingo@23
    69
       return '[sc] &scrapbook(' + t + ',' + u + ');';
Shingo@23
    70
   }},
Shingo@12
    71
   { label: 'datestr',  custom: function() {
Shingo@14
    72
       return '[' +  content.location.href.match(/\d\d\d\d-\d\d-\d\d-\d+/) + ']';
Shingo@12
    73
   }},
Shingo@12
    74
];
Shingo@12
    75
})();
Shingo@12
    76
EOM
Shingo@12
    77
Shingo@12
    78
" plugin/feedSomeKeys.js
Shingo@12
    79
autocmd LocationChange .* :fmapc
Shingo@18
    80
autocmd LocationChange http://(reader\.livedoor\.com|fastladder\.com|0\.0\.0\.0\:3000)/reader/ :fmap j k s a p v c z Z b i r < > o,vj J,<Space> K,<S-Space> q w g u 
Shingo@21
    81
autocmd LocationChange mail\.google\.com/(mail|a)/ :fmap c / j k n p o u e x s r a # [ ] z ? gi gs gt gd ga gc <C-c>
Shingo@18
    82
Shingo@18
    83
"js <<EOF
Shingo@18
    84
"autocommands.add('LocationChange',/reader\.livedoor\.com\/reader\//,
Shingo@18
    85
"  'js plugins.feedKey.setup("j k s a p v c <Space> <S-Space> z Z < > q w b i".split(/ +/));');
Shingo@18
    86
"autocommands.add('LocationChange',/mail\.google\.com\/mail\//,
Shingo@18
    87
"  'js plugins.feedKey.setup("j k p n e u o / <C-c>".split(/ +/));');
Shingo@18
    88
"EOF
Shingo@12
    89
Shingo@21
    90
let g:no_reading_on_statusline = 1
Shingo@21
    91
let g:no_reading_statusline_limit = 2000
Shingo@21
    92
Shingo@12
    93
echo ".vimperatorrc loaded."