Wiki2
TextEditors (changes)

Showing changes from revision #29 to #30: Added | Removed | Changed

Text Editor Evaluation

What is the most important shortcuts?

File mangement

  • Create New File
    • E: C-x C-f <new>
    • V: :tabedit - open in tab
  • Open File
    • E: C-x C-f <file>
    • V: :tabedit file or use NerdTree
  • To File (TextMate specific)
    • E: ...
    • V: C-p - The Silver Searcher
  • Open File Browser
    • E: ...
    • V: :Te (open file in new tab) or C-n (NerdTree)
  • Save File
    • E: C-x C-s
    • V: :w
  • Close Buffer (Close Editor if last buffer)
    • E: C-x C-c
    • V: :q

Moving Around

  • Move to Top
    • E: M-<
    • V: gg
  • Move to Bottom
    • E: M->
    • V: G
  • Move Char (Back/Forward)
    • E: Lt/Rt
    • V: Lt/Rt or h/l
  • Move Word (Back/Forward)
    • E: M-b/M-f
    • V: b/w
  • Move Row (Up/Down)
    • E: Up/Dn
    • V: Up/Dn or j/k
  • Move Section (Back/Forward)
    • E: M-{/M-}
    • V: {/} or C-Up/Dn
  • Move Screen (Back/Forward)
    • E: M-v/C-v
    • V: ...
  • Move to End of Line (Back/Forward)
    • E: C-a C-e
    • V: 0/$ or 0/9
  • Move to Symbol (TextMate specific)
    • E: ...
    • V: ...

Selection

  • Select + Movement
    • E: ...
    • V: v (select)
  • Column Select + Movement
    • E: ...
    • V: C-v

Collapse

  • Collapse Section
    • E: ...
    • V: ...
  • Expand Section
    • E: ...
    • V: ...

Copy and Paste

  • Copy
    • E: M-w
    • V: y
  • Cut
    • E: C-w
    • V: d
  • Cut Line(s)
    • E: C-k
    • V: dd
  • Paste (Cut or Copied)
    • E: C-y
    • V: p

Completion

  • Complete Command
    • E: ...
    • V: ...
  • Show Possible Commands
    • E: ...
    • V: ...

Undo

  • Undo
    • E: C-x u
    • V: u
  • Redo
    • E: C-x u
    • V: U
  • Abort command (vi/emacs specific)
    • E: C-g
    • V: Esc

Search and Replace

  • Search in File (Options: Replace, Regexp, Direction, All)

    • E: C-s (normal), C-M-s (regexp), M-p (prev), M-n (next), RET (abort)
    • V: :%s/foo/bar/gci - global, confirm and ignore case
  • Search in Project (Options: Replace, Regexp, Direction, All)

    • E: ...
    • V: ...

Formatting

  • Intendent Selection (Back/Forward)
    • E: ...
    • V: ...
  • Toggle Comment on Selection
    • E: ...
    • V: C-v Up/Dn I # Esc i.e. column select, multi row insert, comment char and escape.

Buffer

  • Switch Buffer (Back/Forward)
    • E: C-x 2 (split horizontally), C-x 3 (split vertically), C-x o (switch buffer), C-x 1 (close split)
    • V: ...

Help

  • Open Help
    • E: C-h, C-x 1 (close help)
    • V: help topic

Vim tricks

Color schemes: Vibrant Inc, Vivid Chalk

Use Caps Lock as Escape

Make the remapping of keys in ~/.Xmodmap

remove Lock = Caps_Lock
keysym Caps_Lock = Escape

And then call this file from ~/.xinitrc

if [ -f ~/.Xmodmap ]; then
  xmodmap ~/.Xmodmap
fi

References

Vim