Skip to content

Latest commit

 

History

History
136 lines (125 loc) · 8.42 KB

File metadata and controls

136 lines (125 loc) · 8.42 KB

The Cheatsheet

Bash

General commands

CommandDescription
M-BackspaceKill word backward from point
C-_Undo
M-spaceMark
C-x C-xExchange point and mark (only for current row, is not saved along with command in history)
ESC 10 fPrefix key, inserts ffffffffff
!!show previous command and execute it
!-1 (!-x)Show previous command and execute it
C-tswitch character before and at cursor
M-tswitch word before and after cursor

Screen tricks

CommandDescription
C-a dminimize screen
screen -Rmaximize screen
C-a \exit screen

Emacs

Key Bindings

Key BindingsPurpose
M-S-;Toggle comment
M-hmark paragraph
C-c C-x C-dShow timers behind tasks (org-clock-display)
C-x =Display cursor position and character info
M-x rename-bufferrename buffer, useful for similar files
C-M-fMove forward by s-expression
C-M-bMove backward by s-expression
C-M-kKill s-expression
C-M-dMove down into a list
C-M-uMove up out of a list
C-M-nMove forward to the next list
C-M-pMove backward to the previous list
M-aMove to beginning of sentence
M-eMove to end of sentence
org-agenda
bswitch to previous week
bswitch to next week
C a LShow scheduled tasks
C a nShow scheduled, then unscheduled tasks
M-x subword-modeMinor mode that treats CamelCase as distinct words
M-x superword-modeMinor mode that treats snake_case as one word

List of tips

Tips
Org-mode
write in the past tense, makes more sense to someone who reads it later
Execute org-lint for debugging of source-blocks.
This is helpful when exporting produces errors.
Startup visibility for one headline:
:Properties:
:Visibility: children (content/all)
:End:
To set file-specific source-block settings put this to the top:
#+PROPERTY: header-args :eval never-export
cua-mode
1. Activate cua-mode
2. Move point to beginning of rect and press c-ret
3. Move point to end of rect and press M-i

tramp

C-x C-f /sudo::/etc/fstab C-x C-f /sudo::user@server

C-x C-f /sudo:ssh-host:file-on-ssh-host C-x C-f /ssh:localhost#4000|ssh:10.2.2.4|ssh:10.5.5.5:/etc/nagiosconfigbuilder.yml C-x C-f /ssh:10.2.2.4|sudo:root@10.2.2.4:/etc/hosts

eshell:

cd /ssh:user@fqdn:~ cd /ssh:ubu12\|sudo:ubu12:/etc/ =apt-cache policy > #<buffer apt-policy>

Vim

General commands

CommandDescription
hjkluse these to move
xdelete character at point
Aenter insert mode after current line
C-cexit insert-mode
:e filenameedit another file
gfopen file at point
zzcenter the screen
S-zzsave file and exit
:%s/foo/gar/gcreplace every foo with bar in current file with confirmation
C-Fpage down
C-Bpage up
:match Todo /regexp of word/highlight a specific word
C-w vsplit the window vertically
C-w ssplit the window horizontically
C-w qclose the current window
C-w C-wjump to next window
C-w arrowjump to window in arrow-direction

Commands defined in my .vimrc

CommandDescription
M-pswitch current line with previous one
M-nswitch current line with next one

Workflows

  • Comment / Uncomment a selection of lines
    1. move to the beginning of intended selection
    2. C-V (enter visual mode)
    3. move to the end of the intended selection
    4. S-I # C-c
    5. Give it a second

Cheatsheets