w3m简介
以下介绍来自百度百科
w3m是个开源的文字式网页浏览器
w3m支持表格、框架、ssl连接、颜色。如果是在适当的终端上,甚至还支持“inline image”。 这个软件通常尽量呈现出网页本来的编排。
“w3m”这名字是来自“WWW-wo-Miru”,就是日文的“看WWW”之义。
由于w3m是文字式网页浏览器,所以使用w3m浏览网页时只能显示文字,而无法显示图片、视频以及音频。
安装
ubuntu18.04上
sudo apt-get install w3m
使用
帮助
w3m version w3m/0.5.3+git20190105, options lang=en,m17n,image,color,ansi-color,mouse,gpm,menu,cookie,ssl,ssl-verify,external-uri-loader,w3mmailer,nntp,gopher,ipv6,alarm,mark,migemo
usage: w3m [options] [URL or filename]
options:
-t tab set tab width
-r ignore backspace effect
-l line # of preserved line (default 10000)
-I charset document charset
-O charset display/output charset
-B load bookmark
-bookmark file specify bookmark file
-T type specify content-type
-m internet message mode
-v visual startup mode
-M monochrome display
-N open URL of command line on each new tab
-F automatically render frames
-cols width specify column width (used with -dump)
-ppc count specify the number of pixels per character (4.0...32.0)
-ppl count specify the number of pixels per line (4.0...64.0)
-dump dump formatted page into stdout
-dump_head dump response of HEAD request into stdout
-dump_source dump page source into stdout
-dump_both dump HEAD and source into stdout
-dump_extra dump HEAD, source, and extra information into stdout
-post file use POST method with file content
-header string insert string as a header
+<num> goto <num> line
-num show line number
-no-proxy don't use proxy
-4 IPv4 only (-o dns_order=4)
-6 IPv6 only (-o dns_order=6)
-no-mouse don't use mouse
-cookie use cookie (-no-cookie: don't use cookie)
-graph use DEC special graphics for border of table and menu
-no-graph use ASCII character for border of table and menu
-s squeeze multiple blank lines
-W toggle search wrap mode
-X don't use termcap init/deinit
-title[=TERM] set buffer name to terminal title string
-o opt=value assign value to config option
-show-option print all config options
-config file specify config file
-help print this usage message
-version print w3m version
-reqlog write request logfile
-debug DO NOT USE
打开 百度 w3m www.baidu.com
In-page Navigation
key | operation |
---|---|
space,C-v,^[[6~,+ | Scroll down one page (NEXT_PAGE) |
^[[5~,-,b,ESC-v | Scroll up one page (PREV_PAGE) |
C-f,RIGHT,l | Cursor right (MOVE_RIGHT) |
h,LEFT,C-b | Cursor left (MOVE_LEFT) |
DOWN,C-n,j | Cursor down (MOVE_DOWN) |
C-p,UP,k | Cursor up (MOVE_UP) |
<NOT ASSIGNED> | Cursor right. With edge touched, slide (MOVE_RIGHT1) |
<NOT ASSIGNED> | Cursor left. With edge touched, slide (MOVE_LEFT1) |
<NOT ASSIGNED> | Cursor down. With edge touched, slide (MOVE_DOWN1) |
<NOT ASSIGNED> | Cursor up. With edge touched, slide (MOVE_UP1) |
K | Scroll the screen down one line (DOWN) |
J | Scroll the screen up one line (UP) |
< | Shift screen left (SHIFT_LEFT) |
> | Shift screen right (SHIFT_RIGHT) |
, | Shift screen one column left (LEFT) |
. | Shift screen one column right (RIGHT) |
C-a,^ | Go to the beginning of the line (LINE_BEGIN) |
C-e,$ | Go to the end of the line (LINE_END) |
Z | Center on cursor column (CENTER_H) |
z | Center on cursor line (CENTER_V) |
ESC-g | Go to the specified line (GOTO_LINE) |
ESC-<,g,^[[1~ | Go to the first line (BEGIN) |
ESC->,^[[4~,G | Go to the last line (END) |
w | Move to the next word (NEXT_WORD) |
W | Move to the previous word (PREV_WORD) |
[ | Move to the first hyperlink (LINK_BEGIN) |
] | Move to the last hyperlink (LINK_END) |
TAB | Move to the next hyperlink (NEXT_LINK) |
ESC-TAB,C-u,^[[Z | Move to the previous hyperlink (PREV_LINK) |
ESC-m | Pop up menu to navigate between hyperlinks (MOVE_LIST_MENU) |
<NOT ASSIGNED> | Move right to the next hyperlink (NEXT_RIGHT) |
<NOT ASSIGNED> | Move left to the next hyperlink (NEXT_LEFT) |
<NOT ASSIGNED> | Move downward to the next hyperlink (NEXT_DOWN) |
<NOT ASSIGNED> | Move upward to the next hyperlink (NEXT_UP) |
<NOT ASSIGNED> | Move right or downward to the next hyperlink (NEXT_RIGHT_DOWN) |
<NOT ASSIGNED> | Move left or upward to the next hyperlink (NEXT_LEFT_UP) |
( | Cancel the last cursor movement (UNDO) |
) | Cancel the last undo (REDO) |
Hyperlink Operations
key | operation |
---|---|
C-m,C-j | Follow current hyperlink in a new buffer (GOTO_LINK) |
C-t | Follow current hyperlink in a new tab (TAB_LINK) |
ESC-C-j,a,ESC-C-m | Save hyperlink target (SAVE_LINK) |
I | Display image in viewer (VIEW_IMAGE) |
ESC-I | Save inline image (SAVE_IMAGE) |
<NOT ASSIGNED> | Submit form (SUBMIT) |
c | Show current address (PEEK) |
u | Show target address (PEEK_LINK) |
i | Show image address (PEEK_IMG) |
= | Display information about the current document (INFO) |
C-g | Display current position in document (LINE_INFO) |
: | Turn URL-like strings into hyperlinks (MARK_URL) |
";" | Turn current word into hyperlink (MARK_WORD) |
ESC-: | Turn Message-ID-like strings into hyperlinks (MARK_MID) |
F | Toggle rendering HTML frames (FRAME) |
M | Display using an external browser (EXTERN) |
ESC-M | Display target using an external browser (EXTERN_LINK) |
L | Show all URLs referenced (LIST) |
ESC-l | Pop up menu for hyperlinks to browse to (LIST_MENU) |
<NOT ASSIGNED> | Pop up link element menu (LINK_MENU) |
<NOT ASSIGNED> | Pop up accesskey menu (ACCESSKEY) |
File/Stream Operations
key | operation |
---|---|
U | Open specified document in a new buffer (GOTO) |
ESC-u | Go to relative address (GOTO_RELATIVE) |
<NOT ASSIGNED> | Open specified document in a new tab (TAB_GOTO) |
<NOT ASSIGNED> | Open relative address in a new tab (TAB_GOTO_RELATIVE) |
V | Open local file in a new buffer (LOAD) |
@ | Execute shell command and display output (READ_SHELL) |
# | Execute shell command and display output (PIPE_SHELL) |
| | Pipe current buffer through a shell command and display output (PIPE_BUF) |
Buffer Operations
key | operation |
---|---|
B | Close current buffer and return to the one below in stack (BACK) |
<NOT ASSIGNED> | Switch to the next buffer (NEXT) |
<NOT ASSIGNED> | Switch to the previous buffer (PREV) |
s | Pop up buffer-stack menu (SELECT_MENU) |
<NOT ASSIGNED> | Display buffer-stack panel (SELECT) |
v | Toggle between HTML shown or processed (VIEW) |
ESC-s | Save document source (DOWNLOAD) |
S | Save rendered document (SAVE_SCREEN) |
E | Edit local source (EDIT) |
ESC-e | Edit rendered copy of document (EDIT_SCREEN) |
R | Load current document anew (RELOAD) |
<NOT ASSIGNED> | Re-render document (RESHAPE) |
C-l | Draw the screen anew (REDRAW) |
<NOT ASSIGNED> | Restart loading and drawing of images (DISPLAY_IMAGE) |
<NOT ASSIGNED> | Stop loading and drawing of images (STOP_IMAGE) |
Tab Operations
key | operation |
---|---|
T | Open a new tab (with current document) (NEW_TAB) |
C-q | Close tab (CLOSE_TAB) |
} | Switch to the next tab (NEXT_TAB) |
{ | Switch to the previous tab (PREV_TAB) |
ESC-t | Pop up tab selection menu (TAB_MENU) |
<NOT ASSIGNED> | Move right along the tab bar (TAB_RIGHT) |
<NOT ASSIGNED> | Move left along the tab bar (TAB_LEFT) |
Bookmark Management
key | operation |
---|---|
ESC-b | View bookmarks (VIEW_BOOKMARK) |
ESC-a | Add current page to bookmarks (ADD_BOOKMARK) |
Searches
key | operation |
---|---|
/ | Search forward (SEARCH_FORE) |
? | Search backward (SEARCH_BACK) |
n | Continue search forward (SEARCH_NEXT) |
N | Continue search backward (SEARCH_PREV) |
C-s | Incremental search forward (ISEARCH) |
C-r | Incremental search backward (ISEARCH_BACK) |
Dictionary Lookup
key | operation |
---|---|
ESC-w | Execute dictionary command (see README.dict) (DICT_WORD) |
ESC-W | Execute dictionary command for word at cursor (DICT_WORD_AT) |
Mark Operations
key | operation |
---|---|
C-@ | Set/unset mark (MARK) |
ESC-n | Go to the next mark (NEXT_MARK) |
ESC-p | Go to the previous mark (PREV_MARK) |
" | Mark all occurences of a pattern (REG_MARK) |
Miscellaneous
key | operation |
---|---|
^[[L,^[[28~,^[[E,^[[2~ | Pop up menu (MENU) |
H | Show help panel (HELP) |
o | Display options setting panel (OPTIONS) |
r | Display the version of w3m (VERSION) |
C-k | View cookie list (COOKIE) |
C-h | Show browsing history (HISTORY) |
D | Display downloads panel (DOWNLOAD_LIST) |
<NOT ASSIGNED> | Change the character encoding for the current document (CHARSET) |
<NOT ASSIGNED> | Change the default character encoding (DEFAULT_CHARSET) |
<NOT ASSIGNED> | Display error messages (MSGS) |
m | Toggle mouse support (MOUSE_TOGGLE) |
C-w | Toggle wrapping mode in searches (WRAP_TOGGLE) |
ESC-c | Invoke w3m function(s) (COMMAND) |
<NOT ASSIGNED> | Set alarm (ALARM) |
ESC-o | Set option (SET_OPTION) |
<NOT ASSIGNED> | Set environment variable (SETENV) |
ESC-k | Define a binding between a key stroke combination and a command (DEFINE_KEY) |
<NOT ASSIGNED> | Reload configuration file (REINIT) |
! | Execute shell command and display output (EXEC_SHELL) |
C-z | Suspend w3m to background (INTERRUPT) |
q | Quit with confirmation request (QUIT) |
Q | Quit at once (EXIT) |
User-defined key bindings
Buffer and Tab Selection Mode
key | operation |
---|---|
j,C-n | Next item |
k,C-p | Previous item |
D | Delete item |
RET | Select item |
Input Line Editing Mode
key | operation |
---|---|
C-f | Cursor forward |
C-b | Cursor backward |
C-h | Delete previous character |
C-d | Delete character |
C-k | Delete everything after cursor |
C-u | Delete everything before cursor |
C-a | Cursor to the beginning of the line |
C-e | Cursor to the end of the line |
C-p | Fetch the previous string from the history list |
C-n | Fetch the next string from the history list |
C-o | Edit with external editor |
SPC,TAB | Try to complete filename |
RET | Accept input line |
Popup Menu Mode
key | operation |
---|---|
RIGHT,SPC,RET | Select item |
C-c,^[[28~,^[[2~ | Close menu |
DEL,C-h,LEFT | One selection step backward |
DOWN,j,C-n | Move to the next item |
k,UP,C-p | Move to the previous item |
K | Scroll up one item |
J | Scroll down one item |
C-a | Move to the first item |
C-e | Move to the final item |
C-v,^[[6~,C-f | Go to the next page |
ESC-v,^[[5~,C-b | Go to the previous page |
/,C-s | Search forward |
C-r,? | Search backward |
n | Search for the next match |
N | Search for the previous match |
C-z | Suspend |