Emacs Hacks

replace-regexp
How to use Emacs replace-regexp, see http://sunsite.univie.ac.at/textbooks/emacs/emacs_16.html.

Example: If you want to replace the text inferlabel{foobar} with the text: text{{\sf foobar}} where foobar is not constant for all occurrences of inferlabel. Then you can use this set of commands:

M-x replace-regexp RET inferlabel{\([^}]*\)} RET text{{\\sf \1}}
The character class [^}] matches any character other than }. The use of the grouping construct \( \) makes whatever is matched by the pattern inside referable by \1.

Some customizations

See Github for my script for auto increment/decrement of integers.

The code below should be placed in your emacs.d file in your home dir or in an extension dir


;; Changes the default font size
(set-default-font "7x14")
;; Changes all yes/no questions to y/n type (fset 'yes-or-no-p 'y-or-n-p)


;; displays the time in the status bar
(display-time)


Ingen kommentarer:

Send en kommentar