.vimperatorrc
author Shingo W. Kagami
Sun, 20 Feb 2011 15:29:53 +0900
changeset 20 d9bc81689061
parent 18 136028f70fa4
child 21 15ed806d9209
permissions -rw-r--r--
Add a new visible bell style.
     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: 'datestr',  custom: function() {
    66        return '[' +  content.location.href.match(/\d\d\d\d-\d\d-\d\d-\d+/) + ']';
    67    }},
    68 ];
    69 })();
    70 EOM
    71 
    72 " plugin/feedSomeKeys.js
    73 autocmd LocationChange .* :fmapc
    74 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 
    75 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>
    76 
    77 "js <<EOF
    78 "autocommands.add('LocationChange',/reader\.livedoor\.com\/reader\//,
    79 "  'js plugins.feedKey.setup("j k s a p v c <Space> <S-Space> z Z < > q w b i".split(/ +/));');
    80 "autocommands.add('LocationChange',/mail\.google\.com\/mail\//,
    81 "  'js plugins.feedKey.setup("j k p n e u o / <C-c>".split(/ +/));');
    82 "EOF
    83 
    84 echo ".vimperatorrc loaded."