Showing posts with label emacs. Show all posts
Showing posts with label emacs. Show all posts

Thursday, September 9, 2010

emacs useful commands

Here are some useful tips from this site.


  1. C-s incremental search. Once you have reached the end of the buffer it will perform an overlap search from the start.
  2. Use fn+left arrow to move to the end of the current line.
  3. Use fn+right arrow to move to the start of the current line.
  4. Use fn+up arrow to move to the start of the buffer.
  5. Use fn+down arrow to move to the end of the buffer. (These are tested on Aquamacs)
  6. M-x grep is extremely useful. It will bring the grep -n -e command to which you must append the filename and the 'string to match' and hit return. The grepped results will be shown in a separate buffer which you can click to move to the appropriate position in the source file.
  7. M-x shell opens a remote/local shell on a separate buffer.
  8. If a file is in version control then emacs shows that in the bottom buffer bar. (e.g. SVN).
  9. C-x v = shows the modifications that you have done since the last commit to the current file.
  10. C-x v v will perform the next appropriate version control action to the current file. If it is a commit then you will get a buffer to write a commit note and then hit C-c C-c to make the commit.
  11. To enter/exit from full screen mode use: command+shift and return.

Thursday, July 31, 2008

Do not display initia screen on emacs

To prevent the default GNU message on emacs
add the following line to your .emacs file.

(modify-frame-parameters nil '((wait-for-wm . nil)))

Friday, July 11, 2008

emacs

TRAMP (opening remote files)
Add the followig to .emacs
(require 'tramp) (setq tramp-default-method "scp")

now you can open a remote file like this
/kin:~/re/test.py

Moving to buffers
Next : Ctrl+X+right arrow key
Previous : Ctrl+X+left arrow key

Word wrapping
To toggle the fill mode
M+x auto-fill-mode
If we are in the fill mode then "fill" will appear in the status bar.
At fill mode, line wrapping causes a new line char to be inserted.
(not good, have to reformat)

To format/wrap
M+q (do this on top of text)

Setting the scroll bar on the right
put the following two lines in the .emacs file
(setq scroll-bar-mode-explicit t)
(set-scroll-bar-mode 'right)

Enable backspace
(global-set-key "\C-h" 'backward-delete-char)

Markup/delete/insert
press Ctrl+space to start mark-up a region.
Now move the curser down/up left/right to mark a rectangle.
press Ctrl+x and then r then t now it will turn to
String-rectangle mode. Type what you want to insert

To delete,
markup the rectangle with Ctrl+space and then
Ctrl+x and r k
k is to kill

emacs fonts

To check all availabe font options run, xfontsel from the command line.
You can try diiferent fonts and their options.

One example would be,

(set-frame-font "-adobe-helvetica-*-r-normal-*-14-*-75-75-*-77-*-u")


Add this line to your .emacs file.
To set the geometry of the window (size) add the following line
to ~/.Xresources

Emacs.geometry:31x48

Then run,
xrdb -merge ~/.Xresources

The next time you start emacs, things will be nice!!!

Continuously monitor GPU usage

 For nvidia GPUs do the follwing: nvidia-smi -l 1