Use Emacs in console
Purpose
When I travel outside, the slow network speed does not allow me to connect to my home server with X11 forwarding. Therefore, using Emacs on the server should be in a console via SSH and consistent operational habits should be formed.
Color theme tuning
Phenomenon I’m using the solarized light color theme in Emacs. When I run Emacs in Konsole on my laptop, the color theme looks comfortable. When I run Emacs on the remote server via SSH from Konsole on my laptop, some colors look too dark, while some look too light to be identifiable. Initially, I thought this may be caused by inappropriate colors in the color scheme in Konsole. However, this is not the cause.
Analysis Execute display-color-cells
in the two Emacs to check the number of colors supported. Emacs on my laptop returns 16777216, which is 24 bit true color, while Emacs on the remote server via SSH returns 256. In addition, if Emacs is started within a screen window, 24 bit color is not supported.
Solution
- Add
export TERM=xtern-256color
andexport COLORTERM=truecolor
to.bashrc
. - Use
tmux
instead ofscreen
to have 24 bit color support.
General operations
-
Delete a previous word in console Emacs
The Emacs function is
backward-kill-word
. It is bound toC-<backspace>
andM-DEL
. In the console,C-<backspace>
does not work. UseM-DEL
instead, i.e.Alt+backspace
. -
Fold all subtrees in Org mode
In Emacs GUI,
shift-tab
will do the work. In console mode, it is ineffective. UseC-u TAB
instead.