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