This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
emacs:emacs [2008/12/02 14:27] – decianm | emacs:emacs [2009/05/08 11:45] (current) – decianm | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Emacs ====== | ====== Emacs ====== | ||
+ | ===== Good to know ===== | ||
+ | ==== Cutting out a rectangle ==== | ||
+ | To cut out a rectangle in emacs, mark the region in question with your mouse (upper left to lower right). Then press < | ||
+ | ctrl-x r k | ||
+ | </ | ||
+ | Paste the rectangular region with | ||
+ | < | ||
+ | ctrl-x r y | ||
+ | </ | ||
+ | ==== Search for a string ==== | ||
+ | If you want to search for a string, type | ||
+ | < | ||
+ | ctrl-s | ||
+ | </ | ||
+ | If you want to search the same string as before, press: | ||
+ | < | ||
+ | ctrl-s ctrl-s | ||
+ | </ | ||
+ | |||
===== Configuring Emacs===== | ===== Configuring Emacs===== | ||
==== Mousewheel on lxplus ==== | ==== Mousewheel on lxplus ==== | ||
Line 39: | Line 58: | ||
The first four blocks of code define function for different scrolling speeds. In the second part, the mousewheel is assigned to a scrolling speed. Pressing '' | The first four blocks of code define function for different scrolling speeds. In the second part, the mousewheel is assigned to a scrolling speed. Pressing '' | ||
+ | ==== Numberpad on lxplus ==== | ||
+ | By default, the keys on the numberpad are overloaded with different functionalities when using emacs in the LHCb environment on lxplus. If you want the standard numberpad, add the following to the '' | ||
+ | < | ||
+ | (defun setnumpad() | ||
+ | (interactive) | ||
+ | (global-set-key [kp-decimal] '" | ||
+ | (global-set-key [kp-subtract] '" | ||
+ | (global-set-key [kp-enter] '" | ||
+ | (global-set-key [kp-0] | ||
+ | (global-set-key [kp-1] | ||
+ | (global-set-key [kp-2] | ||
+ | (global-set-key [kp-3] | ||
+ | (global-set-key [kp-4] | ||
+ | (global-set-key [kp-5] | ||
+ | (global-set-key [kp-6] | ||
+ | (global-set-key [kp-7] | ||
+ | (global-set-key [kp-8] | ||
+ | (global-set-key [kp-9] | ||
+ | ) | ||
+ | (defun setnonumpad() | ||
+ | (interactive) | ||
+ | (load (expand-file-name " | ||
+ | ) | ||
+ | </ | ||
+ | After emacs has started, type '' | ||
+ | |||
+ | ==== Adding goto-line ==== | ||
+ | A useful little command when coding with emacs is **goto-line**. To assign it a shortcut, add in your '' | ||
+ | < | ||
+ | ;; == goto line == | ||
+ | (define-key global-map " | ||
+ | </ | ||
+ | Goto-line then is executed with '' | ||
+ | |||
+ | ==== Changing the font permanently ==== | ||
+ | To permanently change the font in emacs, do the following: | ||
+ | * Type '' | ||
+ | * Start emacs and go to the *scratch* buffer. Type: '' | ||
+ | * Open your .emacs file and add the following line: | ||
+ | < | ||
+ | (set-default-font "the font you want to choose" | ||
+ | </ | ||
+ | for example | ||
+ | < | ||
+ | (set-default-font " | ||
+ | </ | ||
+ | * Close emacs and restart it. Your default font should now be set to the font you chose. |