Emacs Tips and Tricks
Emacs configuration
~/.emacs
|
|
transient-mark-mode 1
enables highlighting on mac.add-hook 'before-save-hook 'delete-trailing-whitespace
remove trailing whitespace when document saved.
Jump to first non-whitespace character in line
M-m
or Esc-m
on Mac.
While writing code in Emacs, I have to go to the the first character in the line.
|
|
Since there are many indents on the lines, it is a painful to go to the beginning of the line and then move until the first character.
Add tab to multiple lines
Select multiply lines, then type C-u 4 C-x Tab
, it will indent the region by 4 spaces.
Search and replace
M-x replace-string Enter <current string> Enter <new string>
On mac M-x
is Esc-x
.