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