Useful Key Combinations
Files. Don't forget to use the buffer menu; all the loaded files are
listed there.
- 'C-x C-f': Open file. (Tab-completion works: type the beginning
of the filename, then press tab.)
- 'C-x C-s': Save current buffer.
- 'C-x C-w': Save as.
- 'C-x k': Delete buffer (i.e. 'unload' file).
Of course, you want to avoid the menu, so there are excellent buffer
commands:
- 'C-x b': Frågar efter vilken buffert du vill
ha. Emacs gissar att det är den senast använda bufferten du vill ha
och om det stämmer slår du bara retur. Annars ger du namnet (typiskt
filnamnet) på den buffert du vill ha. Lägg märke till att det räcker
med ett unikt prefix och att du med tab-tangenten kan se vad som
matchar det prefix du har gett.
- 'C-x C-b': Tar upp en buffert med en
lista på alla dina buffertar. Du kan vandra omkring i buffertlistan
och ge olika kommandon. T.ex. betyder 'v' "visit buffer" och
alltså tar fram den bufferten. Med 'd' markerar du att
bufferten ska tas bort (på samma sätt som 'C-x k') och 's'
betyder spara. Dessa markeringar får effekt när man ger
kommandot 'x', för "exekvera".
To move the cursor around:
- 'C-a': Move to the beginning of the line.
- 'C-e': Move to the end of the line.
- 'C-left' (i.e. control plus cursor left): Move left one word.
- 'C-right': Move right one word.
- 'M-left' and 'M-right' (i.e. alt plus cursor left/right): Move
left/right by one mode-defined unit. Try and see.
- 'M-g': Jump to line number.
Deleting text and such:
- 'C-k': Delete to end of line. (Deletes whole line if line is empty.)
- 'M-backspace': Delete one word backwards.
- 'C-space': Mark start of block.
- 'C-w': Delete marked block, 'cut'. (Move to one end of
block. 'C-space'. Move to other end of block. 'C-w'.)
- 'M-w': Like 'C-w' in that it saves the marked block to the
kill ring, but with the difference that the block is
not removed.
- 'C-y': Paste.
- 'M-y': Change the recent paste ('C-y' without any new commands) with an earlier item in the kill ring.
- 'C-_': Undo.
Search/replace:
- 'C-s': Search/continue search.
- 'C-r': Search backwards/continue search backwards.
- 'M-%': Search/replace.
Help!
- 'C-h k': Describe a key.
- 'C-h b': Describe keys that have a meaning.
- 'C-h f': Describe a function.
- 'C-h i': Info, with lots of help documents about, among others,
emacs, gcc, gdb, etc.
Miscellaneous:
- 'C-]': Quit minibuffer (the line below the status bar). Use,
for example, if you typed 'C-x k' (kill buffer) but then decided you
didn't want to do that after all.
- 'M-$': Spell-check word under cursor.
- 'C-!': Run shell command (e.g. run your newly compiled program).
Of course, any and all of these can be overridden in your .emacs file...
Johannes Keukelaar
Last modified: Mon Nov 30 08:49:54 MET 1998