In recent months Internet is blocked severely in mainland.
While GUI browsers like Chrome and Firefox with all kinds of proxy don't work anymore, the console browsers like w3m work well.
The workflow of web browsing in conosle is:
Install search engine ddgr, console browser w3m and macro register q:
sudo apt install w3m w3m-img ddgr
git clone https://github.com/cal2195/q.git ~/apps/q
echo ". $HOME/apps/q/q.plugin.zsh" >> ~/.zshrc
Restart shell and add a macro:
Qddg https_proxy=http://1.2.3.4:1234 http_proxy=http://1.2.3.4:1234 BROWSER=w3m ddgr
Now you can search "big data" with: qddg "big data"
.
After the search result list has been shown, input 1
to open the result with index 1
in w3m. Input d <new search word>
to search new contents.
Frequently Used Key Shortcuts of w3m
-
Page up/down/top/bottom:
b
/ Space /g
/G
; -
Scroll up/down one line:
K
/J
; -
Click a url or input texts: Enter;
-
Jump back to previous page:
B
; -
List buffer (show buffer list window):
s
, here buffer likes tab in GUI browser; UseD
delete buffer (in buffer list window); -
Execute shell command:
!
; -
Search text in buffer:
/
; -
Quit with/without confirmation:
q
/Q
; -
Show information about current buffer:
=
; -
Save buffer contents to file:
S
; -
Toggle HTML source of web page:
v
; -
Show URL of current buffer:
c
; -
Show URL of a link:
u
; -
Save a image into file:
ESC I
; -
Show image inline:
I
; -
Bookmark current buffer:
ESC a
; -
List bookmarks:
ESC b
;
See full keymap at w3m manual.
Note:
Here ddgr is chosen as search engine instead of the more popular googler, because the latter mark the IP of my proxy is "abused", while the former won't.