forked from kakos/arch-linux-configs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimperatorrc
98 lines (82 loc) · 2.78 KB
/
.vimperatorrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
set defsearch=google
set hlsearch
set complete=l
set followhints=1
set activate=quickmark,paste
set nopreload
" Turn the menu and toolbar on.
set guioptions+=T
" Turn off the show tabs by default.
set showtabline=1
" Allow user to click in address bar.
"set! browser.urlbar.clickSelectsAll=true
"set! browser.urlbar.doubleClickSelectsAll=true
" Map Ctrl + n for new windows
map <C-n> <C-v><C-n>
" Vimperator steals focus from form boxes
noremap <C-k> <C-v><A-d><Tab>
" Map paste operation normally.
"imap <C-v> <C-v>
" awesome bar style hints
set wildoptions=auto
"set cpt=l
" auto pass keys
autocmd LocationChange .* :js modes.passAllKeys = /mail\.google\.com/.test(buffer.URL)
autocmd LocationChange .* :js modes.passAllKeys = /www\.google\.com\/reader\/view/.test(buffer.URL)
" avoid unintended paste
" only use "gP"
noremap p <Nop>
noremap P <Nop>
" restart Vimperator
map <C-r> :restart<CR>
" ==================== Firefox options ==================== "
" disable accesskey
set! ui.key.generalAccessKey=0
" hide close button
set! browser.tabs.closeButtons=2
" open bookmarks in background
set! browser.tabs.loadBookmarksInBackground=true
" open tabs by javascript in background
set! browser.tabs.loadDivertedInBackground=true
" allow lots of popups for ldr
set! dom.popup_maximum=1000
" allow control sidebar position
"set! layout.scrollbar.side=1
" ==================== colorscheme ==================== "
colorscheme mac
"colorscheme evening
" ==================== other tweaks ==================== "
"Make Vimperator use Edit->Copy for "Y"anking
js <<EOF
mappings.addUserMap([modes.NORMAL], ["Y"],
"Yank the currently selected text",
function () {
buffer.getCurrentWord();
events.feedkeys("<C-v>" + (/^Mac/.test(navigator.platform) ? "<M-c>" : "<C-c>"), true);
setTimeout( function () {
liberator.echo("Yanked " + util.readFromClipboard(), commandline.FORCE_SINGLELINE);
}, 20 );
});
EOF
"Show the feed-button, even if the address-bar is not displayed
javascript <<EOF
(function(){
var feedPanel = document.createElement("statusbarpanel");
feedPanel.setAttribute("id", "feed-panel-clone");
feedPanel.appendChild(document.getElementById("feed-button"));
feedPanel.firstChild.setAttribute("style", "padding: 0; max-height: 16px;");
document.getElementById("status-bar")
.insertBefore(feedPanel, document.getElementById("security-button"));
})();
EOF
" ==================== hints ==================== "
js <<EOM
hints.addMode("i", "Focus to input",
function(element) element.focus(),
function() "//input[not(@type='hidden')] | //textarea | //xhtml:input[not(@type='hidden')] | //xhtml:textarea"
);
hints.addMode("h", "Hide element",
function(element) {
element.style.display = "none";
},
function() "//*");