.vimperatorrc
author Shingo W. Kagami
Sat, 13 Feb 2010 12:07:00 +0900
changeset 14 16fe27af1a8b
parent 12 2840d13cb173
child 18 136028f70fa4
permissions -rw-r--r--
Use content object in copy.js templates.
     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 
    14 inoremap <C-v>  <C-v><C-v>
    15 inoremap <C-q>  <C-v>
    16 cnoremap <C-v>  <C-v><C-v>
    17 cnoremap <C-q>  <C-v>
    18 cmap <Up> <S-TAB>
    19 cmap <Down> <TAB>
    20 
    21 javascript <<EOM
    22 (function(){
    23  var feedPanel = document.createElement('statusbarpanel');
    24  var feedButton = document.getElementById('feed-button');
    25  feedPanel.setAttribute('id','feed-panel-clone');
    26  feedPanel.appendChild(feedButton.cloneNode(true));
    27  feedButton.parentNode.removeChild(feedButton);
    28  document.getElementById('status-bar').insertBefore(feedPanel,document.getElementById('security-button'));
    29 })();
    30 EOM
    31 
    32 
    33 " plugin/ime_controller.js 
    34 let g:ex_ime_mode = "inactive"
    35 let g:textarea_ime_mode = "inactive" 
    36 
    37 " plugin/copy.js
    38 map ,c :copy <SPC>
    39 javascript <<EOM
    40 (function(){
    41 function get_tus(w, d) {
    42     var t = content.document.title;
    43     var u = content.location.href;
    44     var s = content.window.getSelection().getRangeAt(0).toString();
    45     return [t, u, s];
    46 }
    47 liberator.globalVariables.copy_templates = [
    48    { label: 't',         value: '%TITLE%' },
    49    { label: 'tu',        value: '%TITLE% - %URL%' },
    50    { label: 'asin', custom: function(){
    51        return content.document.getElementById('ASIN').value;
    52    }}, 
    53    { label: 'wiki', custom: function() {
    54        var [t, u, s] = get_tus(window, document);
    55        s = s.replace(/\n/, "\n> ");
    56        return t + "\n- " + u + (s? ("\n> " + s): '');
    57    }},
    58    { label: 'my',  custom: function() {
    59        var [t, u, s] = get_tus(window, document);
    60        s = s.replace(/\n/, "\n  ");
    61        return t + ":\n  - " + u + (s? ("\n  >>\n  " + s + "\n  <<"): '');
    62    }},
    63    { label: 'datestr',  custom: function() {
    64        return '[' +  content.location.href.match(/\d\d\d\d-\d\d-\d\d-\d+/) + ']';
    65    }},
    66 ];
    67 })();
    68 EOM
    69 
    70 " plugin/feedSomeKeys.js
    71 autocmd LocationChange .* :fmapc
    72 js <<EOF
    73 autocommands.add('LocationChange',/reader\.livedoor\.com\/reader\//,
    74   'js plugins.feedKey.setup("j k s a p v c <Space> <S-Space> z Z < > q w b i".split(/ +/));');
    75 autocommands.add('LocationChange',/mail\.google\.com\/mail\//,
    76   'js plugins.feedKey.setup("j k p n e u o / <C-c>".split(/ +/));');
    77 EOF
    78 
    79 echo ".vimperatorrc loaded."