56 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			56 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
set runtimepath=~/etc/vimperator
 | 
						|
 | 
						|
set gui=none,tabs
 | 
						|
"set tabnumbers
 | 
						|
 | 
						|
set defsearch=g
 | 
						|
 | 
						|
" follow hints on return
 | 
						|
set followhints=1
 | 
						|
 | 
						|
" don't auto-focus input fields
 | 
						|
set focuscontent
 | 
						|
 | 
						|
set incsearch hlsearch
 | 
						|
set ignorecase smartcase
 | 
						|
 | 
						|
set noerrorbells novisualbell
 | 
						|
js liberator.beep = function() { return false; }
 | 
						|
 | 
						|
map d :tabclose<CR>
 | 
						|
 | 
						|
" google
 | 
						|
map s og<Space>
 | 
						|
map S tg<Space>
 | 
						|
 | 
						|
" fast scrolling
 | 
						|
noremap j <Down>
 | 
						|
noremap k <Up>
 | 
						|
 | 
						|
let g:wallabag_url="https://wllbg.gebner.org"
 | 
						|
 | 
						|
js <<EOM
 | 
						|
googleTranslate = function() {
 | 
						|
  let getParameterByName = function(url, name) {
 | 
						|
      let name = name.replace(/[\[]/, '\\\[').replace(/[\]]/, '\\\]');
 | 
						|
      let regexS = '[\\?&]' + name + '=([^&#]*)';
 | 
						|
      let regex = new RegExp(regexS);
 | 
						|
      let results = regex.exec(url);
 | 
						|
      if (results == null)
 | 
						|
          return '';
 | 
						|
      else
 | 
						|
          return decodeURIComponent(results[1].replace(/\+/g, ' '));
 | 
						|
  };
 | 
						|
  if (buffer.URL.startsWith('http://translate.google.com/')) {
 | 
						|
      liberator.open(getParameterByName(buffer.URL, 'u'));
 | 
						|
  } else {
 | 
						|
      liberator.open('http://translate.google.com/translate?hl=en&sl=auto&tl=en&u=' + encodeURIComponent(buffer.URL));
 | 
						|
  }
 | 
						|
}
 | 
						|
EOM
 | 
						|
command! translate js googleTranslate();
 | 
						|
 | 
						|
" FIXME: doesn't work?
 | 
						|
loadplugins
 | 
						|
fmaps -u='https://reader.gebner.org/' fr u <C-Up> <C-Down> <Up> <Down>
 |