No edit summary |
(Change to TipImported template + severe manual clean) |
||
Line 1: | Line 1: | ||
{{review}} |
{{review}} |
||
+ | {{TipImported |
||
− | {{Tip |
||
|id=555 |
|id=555 |
||
+ | |previous=554 |
||
− | |title=Vim as bookmark manager |
||
+ | |next=556 |
||
− | |created=September 11, 2003 |
+ | |created=September 11, 2003 |
|complexity=intermediate |
|complexity=intermediate |
||
|author=Mikolaj Machowski |
|author=Mikolaj Machowski |
||
|version=6.0 |
|version=6.0 |
||
|rating=17/10 |
|rating=17/10 |
||
⚫ | |||
− | |text= |
||
+ | Sometimes you are collecting bookmarks from various sources, not only web, mail client, usenet even newspapers. Sometimes it is not possible or convenient to insert them in your favorite web browser bookmark manager. But nothing is lost - you can use Vim. |
||
− | Vim as bookmarks manager |
||
⚫ | |||
⚫ | |||
+ | <pre> |
||
− | Sometimes you are collecting bookmarks from various sources, not only |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
+ | endif |
||
+ | endif |
||
⚫ | |||
+ | </pre> |
||
+ | Use visual mode to select one or more lines, then press a key to open the URLs in tabs. Any line starting with '#' is a comment and is skipped. |
||
− | web, mail client, usenet even newspapers. Sometimes it is not possible, easy etc. |
||
⚫ | |||
− | to insert them in your favorite web browser bookmark manager. But |
||
⚫ | |||
− | nothing is lost - you can use your Editor :) |
||
⚫ | |||
⚫ | |||
+ | ---- |
||
⚫ | |||
− | |||
⚫ | |||
− | |||
− | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
− | endif |
||
− | |||
− | endif |
||
− | |||
⚫ | |||
− | |||
− | |||
− | |||
− | Note: you can select in Visual mode few lines and open in one keypress |
||
− | |||
− | few tabs. Comment lines with # at the beginning. This lines won't be |
||
− | |||
− | precessed with function. |
||
− | |||
− | |||
− | |||
⚫ | |||
− | |||
− | tabs. |
||
− | |||
− | |||
− | |||
⚫ | |||
− | |||
− | with older versions) |
||
− | |||
⚫ | |||
− | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | <!-- parsed by vimtips.py in 0.696004 seconds--> |
Revision as of 07:26, 4 November 2007
created September 11, 2003 · complexity intermediate · author Mikolaj Machowski · version 6.0
Sometimes you are collecting bookmarks from various sources, not only web, mail client, usenet even newspapers. Sometimes it is not possible or convenient to insert them in your favorite web browser bookmark manager. But nothing is lost - you can use Vim.
Keep all URLs in one file called, for example, url – one URL per line.
Put this in your .vimrc:
autocmd BufRead ~/url map <F8> :call BrowserURL()<cr> let g:web_browser = "konqueror" function! BrowserURL() if getline('.') !~ '^\s*\#' if g:web_browser == "konqueror" exe ":!dcop `dcopfind -a 'konqueror*'` konqueror-mainwindow\\#1 newTab ".getline('.') elseif g:web_browser == "mozilla" exe ":!mozilla -remote \"openurl(".getline('.').", new-tab)\"" endif endif endfunction
Use visual mode to select one or more lines, then press a key to open the URLs in tabs. Any line starting with '#' is a comment and is skipped.
I am sure such operation are possible also with other web browsers with tabs.
Konqueror from KDE3.2-Alpha1 (but this dcop commands should work also with older versions)
Mozilla 1.4