Online video hd

Смотреть узбекский видео

Официальный сайт seoturbina 24/7/365

Смотреть видео бесплатно

alff31 21.07.2010 17:59

Emacsvimperator для emacs пользователей

Для браузера firefox есть замечательный плагин под названием vimperator. Если коротко, то он скрывает меню, адресную строку, и панель закладок и превращает красивый браузер во что-то страшное и ужасное, добавляя снизу черную информационную полоску и командную строчку. После этого приходиться две недели учиться пользоваться браузером, управляя им исключительно клавиатурными сочетаниями. После этого наступает дзен и ты не понимаешь, зачем вообще были нужны все эти кнопочки и меню наверху. Поклонники vimа радуются жизни и прекрасно живут с данным дополнением. Я же лично сам vim недолюбливаю, так как режимы для меня это то, с чем я так и не смог ужиться, набираешь текст, а редактор превращает набор слов с дикое сочетание действий, которое долго приходится отменять, нажимая u. Впрочем пост не о том.

Я, как пользователь Emacs, встретив этот плагин, искал альтернативу, что-то вроде emacserator. :) Однако вменяемой альтернативы так и не нашёл, так и пользовался vimperator-ом.

И вот на днях наткнулся на конфиг файл Adrian C. (anrxc), который адаптировал vimperator для emacs пользователей.

Навигация по странице


C-n - листать вниз(Next)
C-p - листать вверх(Previous)

C-v - прокрутить вниз
M-v - прокрутить наверх

M-> - в конец страницы
M-< - в начало страницы

F - вперед.(Forward)
B, Backspace - назад.(Back)

C-a - стролить до упора влево
C-e - скролить до упора справо

M-Down - показать адресную строку
M-UP - скрыть адресную строку
C-l - фокус на адресную сроку

j - открыть ссылку в текущей вкладке
J - открыть ссылку в новой вкладке

C-x C-f - открыть локалный файл

C-g - отмена
C-x C-c -выход

Вкладки


C-f - следующая вкладка(Forward)
C-b - предыдущая вкладка(Back)

C-x b - выбрать вкладку из списка
C-x C-b - список всех вкладок

C-x t - открыть адрес в новой вкладке.
C-x l - открыть адрес в текущей вкладке.

C-x k - закрыть текущую вкладку(буфер)
C-_ - отменить закрытую вкладку

C-y - открыть новую вкладку с адресом из буфера обмена

Поиск и копирование


C-s - поиск вперед
C-r - поиск назад

М-w - копировать текущий url в буфер обмена
C-w - копировать выделенный текст в буфер обмена

C-x C-v - редактировать адрес текущей страницы

Работа с текстом


C-i - в поле ввода открывает текст для редактирования в emacs.(для этого он должен быть запущен и сделать M-x server-start или в .emacs добавить
1
2
(server-start)
(add-hook 'after-init-hook 'server-start)


C-c i - фокус на последнее использовавшееся полее ввода.

Разное


C-d - временно отключить перехват следующего нажатия(что-бы браузер их не порехватывал горячие клавиши)
C-z - оключить перехват нажатий(до нажатия esc)

C-c g - исходный код страницы
C-h i - справка по vimperator-у

C-c C-u - на главную сайта.
C-c h - открыть домашнюю страничку.

C-c f - открыть домашнюю директорию.
C-c u - директоря уровнем выше.

C-c p - показать картинку в новом окне
C-c m - открыть контекстное меню ссылки
C-c a - добавить закладку

C-x C-f - открыть локалный файл

C-c t - получить tinyurl текущей странички.

Конфиги


Файл .vimperator
" {{{ anrxc's vimperator configuration with Emacs bindings
"
" Bindings
" * http://sysphere.org/~anrxc/j/articles/vimperator/index.html

" Todo
" * C-n and C-p in "INSERT (menu)" mode
" * http://code.google.com/p/vimperator-labs/issues/detail?id=36

" License
" * http://creativecommons.org/publicdomain/zero/1.0
" }}}


" {{{ Options
"
" User styles as colorschemes in Vimperator 2
colorscheme zenburn

" Window title
set titlestring=Firefox

" No toolbar and scrollbars by default
set go-=brT

" Editor, C-i invokes it in text fields
set editor=emacsclient

" Command line and search patterns history
set history=10000

" Show pattern matches as you type
set incsearch

" Hilight previous search pattern matches
set hlsearch

" Override ignorecase if pattern has uppercase chars
set smartcase

" Show the tab bar only if more then one tab is open
set showtabline=0

" Focus content after a page has loaded
set focuscontent

" Show destination links in 1=status line, 2=command line
set showstatuslinks=2

" Show completions and use AwesomeBar (+search plugins)
set complete=sl
set wildoptions=auto

" Ex commands output in a new tab by default (prefs, addons...)
set newtab=all

" Internal default search engine is ignored, plugins are used
set ds=yubnub
" }}}


" {{{ Key bindings
" - Emacs GTK key-theme and FF already provide bindings for input fields
"
" M-x enters command mode
noremap <A-x> :

" Emacs navigation in command line and insert mode
cmap <C-n> <Tab>
cmap <C-p> <S-Tab>
cmap <C-f> <Right>
cmap <C-b> <Left>
cmap <C-j> <CR>
noremap <C-j> <CR>
inoremap <C-j> <CR>
inoremap <C-n> <Down>
inoremap <C-p> <Up>
inoremap <C-f> <Right>
inoremap <C-b> <Left>

" Use C-f and C-b for tab browsing
noremap <C-f> <C-n>
noremap <C-b> <C-p>

" Use C-a and C-e to jump to first/last tab
"noremap <C-a> g0
"noremap <C-e> g$
"
" Or use them to go to the absolute left/right of the document
noremap <C-a> 0
noremap <C-e> $

" Use C-p and C-n for up/down
noremap <C-p> 2k
noremap <C-n> 2j

" Use C-v and M-v for jump scrolling
noremap <C-v> <C-d>
noremap <A-v> <C-u>

" Goto the top of the document with M-<
noremap <A-<> gg

" Goto the end of the document with M->
noremap <A->> G

" Use C-s and C-r for searching (n/N for next/prev as in less)
noremap <C-s> /
noremap <C-r> ?

" Copy the current URL to the clipboard with M-w
noremap <A-w> y
"
" Copy selected text to the clipboard with C-w
noremap <C-w> Y

" Paste the current clipboard selection to a new buffer with C-y
noremap <C-y> P

" Use current URL as a start for a new location with C-x C-v
noremap <C-x><C-v> O

" C-g as cancel (C-q is stop)
cmap <C-g> <Esc>
imap <C-g> <Esc>
noremap <C-g> <Esc>

" Avoid Find dialog when canceling a started command, C-x C-g
noremap <C-x><C-g> <Esc>
"
" Avoid quit on C-q, and it's more suitable for Stop here
noremap <C-q> :stop<CR>

" Kill the buffer with C-x k
noremap <C-x>k d

" Undo close tab with C-_ (also with C-Shift-t, as C-t is new tab)
noremap <C-_> u

" Exit and save the session with C-x C-c
noremap <C-x><C-c> ZZ

" Buffer lists with C-x b and C-x C-b
noremap <C-x>b b
noremap <C-x><C-b> B

" Open a link in a new tab with C-x t
" Open a link in the current tab with C-x l
noremap <C-x>t :t<SPACE>
noremap <C-x>l :o<SPACE>

" Open hints in new tab by default (switch roles of f and F)
"noremap f F
"noremap F f

" Switch hints to letter "j", for right hand usage
noremap j f
noremap J F
"
" Extended hint mode with M-j
" ; - focus link, a - save, y - copy link, O - :open query, T - for :tabopen ...
noremap <A-j> ;

" We can now also use F for Shift+b/f as back/forward
noremap F L
noremap B H

" Back with Backspace as well
map <BS> H

" Use C-h i to start help
noremap <C-h>i :help<CR>

" Record a key sequence into a macro with C-x (
noremap <C-x>( q

" Play a macro with C-x e
noremap <C-x>e @

" Set a mark at the cursor with C-x r m
noremap <C-x>rm m

" Jump to the mark in the current buffer with C-x r b
noremap <C-x>rb '

" C-v was pass-next, remap to bind with default keys
noremap <C-d> <C-v>
"
" C-x C-f starts the "Open File" dialog (C-x C-s is Save)
map <C-x><C-f> <C-d><C-o>


" {{{ Personal key bindings
"
" M-Up/Dn toggles the toolbar and scrollbars
map <A-Down> :set go+=brT<CR>
map <A-Up> :set go-=brT<CR>

" Sidebar selection with s, close with S
map s :sidebar<SPACE>
map S :sbclose<CR>

" Dialog selection with d
map d :dialog<SPACE>

" Focus the address bar with C-l
map <C-l> <C-d><C-l>

" Focus last used input field with C-c i
map <C-c>i gi

" Add a bookmark with C-c a (dialog)
map <C-c>a <C-d><C-d>

" Bookmarks search, and search by tag
map <C-c>q :bmarks<SPACE>
map <C-c>w :bmarks -tags=

" View source with C-c g, and
map <C-c>g gf
" ... in an editor with C-c e
map <C-c>e gF

" Open picture location with C-c p
map <C-c>p ;i

" Open context menu with C-c m
map <C-c>m ;c

" Open home directory with C-c f
map <C-c>f ~

" Go to home page with C-c h
map <C-c>h gh

" Go to parent directory with C-c u
map <C-c>u gu

" Go to the root of the website with C-c C-u
map <C-c><C-u> gU

" Restart with C-c C-r
map <C-c><C-r> :restart<CR>

" Tab moving helpers
map <A-m> :tabmove<SPACE>
map <A-Left> :tabmove! -1<CR>
map <A-Right> :tabmove! +1<CR>
" }}}


" {{{ Plugin bindings
"
" Buftabs
map <C-c>b :set invbuftabs<CR>

" Noscript
map <C-c>s :noscript toggletemp<CR>
map <C-c>S :noscript popup<CR>

" TinyURL
map <C-c>t :exe ":tinyurl "+getBrowser().contentWindow.location.href<CR>
" }}}
" }}}


" {{{ Javascript functions
"
" Show the Feed and Bookmark buttons on the statusbar
javascript <<EOF
(function(){
var statusPanel = document.createElement("statusbarpanel");
statusPanel.setAttribute("id", "buttons-panel-clone");
statusPanel.appendChild(document.getElementById("feed-button"));
statusPanel.appendChild(document.getElementById("star-button"));
statusPanel.firstChild.setAttribute("style", "padding: 0; max-height: 16px;");
document.getElementById("status-bar")
.insertBefore(statusPanel, document.getElementById("security-button"));
})();
EOF
" }}}


echo ""


Файл .vimperator/plugin/buftabs.js

  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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
// PLUGIN_INFO {{{
let PLUGIN_INFO =
&lt;VimperatorPlugin&gt;
&lt;name&gt;Buftabs&lt;/name>
&lt;description&gt;Add buffer tabs to the statusline to save space.&lt;/description>
&lt;version&gt;1.1&lt;/version>
&lt;author mail="[email protected]" homepage="http://tuple-typed.org/"&gt;Lucas de Vries (GGLucas)&lt;/author>
&lt;license&gt;WTFPL version 2 (http://sam.zoy.org/wtfpl/)</license>
&lt;minVersion&gt;2.2&lt;/minVersion>
&lt;maxVersion&gt;2.2&lt;/maxVersion>
&lt;detail&gt;&lt;!<cdata><

== Usage ==
When the script is loaded it hijacks the statusline to display a list of tabs,
you can use the "buftabs" option to toggle it on or off.

== Styling ==
Use the BufTab and BufTabSelected highlight groups to style the buftabs.
Make sure you've called the "loadplugins" command before using the highlight
groups in your vimperatorrc.

== Length ==
You can set the max length of a title before it is cut off with the
buftabs_maxlength option. It is set to 25 by default.

>>></detail>
</VimperatorPlugin>;
// }}}

buftabs = {
// Update the tabs
updateUrl: function (url)
{
// Get buftabbar
var btabs = document.getElementById("liberator-statusline-buftabs");
var urlWidget = document.getElementById("liberator-statusline-field-url");
var browsers = window.getBrowser().browsers;
var position=0, selpos;

// Make sure we have an appropriate amount of labels
while (btabs.childNodes.length > browsers.length)
{
btabs.removeChild(btabs.lastChild);
}

while (btabs.childNodes.length < browsers.length)
{
var label = document.createElement("label");
btabs.appendChild(label);

label.onclick = function (ev)
{
if (ev.button == 0)
tabs.select(this.tabpos);
else if (ev.button == 1)
tabs.remove(tabs.getTab(this.tabpos), 1, false, 0);
}
}

// Create the new tabs
for (let i=0; i < browsers.length; i++)
{
// Create label
var browser = browsers<i>;
var label = btabs.childNodes</i><i>;

// Hook on load
if (browser.webProgress.isLoadingDocument)
{
browser._buftabs_label = label;
browser.contentDocument.addEventListener("load", function ()
{
buftabs.fillLabel(this._buftabs_label, this);
}, false);
}

// Fill label
label.tabpos = i;
buftabs.fillLabel(label, browser);

if (tabs.index() == label.tabpos)
{
selpos = <position>;
}

position += label.clientWidth;
}

// Scroll
if (selpos<0> < btabs.scrollLeft || selpos<1> > btabs.scrollLeft+btabs.clientWidth)
btabs.scrollLeft = selpos<0>;

// Show the entire line if possible
if (btabs.scrollWidth == btabs.clientWidth)
btabs.scrollLeft = 0;

// Empty url label
urlWidget.value = "";
},

// Fill a label with browser content
fillLabel: function(label, browser)
{
var maxlength = options.get("buftabs_maxlength").get();
var tabvalue;

// Get title
if (browser.webProgress.isLoadingDocument)
{
tabvalue = "Loading...";
} else {
tabvalue = browser.contentTitle || "Untitled";
}

// Check length
if (tabvalue.length > maxlength)
tabvalue = tabvalue.substr(0, maxlength-3)+"...";

// Bookmark icon
if (bookmarks.isBookmarked(browser.contentDocument.location.href))
tabvalue += "\u2764";

// Brackets and index
tabvalue = "<"+(label.tabpos+1)+"-"+tabvalue+">";

label.setAttribute("value", tabvalue);

// Set the correct highlight group
if (tabs.index() == label.tabpos)
label.setAttributeNS(NS.uri, "highlight", "BufTabSelected");
else
label.setAttributeNS(NS.uri, "highlight", "BufTab");


},

// Create the horizontal box for adding the tabs to
createBar: function()
{
var statusline = document.getElementById("liberator-statusline");
var buftabs = document.getElementById("liberator-statusline-buftabs");
var urlWidget = document.getElementById("liberator-statusline-field-url");

// Only create if it doesn't exist yet
if (!buftabs)
{
buftabs = document.createElement("hbox");
buftabs.setAttribute("id", "liberator-statusline-buftabs");
buftabs.setAttribute("flex", "1");
buftabs.style.overflow = "hidden"

statusline.insertBefore(buftabs, urlWidget);
}
},

destroyBar: function()
{
var statusline = document.getElementById("liberator-statusline");
var buftabs = document.getElementById("liberator-statusline-buftabs");

if (buftabs)
statusline.removeChild(buftabs);
}
}

/// Attach to events in order to update the tabline
var tabContainer = window.getBrowser().mTabContainer;
buftabs._statusline_updateUrl = statusline.updateUrl;

tabContainer.addEventListener("TabMove", function (event) {
if (options.get("buftabs").get())
statusline.updateUrl();
}, false);
tabContainer.addEventListener("TabOpen", function (event) {
if (options.get("buftabs").get())
statusline.updateUrl();
}, false);
tabContainer.addEventListener("TabClose", function (event) {
if (options.get("buftabs").get())
setTimeout(statusline.updateUrl, 0);
}, false);
tabContainer.addEventListener("TabSelect", function (event) {
if (options.get("buftabs").get())
statusline.updateUrl();
}, false);

window.getBrowser().addEventListener("load", function (event) {
if (options.get("buftabs").get())
statusline.updateUrl();
}, false);

/// Initialise highlight groups
highlight.loadCSS(String(&lt;!</position></i></cdata><cdata><
BufTab
BufTabSelected font-weight: bold;
>>&gt;));

/// Options
options.add(<"buftabs">,
"Control whether to use buftabs in the statusline",
"boolean", true,
{
setter: function (value)
{
if (value)
{
buftabs.createBar();
buftabs.updateUrl(null);

statusline.updateUrl = buftabs.updateUrl;
} else {
buftabs.destroyBar();
statusline.updateUrl = buftabs._statusline_updateUrl;
statusline.update();
}

return value;
},

completer: function (context)
<
<false>,
<true>
>,

validator: Option.validateCompleter
});

options.add(<"buftabs_maxlength">,
"Max length of an entry in the buftabs list",
"number", "25",
{
setter: function (value)
{
buftabs.updateUrl();
return value;
}
});
</true></false></cdata>



Файл .vimperator/plugin/tinyurl.js

 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
/*
* This script adds a tinyurl command to Vimperator
*
* You can map this script adding this to your .vimperatorrc
* :map <silent> your_key :exe ":tinyurl "+getBrowser().contentWindow.location.href<CR>
* @author: fox (fox91 at anche dot no)
* @version: 0.1
*
*/

commands.addUserCommand(<'tinyurl'>,
"TinyUrl command",
function(args) {
if (args.length == 1) {
let req = Components.classes<"@mozilla.org/xmlextras/xmlhttprequest;1">
.createInstance(Components.interfaces.nsIXMLHttpRequest);
req.open('GET', "http://tinyurl.com/api-create.php?url=" + escape(args<0>), true);
req.onreadystatechange = function (aEvt) {
if (req.readyState == 4) {
if(req.status == 200) {
let clip = Components.classes<"@mozilla.org/widget/clipboardhelper;1">.
getService(Components.interfaces.nsIClipboardHelper);
clip.copyString(req.responseText);
liberator.echo("TinyUrl: " + req.responseText);
}
else
liberator.echoerr("Error contacting tinyurl.com!\n");
}
};
req.send(null);
}
else {
liberator.echoerr("Please specify one url");
}
});




Вообще конфиги подробно комментированы, можно поменять на свой вкус что не нравится. Все эти сокращения даже для меня выглядят ужасно, но когда привыкнешь, то становится довольно удобно.


Тэги: emacs Firefox vimperator
+ 8 -
Похожие Поделиться

rushba 21.07.2010 18:12 #
+ 1 -
Для пользователей емакса есть conkeror.
alff31 21.07.2010 18:30 #
+ 0 -
Согласен, но в случае возникновения каких-то нестандартных действий тут можно откатить и сделать :set guioptions+=mT, а там нужно рыться в документации. Все шорткеи удобнее для повседневных действий, а не для тех, что делаешь раз в пол-года.
Как-то начинал пользоватся, но как-то что-то неосилил, да и бросил.
rushba 21.07.2010 18:36 #
+ 0 -
:set... -- это совсем не по-емаксовски, а вот рыться в документации -- это емакс-вей.
alff31 21.07.2010 19:01 #
+ 0 -
Спасибо, не надо мне такого счастья, сейчас попробовал, не осилил даже установку adblock. Минут 10 возился.
Я как-то не очень люблю приложения, в которых полчаса читать маны ради последующей экономии двух минут. Обойдусь vimperator-ом.
muhas 21.07.2010 18:19 #
+ 0 -
запятые в тегах расставь, плз

а по сабжу conkeror для емаксеров...
K900 21.07.2010 18:20 #
+ 0 -
А для хрома есть?
alff31 21.07.2010 18:30 #
+ 0 -
Адекватной альтернативы нет.
K900 21.07.2010 18:31 #
+ 0 -
Обидно =(
Aesdana 21.07.2010 18:32 #
+ 0 -
Тогда подскажите неадекватную )
alff31 21.07.2010 18:38 #
+ 0 -
В теме http://welinux.ru/post/3683/ кто-то отписывался по этому поводу, но комментарии куда-то исчезли оттуда.
Aesdana 21.07.2010 18:28 #
+ 1 -
Интересно, надо запробовать.
Очень порадовали Емаксератором и стролить до упора влево ?
alff31 21.07.2010 18:33 #
+ 0 -
Описал просто конфиг. Тоже не совсем понял, для чего.
" Use C-a and C-e to jump to first/last tab
"noremap <C-a> g0
"noremap <C-e> g$
"
" Or use them to go to the absolute left/right of the document
noremap <C-a> 0
noremap <C-e> $
lockie 21.07.2010 18:42 #
+ 0 -
В нить внезапно врывается uzbl.
kstep 21.07.2010 18:49 #
+ 0 -
узбл ниасилил.
lockie 22.07.2010 14:52 #
+ 0 -
Я тоже :(
kstep 21.07.2010 18:49 #
+ 0 -
После этого приходиться две недели учиться пользоваться браузером, управляя им исключительно клавиатурными сочетаниями. После этого наступает дзен и ты не понимаешь, зачем вообще были нужны все эти кнопочки и меню наверху.


+1 от меня =) У меня было именно так именно с таким результатом =)
vyazovoi 24.07.2010 16:37 #
+ 0 -
Лучше бы кто емакс-лайк конфиг для uzbl написал а то самому лень.

Conkeror рулит, только js надоел.
alff31 24.07.2010 23:26 #
+ 0 -
Я физически не могу его написать, тк в глаза не видел uzbl. Или вы про Adrian C.?

В хорошем качестве hd видео

Онлайн видео бесплатно


Смотреть русское с разговорами видео

Online video HD

Видео скачать на телефон

Русские фильмы бесплатно

Full HD video online

Смотреть видео онлайн

Смотреть HD видео бесплатно

School смотреть онлайн