[emacs] Absolute basics — one step at a time: files, buffers, windows

Tags

, , ,

Manipulate files:

1. C-x C-f Find a file (allows TAB completion)
2.  C-x C-s Save a copy of the current buffer to
     the corresponding file. If the buffer is not associated
     with a file, it'll prompt for a file name.
3. C-x s Save some buffers with the option of selectively
    saving them.

Manipulate buffers:

1. C-x C-b List all buffers
   (then C-x 1 to kill the window showing the list)
2. C-x b Prompts for the buffer to go to (allows tab completion)
3. C-x k Prompts for the buffer name to kill
4. C-x C-q Toggle read-only mode

Manipulate windows:

1. C-x 0 Delete current window
2. C-x 1 Delete all but the current window
3. C-x 2 Split the window vertically
    (with a horizontal line in the middle)
4. C-x 3 Split the window horizontally
   (with a vertical line in the middle)
5. C-x o Move to the other window
6. C-M-v Scroll the other window

Reference: A tutorial introduction to emacs.

[emacs] Absolute basics — one step at a time: delete, kill, yank and undo

Tags

, , , , ,

Delete (non-retrievable)/ kill (retrievable)

Character:

   1. C-d forward delete a character
   2. Delback backward delete a character

Word:

   3. M-d forward kill a word
   4. M-delback kill the word immediately before the cursor

Line:

   
   5. C-k  kills upto the end of the line
         not including the newline charcacter
   6. C-u 0 C-k  kills upto the beginning of the line
        not including newline character
        (You may replace "C-u 0" by "M-0", too)

Sentence:

 
   7. M-k  kills upto the end of the sentence
   8. C-u -1 M-k kills upto the beginning of the current sentence

Region:

   
   9. C-spc Set a mark at the current cursor position
  10. C-w kill the region between the current cursor position and
      the previous mark set by C-spc.

Undo

   1. C-x u
   2. C-_
   3. C-/

Yank

   2. C-y yank previous kill
   3. M-y replace text inserted by previous C-y by the next entry in the "kill ring".

N.B.

      1. M-5 C-/ undo last 5 changes
      2. M-2 C-y Yank last kill 5 times
      3. C-x C-s Save all the changes in the current file.

[emacs] Absolute basics — one step at a time: cursor movement

Tags

, ,

This is a continuation of my effort to get used to emacs editor. I just realized that there is no point in listing all the commands together at one post — simply because I missed a lot of useful ones the first time. So, let’s do it step-wise — one category at a time. Today, just the ‘cursor movement’: (Hit C-h t to get to the inbuilt tutorial)

Lines (vertically):

   
    1. C-n next line
    2. C-p previous line

Lines (Horizontally):

    3. C-a Move to the beginning of a line
    4. C-e Move to the end of a line

    5. C-f move forward one character
    6. C-b move backward one character

    7. M-f move forward one word
    8. M-b Move backward one word

Sentences:

    5. M-a Move to the beginning of a sentence
    6. M-e Move to the end of a sentence

Paragraphs:

    7. M-{ Beginning of a paragraph
    8. M-} End of a paragraph

Pages:

 
     9. C-x [ Beginning of the page
   10. C-x ] End of the page

Buffers:

   11. M-< Move to the beginning of the current buffer
   12. M-> Move to the end of the current buffer

N.B.C-u <n>" or "M-<n>" is the command for numeric argument, i.e.

   1. C-u 7 *  Inserts "*" seven times
   2. M-8 C-f forwards the cursor 8 letters

[mutt] Add a signature at the end of outgoing messages in mutt

Tags

, , ,

Just add your signature in a file, say, ~/.signature and update the ~/.muttrc (or ~/.mutt/muttrc file, depending on where you put all your mutt aliases) by adding the following line:

set signature="~/.signature"

					
Design a site like this with WordPress.com
Get started