-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimperatorrc
121 lines (99 loc) · 3.3 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
set hintchars="jfkdls;ahgnvurieow"
set incsearch
set hlsearch
set showstatuslinks=1
" Override ignorecase if pattern has uppercase chars
set smartcase
" Show numbers for tabs
" set tabnumbers
" Ex commands output in a new tab by default (prefs, addons...)
set newtab=all
"source ~/.vimperatorrc.js
source ~/.vimperator_commands
command! rc :source ~/.vimperatorrc
command! rce :! gvim ~/.vimperatorrc
map <C-m><C-m> :emenu<SPACE>
" M-Up toggles the navigation and bookmarks toolbars
map <A-Up> :set toolbars=invnavigation,invbookmarks,invmenu,invtabs<CR>
map <C-c><C-a> :set toolbars=invnavigation,invbookmarks,invmenu,invtabs<CR>
map <C-c><C-m> :set toolbars=invmenu<CR>
map <C-c><C-t> :set toolbars=invtabs<CR>
map <C-c><C-n> :set toolbars=invnavigation<CR>
map <C-c><C-b> :set toolbars=invbookmarks<CR>
" Select
map sb :bmarks<SPACE>
map sh :history<SPACE>
map st :buffers<SPACE>
map sj :jumps<SPACE>
" Sidebar selection with s, close with S
map ss :sidebar<SPACE>
map sx :sbclose<CR>
" Restart with C-c C-r
map <C-c><C-r> :restart<CR>
" Tab moving helpers
command! tm :tabmove<SPACE>
map <A-Left> :tabmove! -1<CR>
map <A-Right> :tabmove! +1<CR>
command! d :tabduplicate<CR>
map J <C-PageDown>
map K <C-PageUp>
nnoremap <C-b> :sidebar bookmarks<CR>
nnoremap gh :backt<CR>
nnoremap gl :forwardt<CR>
command! backt -description "Duplicate tab and go back in the browser history" :js backt();
:js <<EOF
backt = function() {
var currT = gBrowser.selectedTab;
var dupT = gBrowser.duplicateTab(currT);
var dupTB = gBrowser.getBrowserForTab(dupT);
var backtListener = function () {
gBrowser.goBack();
dupTB.removeEventListener("DOMContentLoaded", backtListener);
};
dupTB.addEventListener("DOMContentLoaded", backtListener);
gBrowser.selectedTab = dupT;
}
EOF
command! forwardt -description "Duplicate tab and go forward in the browser history" :js forwardt();
:js <<EOF
forwardt = function() {
var currT = gBrowser.selectedTab;
var dupT = gBrowser.duplicateTab(currT);
var dupTB = gBrowser.getBrowserForTab(dupT);
var forwardtListener = function () {
gBrowser.goForward();
dupTB.removeEventListener("DOMContentLoaded", forwardtListener);
};
dupTB.addEventListener("DOMContentLoaded", forwardtListener);
gBrowser.selectedTab = dupT;
}
EOF
command! reloadPlugins :js liberator.pluginFiles = {}; liberator.loadPlugins();
" -------------------------------------------------------------------------------
" ,------------------------------,
" | Close All Tabs to Right/Left |
" '------------------------------'
js <<EOF
closeAllToRight = function () {
var current = tabs.getTab();
var currentIx = tabs.index(current);
var nexttab = current.nextElementSibling;
var N = tabs.count;
var numToClose = N - (currentIx + 1);
tabs.remove(nexttab, numToClose);
}
closeAllToLeft = function () {
var current = tabs.getTab();
var currentIx = tabs.index(current);
var firsttab = tabs.getTab(0);
var N = tabs.count;
var numToClose = currentIx;
tabs.remove(firsttab, numToClose);
}
EOF
" close tabs to left
map x< :js closeAllToLeft()<CR>
" close tabs to right
map x> :js closeAllToRight()<CR>
command! closealltoright :js closeAllToRight()
command! closealltoleft :js closeAllToLeft()