| Indent everything | M-x indent-region |
| Forward search | C-s |
| Backward search | C-r |
| Repeat old searches | C-s M-p C-s M-n |
| Regexp search | C-M-s |
| Search word under the cursor (beginning at the cursor position) | C-s C-w |
| Show only lines which match your regular expression | M-x occur RET foo M-x list-matching-lines RET foo |
| Removes lines which matches regular expressions | M-x flush-lines |
| Removes lines which does not match regular expression | M-x keep-lines |
| Counts the number of occurrences for the given expression | M-x count-matches RET foo |
| Execute grep and get output | M-x grep RET grep -e root /etc/passwd |
| Search and replace | M-% |
| Set mark | C-SPACE |
| Mark paragraph | M-h |
| Mark whole buffer | C-x h |
| Cut region | C-w |
| Copy region | ESC-w |
| Insert region | C-y |
| Split Window | C-x 2 |
| Split Window side by side | C-x 3 |
| Jump to an other part of the window | C-x o |
| Unsplit Window | C-x 1 |
| New Window | C-x 5 2 |
| Close Window | C-x 5 0 |
| Close Buffer | C-x k RET |
| Switch to another buffer | C-x b RET |
| Insert a spoiler (^L): | C-q C-l |
| Record Macro |
| Start | C-x ( |
| Stop | C-x ) |
| Execute | C-x e |
| Edit last macro | C-x C-k |
|
| Replaces newlines | M-q |
| Make current word upper case | M-u |
| Make current word lower case | M-l |
| Compare two files, buffers or directories | M-x ediff M-x ediff-buffers M-x ediff-directories |
| Emacs file manager | M-x dired |
| The last 4 Words before the current cursor position are automatically inserted whenever you type foo | C-u 4 C-x a + RET foo M-x list-abbrevs M-x edit-abbrevs M-x write-abbrev-file RET ~/.abbrev_defs M-x abbrev-mode |
Example init.el
You can use this
C-q C-j
to insert a line break with search and replace.
In emacs you can not only select rows for copy and paste but also columns.
In order to achieve this, just move the cursor to the top left position of your column (in this example we assume it should start at the letter A). Now select CTRL-SPACE to start the selection.
xx Ax xx
xx xx xx
xx xB xx
xx xx xx
Afterwards, move the cursor to the lower right corner of your column. (We assume this will be at the letter B). Now you can issue
M-x kill-rectangle
The column disapears
xx xx
xx xx
xx xx
xx xx xx
You can insert it again with the command
M-x yank-rectangle
C-x C-f RET /username@ftp.example.com:/foo/bar.txt RET
Change to passive mode
M-x customize-option RET ange-ftp-try-passive-mode RET
03-08-2009 02.55
| Command mode | ESC |
| Insert mode | i |
| Append after cursor mode | a |
| Append after linebreak mode | A |
| Replace one character | r |
| Replace mode | R |
| Open file | :e |
| Reload file | :e! |
| Open file, jump to the end of the file | :e + |
| Open file, jump to line z | :e +z |
| Show filename + linenumber | :f |
| Next file | :n |
| Save file | :w (:w!) |
| Quit | :q (:q!) |
| Save + Quit | :wq (ZZ) |
| Move one position to the left, right, up, down | h l k j |
| Move one page nach up | CTRL f |
| Move one page down | CTRL b |
| Move to the beginning of the file | 0 |
| Move to the end of the file | $ |
| Move to line z | :z NR |
| Move to the beginning of the line | ^ |
| Move to the end of the line | $ |
| Delete everything from here to the end of the line | D |
| Delete this line | dd |
| Delete this character | x (dl) |
| Copy this line | y |
| Copy the next n lines | nyy |
| Paste after this line | p |
| Paste before this line | P |
| Undo | u |
| Undo this line | U |
| Search | / |
| Search backwards | ? |
| Continue search | n |
| Continue search but backwards | N |
| Replace the next alt with neu | :s/alt/neu/ |
| Replace in this line all alt with neu | :s/alt/neu/g |
Replace from line anfang till line ende in each line the first alt with neu (use $ for the last line) | :[anfang,ende]s/alt/neu/ |
| Example: | :3,5s/Fogel/Vogel/ |
| Show user settings | :set |
| Show all settings | :set all |
| Repeat command | . |
18-05-2008 15.06
| Start a program with screen | screen prg |
| Send the program to the background | C-a C-d |
| Restore the program | screen -r PID |
06-08-2005 13.09
| Object scale (x,y,z direction) | s, s x, s y, s z |
| Object rotate (x,y,z direction) | r, r x, r y, r z |
| Object move (x,y,z direction) | g, g x, g y, g z |
| Edit / objekt Mode | TAB |
| Duplicate objekt | SHIFT d |
| Join objekts | CTRL J |
06-08-2005 13.09
mkdir /usr/local/stow/paket
cd /usr/local/src/
tar xzf quelle.tgz
cd quellpaket
./configure
make
make install prefix=/usr/local/stow/paket
cd /usr/local/stow
stow -n paket
stow paket
06-08-2005 13.09
Bochs Manual
bximage
- .bochsrc
romimage: file=/usr/share/bochs/BIOS-bochs-latest, address=0xf0000
megs: 256
vgaromimage: /usr/share/vgabios/vgabios.bin
ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
ata1: enabled=0, ioaddr1=0x170, ioaddr2=0x370, irq=15
ata2: enabled=0, ioaddr1=0x1e8, ioaddr2=0x3e0, irq=11
ata3: enabled=0, ioaddr1=0x168, ioaddr2=0x360, irq=9
# bximage -> X
ata0-master: type=disk, path="c.img", mode=flat, cylinders=X, heads=X, spt=X
#boot: disk
boot: cdrom
ips: 5000000
#sb16: midimode=1, midi=/dev/midi00, wavemode=1, wave=/dev/dsp, loglevel=2, log=/dev/stdout, dmatimer=600000
ne2k: ioaddr=0x240, irq=9, mac=12:34:56:78:90:01, ethmod=linux, ethdev=eth0
usb1: enabled=1, ioaddr=0xFF80, irq=10
06-08-2005 13.09
GNUPLOT
GNUPLOT - A Brief Manual and Tutorial
gnuplot> plot [-pi:pi] sin(x), cos(x)
gnuplot> splot sin(x*y/20)
gnuplot> plot x**2
gnuplot> set out "/tmp/my_output.ps"
gnuplot> set terminal postscript portrait enhanced color
gnuplot> plot "myfile.dat" using 1:2 title "2*x" with lines, "myfile.dat" using 1:3 title "x*x" with lines
myfile.dat:
0 0 1
1 2 2
2 4 4
3 6 8
4 8 16
5 10 32
gnuplot> set xdata time
gnuplot> set timefmt "%Y%j"
gnuplot> set format x "%Y_%m"
set boxwidth 0.1
set yrange [0:60]
set yrange [0:*]
set xrange [-1.5:1.5]
set xlable "Foo"
set format y '%g MB/s'
set xtics ('foo' 1, '2 bar' 2)
set mytics 2
set grid
set style fill pattern border
plot "myfile.dat" using 1:2 title "foo" with boxes, "gp" using 1:3 title "bar" with boxes
set terminal png size 800 600
set output "/tmp/my_output.png"
replot
05-12-2008 21.58
| Without leading break |
TRACK AUDIO NO COPY FILE "01.wav" 00:00:00
|
| With a 10 second leading break |
TRACK AUDIO NO COPY SILENCE 00:10:00 START FILE "01.wav" 00:00:00
|
| Only the part from 3 minutes 5 seconds to 3 minutes 35 seconds |
TRACK AUDIO NO COPY FILE "01.wav" 03:05:00 00:30:00
|
| Part from 1 minute to 1 minute 30 seconds from file 01.wav and from file 02.wav everything from 2 minutes. After 1 minute and 30 seconds the index is increased |
TRACK AUDIO FILE "01.wav" 01:00:00 00:30:00 SILENCE 00:02:00 FILE "02.wav" 02:00:00 INDEX 01:30:00
|
Take all wav files beneath the current folder and create a toc file for an audio CD without breaks
{
echo CD_DA;
find . -name "*.wav" | while read line;
do
echo "TRACK AUDIO";
echo "NO COPY";
echo "FILE \"$line\" 00:00:00";
echo;
done
} > myaudiocd.toc
06-08-2005 13.09
ethereal filter
(not tcp.port eq 22 and ip.addr eq 10.0.0.3 )
!(ip.addr eq 10.0.0.3)
06-08-2005 13.09