The original has not been updated for 8 years. It's a very solid w3m wrapper for vim.
I've come to like the utility of an embedded vim browser. But this implementation, as old as it is, is showing it's age.
I've done some basic improvements
- moving the README into a help file
- implement (some) of the various bug fixes from other forks
- moved W3m buffer specific mappings/commands to
<buffer>
local commands - some Markdown cleanup for this README
- fixes for search engine mappings
- added frogfind search,
frog
to complimentduck
. Frogfind specifically reformats results for text based browser (using a port of mozilla's Readability library).
I've also made some more specific changes for my tastes:
- limit word wrap to 80 characters for readability (with option to disable)
- Changes to the W3m command namespace, adopting Tim Popes
:V
:T
convention. I've always found the finger combo of 1) shift-w followed by the reach of 3 harder than it needs to be to type in a command.
Most of the rest of this doc is a cleaned up version of the original doc.
w3m.vim is a plugin on vim for w3m that is a console web browser.
w3m.vim requires w3m to be installed.
If w3m is not in your $PATH, you can specify its location in your vimrc file.
let g:w3m#command = 'C:\w3m.exe'
input :W3m [url or keyword]
input :W3m search-engine-name keyword
[search-engine-name]
alc : space alc
android : Android SDK
as3 : ActionScript 3.0
go : Go language
google : Google
java : JDK6
man : man
msdn : MSDN
perl : PERL
php : PHP
python : Python
rfc : RFC
ruby : Ruby
wikipedia : Wikipedia
yahoo : Yahoo
yahoodict : Yahoo dictionary
local : Local HTML file
input :W3mTab [url or keyword]
input :W3mSplit [url or keyword]
input :W3mVSplit [url or keyword]
input :W3m local html-file-path
This is the first change I've made to upstream The (standard) practice of uniform command prefixes seems over strict when applied to buffer local Commands, where the chance of overlap is small, and the default is sensibly to the buffer local Command. This make the commands considerably easier to type and more intuitive.
input :Close
or
input :bd
input :CopyUrl
input :Reload
input :AddressBar
input :ShowExtenalBrowser
input :SyntaxOff
input :SyntaxOn
input :SetUserAgent (w3m|Chrome|Firefox|IE6|IE7|IE8|IE9|Opera|Android|iOS|KDDI|DoCoMo|SoftBank)
input :History
input :HistoryClear
highlight! link w3mLink Function
highlight! link w3mLinkHover SpecialKey
highlight! link w3mSubmit Special
highlight! link w3mInput String
highlight! link w3mBold Comment
highlight! link w3mUnderline Underlined
highlight! link w3mHitAHint Question
highlight! link w3mAnchor Label
let &HTTP_PROXY='http://xxx.xxx/:8080'
let g:w3m#external_browser = 'chrome'
let g:w3m#homepage = "http://www.google.co.jp/"
let g:w3m#hit_a_hint_key = 'f'
let g:w3m#search_engine =
\ 'http://search.yahoo.co.jp/search?search.x=1&fr=top_ga1_sa_124&tid=top_ga1_sa_124&ei=' . &encoding . '&aq=&oq=&p='
You set as follows if you do not want to use default keymap.
let g:w3m#disable_default_keymap = 1
You set as follows if you do not want to use vimproc.
let g:w3m#disable_vimproc = 1
By default links under the curosr are highlighted. Turn off with one of the following
unlet g:w3m#set_hover_on
let g:w3m#hover_set_on = -1
" a value less than or equal to 0 will turn it off
" set delay time until highlighting
let g:w3m#hover_delay_time = 100
Search engines are loaded from autoload/w3m/search_engines/YOUR_LOCALE/
, and then from the "global" locale
unless a localized search engine of the same name exists. Your locale defaults to v:lang
, which vim sets
based on your $LANG
environment variable.`
To specify a custom locale for loading search engines:
let g:w3m#lang = 'en_US'
let g:w3m#history#save_file = $HOME.'/.vim_w3m_hist'
let g:w3m#allow_long_lines = 1
- <CR> Open link under the cursor.
- <S-CR> Open link under the cursor (with new tab).
- <TAB> Move cursor next link.
- <s-TAB> Move cursor previous link.
- <Space> Scroll down.
- <S-Space> Scroll up.
- <BS> Back page.
- <A-LEFT> Back page.
- <A-RIGHT> Forward page.
- = Show href under the cursor.
- f Hit-A-Hint.
- s Toggle Syntax On/Off.
- c Toggle Cookie On/Off.
- <M-D> Edit current url.
Forked from https://github.com/yuratomo/w3m.vim