User Tools

Site Tools


emacs:emacs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
emacs:emacs [2008/12/02 14:33] decianmemacs: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 <code>
 +ctrl-x r k
 +</code>, which will cut out the rectangular region.
 +Paste the rectangular region with 
 +<code>
 +ctrl-x r y
 +</code>
 +==== Search for a string ====
 +If you want to search for a string, type
 +<code>
 +ctrl-s
 +</code>
 +If you want to search the same string as before, press:
 +<code>
 +ctrl-s ctrl-s
 +</code>
 +
 ===== Configuring Emacs===== ===== Configuring Emacs=====
 ==== Mousewheel on lxplus ==== ==== Mousewheel on lxplus ====
Line 64: Line 83:
 ) )
 </code> </code>
-After emacs has started, type ''alt-x setnumpad'' to activate the normal numberpad. If you want to deactivate it, type ''alt-x setnumpad''. Note: This is not very sophisticated, as just the configuration file is loaded again.+After emacs has started, type ''alt-x setnumpad'' to activate the normal numberpad. If you want to deactivate it, type ''alt-x setnumpad''(Note: This is not very sophisticated, as just the configuration file is loaded again.) 
 + 
 +==== Adding goto-line ==== 
 +A useful little command when coding with emacs is **goto-line**. To assign it a shortcut, add in your ''~/.emacs'':  
 +<code> 
 +;; == goto line == 
 +(define-key global-map "\C-xg" 'goto-line) 
 +</code> 
 +Goto-line then is executed with ''ctrl-x g''
 + 
 +==== Changing the font permanently ==== 
 +To permanently change the font in emacs, do the following: 
 +  * Type ''xfontsel'' in a terminal. A window will appear. Choose your desired font by selecting ''fndry'', ''fmly'', etc. You will end up with a string that exactely describes your font. 
 +  * Start emacs and go to the *scratch* buffer. Type: ''prin1-to-string (x-list-fonts "font-you-whant-to-check or pattern"))'' where you put in the selected font from xfontsel. Place the cursor after the last closing parenthesis and type CTRL-j. A list of available fonts with the given pattern will appear. 
 +  * Open your .emacs file and add the following line:  
 +<code> 
 +(set-default-font "the font you want to choose"
 +</code> 
 +for example 
 +<code> 
 +(set-default-font "-adobe-courier-medium-r-normal--12-120-75-75-m-70-iso8859-10"
 +</code> 
 +  * Close emacs and restart it. Your default font should now be set to the font you chose.
emacs/emacs.1228224820.txt.gz · Last modified: 2008/12/02 14:33 by decianm