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