Vimperator recommended setting
Asked Answered
A

8

19

By way of study of Vim, I have begun to use Vimperator add-on for Firefox recently.

Therefore please teach it if there is recommended setting.

Affiance answered 22/6, 2009 at 8:33 Comment(1)
Voting to close as too broad.Tabernacle
R
10

Two settings are extremely useful, at least for me:

:set wildoption=auto
:set cpt=l

You can try them from vimperator command line first. After you type in the first one, you will see dynamic hints immediately, for example, if you continue to try the second command and to see what mean by 'l' . With wildoption on, you access to an item from the hint list by pressing Tab key, instead of arrow keys which would not work in most cases.

Another one I like is to set up my Bookmarks as sidebar by default, the command is:

:sidebar Bookmarks

One more trick after you have wildoptions on, you can access to FireFox menu items by typing:

:emenu [key_word]
# or
:em[tab]

where key_word is any menu key word such as Add-on.

I have several blogs on vimperator and how to set vimperator default settings.

Enjoy Vimperator. It is a great add-on for Firefox.

Remains answered 25/2, 2010 at 23:7 Comment(4)
wildoption doesn't seem to exist in my v3.7.Spermiogenesis
I suspect he means wildmodeDaron
there is no auto for wildmodeGuajardo
I'm using Vimperator v3.9 and it seems to be set wildmode autocomplete for me.Lorikeet
B
6

Skypecakes suggested b and B to switch tabs; I prefer using h and l, since there's a good chance you switch tabs more often than you scroll horizontally:

noremap l gt
noremap h gT

Calling up Vim itself with C-i in a textarea is a must. See here if you have trouble on Windows

set editor="C:/path/to/gvim.exe -f"

This is to customize how hints look in .vimperatorrc. The syntax is CSS, but you can probably figure it out without knowing it as well (I personally increase the font-size):

highlight! Hint font-family: monospace; font-size: 16px; font-weight: bold; text-transform: uppercase; color: white; background-color: red; border-color: ButtonShadow; border-width: 0px; border-style: solid; padding: 0px 1px 0px 1px;

Finally, if you set the working directory you can save URLs to that location with a simple :w<Enter>:

cd C:/Users/GGustafson/Desktop
Boogiewoogie answered 17/12, 2013 at 18:43 Comment(0)
M
4

Not really. One of the remarkable characteristics of Vim (and Vimperator) is providing a pretty decent experience with the default configuration. What I would suggest you to do is to play around with macros (q) and hinting (f), the best, IMHO, features of Vimperator.

There are numerous examples of interesting macros, being my favourite the one that opens all the images on all tabs, each expanding into a new tab with the corresponding images. Try to write it! You'll need just markers and some javascript similar to Pornzilla's "Linked Images"

Mcloughlin answered 5/10, 2009 at 14:10 Comment(0)
E
4

I'm using Pentadactyl - which is almost the same. I find useful the following two options:

set hintkeys=0123456789abcdefghijklmnopqrstuvwxyz
set! browser.tabs.closeButtons=2

Also - suppose Your FireFox aware of wikipedia search - and suppose it is called wikipedia-en. Then here's a way to bind search selection in wikipedia to a key:

javascript <<EOF
     dactyl.mulSearch = function () {
         let selection = content.getSelection().toString();
         dactyl.execute(":tabopen wikipedia-en " + selection);
     };
EOF

:map s -js dactyl.mulSearch();

(You should put this to ~/.pentadactylrc) This search selection after You'll press s. This way You can also bind other search engines - to the same key!

Edit:

" default place for downloads:
cd ~/dwn

" lots of hints!
set hintkeys=0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ

" no close buttons on tabs
set! browser.tabs.closeButtons=2

" May be default hints would suit You better - but they were to small for me:
:highlight Hint font:"DejaVu Sans Mono";font-size:120%;color:red;background-color:yellow;padding:2px;

" to prevent d on the last tab from closing the window:
:set! browser.tabs.closeWindowWithLastTab=false

" encripted google - is better for hints (it has less links)
:bmark https://encrypted.google.com/search?sclient=psy&hl=en&complete=0&site=webhp&source=hp&q=%s -keyword google
set defsearch=google


" ==================
"" Cyrillic letters:

map Ф A
map И B
map С C
map В D
map У E
map А F
map П G
map Р H
map Ш I
map О J
map Л K
map Д L
map Ь M
map Т N
map Щ O
map З P
map Й Q
map К R
map Ы S
map Е T
map Г U
map М V
map Ц W
map Ч X
map Н Y
map Я Z
map ф a
map и b
map с c
map в d
map у e
map а f
map п g
map р h
map ш i
map о j
map л k
map д l
map ь m
map т n
map щ o
map з p
map й q
map к r
map ы s
map е t
map г u
map м v
map ц w
map ч x
map н y
map я z
Entwine answered 10/8, 2011 at 11:59 Comment(2)
Woops! Perhaps I'll never develop a habit of re-reading my writings!Entwine
hintkeys doens't appear to work in Vimperator. Instead it's like this: set hintchars=asdfjk;l1234567890 (to set the home keys and numbers as the hint characters).Spermiogenesis
T
2

I made some small changes. Made moving between tabs a single keystroke instead of two, since it is the most common thing I do next to clicking links and scrolling.

Also show visual indicator instead of beeping, and show the destination of the selected hyperlink in the command line instead of the status line, so that I can still see the URL of the current page at all times.

From my _vimperatorrc file:

" Mappings
map b gt
map B gT
map a B

" Options
set visualbell
set complete=hbsf
set showstatuslinks=2
Tick answered 6/1, 2010 at 19:18 Comment(0)
D
0

I also use Pentadactyl, but the below should work with Vimperator as well. I added several commands to enable searching through different sites like DuckDuckGo and stackoverflow.

You can add a new search engine with the following command:

:display searchengines

Add the stackoverflow search engine to make the below work.

Define a new command stack to search through stackoverflow:

:command -nargs=* stack open stack-overflow <args>

Now you can search through stackoverflow to get all vimperator related questions with the following command:

:stack vimperator

Make sure to issue

:mkpentadactylrc!

to make the command available after a restart of Firefox.

Duple answered 4/12, 2011 at 0:56 Comment(0)
S
0
"eval script in tabs
js <<EOF
function ExecScriptInTabs(filter,domjs){
     tabs.allTabs.forEach(function(itm){
    var ctab=gBrowser.getBrowserForTab(itm);
    if(filter(ctab)){
        var s=ctab.contentDocument.createElement('script')
        s.textContent=domjs;
        ctab.contentDocument.body.appendChild(s);
    }
     })
}
EOF

then you can mapping what you want

group.mappings.add(
[modes.NORMAL],
[",ds"],"skip",
function(){
ExecScriptInTabs(function(ctab){
return ctab.contentDocument.location.host.match("douban\.fm");
},"DBR.act('skip')");//skip,pause,love
}
)
Soneson answered 19/3, 2012 at 17:33 Comment(0)
V
0

If you want to save session when using Alt+F4 or qall command

Add following line to your ~/.vimperatorrc

command! qall xall
Valval answered 20/2, 2016 at 10:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.