Vi mode – the mode vi starts in command mode – you can be in command mode from the vi mode by pressing the key colon (“:”) input mode – in this mode user starts the actual editing of the text Below are some of the most commonly used vi commands in all 3 modes of operation. Vim is installed by default on most Unix based operating systems, including Mac OS and most GNU/Linux distros. It therefore feature various commands that allows you to interact with the OS.:!pwd. Master your Mac with custom keyboard shortcuts - Popular Science. How to Enable Photoshop’s Old Undo Keyboard Shortcuts - How-To Geek. Google is working on user-customized keyboard shortcuts for Chrome UPDATED - Chrome Unboxed. How to open Microsoft Edge with a keyboard shortcut Windows 10 - MobiGyaan.
Vi is an one of two powerhouse text editors in the Unix world, the other being EMACS. While obtuse, vi is extremely powerful and efficient. There may be times when vi is the only text editor available, so it helps to at least know the basics.On Mac OS X (and Linux), vi is symlinked to vim (vi improved), a more modern free software version. Vim It is the default editor when changing a crontab.
If you gave vi a whirl and don't see the beauty of it, give the nano editor a try. It also ships with Mac OS X.
note: a chunk of this small guide came from a web page I found long ago, but I don't remember where so I can't give proper credit. I've added and changed things from the original text.
Vi has two modes, command and insert (really, three if you count replace mode). Command mode is used to navigate, search, and issue other commands. Insert mode is used to enter text.
Vi starts in command mode.
You can precede most commands with a number indicating how many times to perform a command. For example, entering 99 followed by the down arrow will move the cursor down 99 lines. '99x' will delete 99 characters.
While in command mode (case sensitive)Vi Shortcuts Mac Keyboard
- move the cursor with arrow keys; if there aren't any arrow keys, use j,k,h,l
- i - change to insert mode (before cursor)
- a - change to insert mode (after cursor)
- A - change to insert mode (at end of line)
- r - replace one character
- R - overwrite text
- x - delete one character
- dd - delete one line
- yy - yank line (copy)
- p - paste deleted or yanked text after cursor
- P - paste deleted or yanked text before cursor
- G - go to end of the file
- 1G - go to top of the file
- J - merge next line with this one
- / - search, follow / with text to find
- :wq - write file and quit
- :q! - quit without saving
- %s/old/new/g - substitute; replace 'old' with 'new' on all lines
- :g/pattern/d - delete all lines that match the pattern
- ESC - change to command mode
- any text typed is entered at the cursor
- Type 'vi file.txt' at command prompt
- Move cursor to where new text will be added
- Type 'i' to change to insert mode
- Type new text
- Type ESC to go back to command mode
- type ':wq' and ENTER to write the file and quit
- Keyboard Shortcuts
See also keyboard shortcuts for tools and Customizing Keyboard Shortcuts.
Keyboard and Mac/Win»
Vi Shortcuts Mac Os
Although we try to always mention both, it is possible that in some places references to the keyboard shortcuts refer to Mac keystrokes instead of giving both Mac and Windows versions.
Since Mac Cmd
already maps to the Windows Ctrl
, the Mac Ctrl
shortcuts have no simple Windows equivalent; we map the Mac Ctrl
shortcuts to Ctrl
+Alt
+Shift
combination on Windows. As pressing 3 keys is uncomfortable, we try to avoid using the Mac Ctrl
shortcut for this reason, but there are a few such shortcuts.
Mac | Win |
---|---|
Shift | Shift |
Cmd | Ctrl |
Option | Alt |
Ctrl | CtrlAltShift |
Vi Shortcuts Cheat Sheet
Menu items»
The table below lists Mac keyboard shortcuts. Please see Keyboard and Mac Win above for information on differences in shortcuts on macOS and Windows. For example, the Import > Artwork… command has CtrlD shortcut on Mac and CtrlAltShiftD on Windows.
Menu | Mac Shortcut | Description |
---|---|---|
Application | Cmd, | Preferences |
CmdH | Hide FontLab VI | |
AltCmdH | Hide Others | |
CmdQ | Quit FontLab VI | |
File | CmdN | New Font… |
CmdO | Open Fonts… | |
ShiftCmdO | Open > Font Folder… | |
AltShiftCmdO | Open > Installed Fonts… | |
CmdF12 | Revert > Font | |
CmdS | Save Font… | |
ShiftCmdS | Save Font As… | |
CmdE | Export Font As | |
CtrlD | Import > Artwork… | |
AltCtrlF | Font Info… | |
CmdP | Print… | |
Edit | CmdZ | Undo |
ShiftCmdZ | Redo | |
CmdX | Cut | |
CmdC | Copy | |
AltCmdC | Copy Layer | |
Backspace | Delete | |
CmdV | Paste | |
CmdD | Duplicate | |
CmdA | Select All | |
CmdI | Invert Selection | |
AltCmdV | Paste Special… | |
ShiftCmdV | Paste Element | |
AltCmdE | Edit Across Glyphs | |
CmdF | Find Glyphs… | |
CtrlF | Find Outline… | |
CmdL | List Related Glyphs… | |
Text | ] | Next in Text |
[ | Previous in Text | |
Ctrl] | Next Line | |
Ctrl[ | Previous Line | |
CmdPage Down | Next Phrase | |
CmdPage Up | Previous Previous | |
Font | AltCmdG | Generate Glyphs… |
AltCmdM | Update Metrics | |
Glyph | Cmd | Rename Glyph… |
ShiftCmdD | Duplicate Glyph | |
Cmd] | Next Glyph | |
Cmd[ | Previous Glyph | |
ShiftCmdN | Add Layer… | |
Alt. | Next Layer | |
Alt, | Previous Layer | |
ShiftCtrlA (AltIns) | Add Component… | |
CtrlR | Add Anchor | |
ShiftCmdW | Add Power Guides | |
ShiftCmdE | Create Overlaps | |
Element | CtrlS | New Element |
CtrlI | Add Element Reference… | |
CtrlL | Locked | |
CtrlE | Edit Element | |
AltCmdU | Unlink References | |
CtrlP | Place As Glyphs > Current Element… | |
ShiftCmd] | Arrange > Bring to Front | |
AltCmd] | Arrange > Bring Forward | |
ShiftCmd[ | Arrange > Send to Back | |
AltCmd[ | Arrange > Send Backward | |
CmdG | Group | |
ShiftCmdG | Ungroup | |
> | Next Element | |
< | Previous Element | |
CtrlC | Combine Contours to Element | |
ShiftCmdA | Glue Selection | |
ShiftCtrlB | Make Power Brush | |
CtrlCmdU | Expand Filters | |
CtrlN | New Pin | |
CtrlT | New Sticker | |
H | Preview Rounding | |
Contour | ShiftC | Power Nudge |
AltCmdX | X-Servant | |
AltCmdY | Y-Servant | |
ShiftCmd3 | To PS Curves | |
ShiftCmd2 | To TT Curves | |
ShiftCmdB | Unlink Corners | |
ShiftCmdO | Make Overlap | |
CmdB | Break | |
CmdJ | Join | |
| | Align | |
AltCmdL | Edit Tunni Lines | |
AltCmdA | Add Smart Corner | |
AltCmdI | Reverse Contour | |
AltCmdB | Simplify | |
AltCmdJ | Nodes at Extremes | |
CmdF10 | Remove Overlap | |
Tools | CmdT | Free Transform |
W | Transform > Flip Horizontal | |
E | Transform > Flip Vertical | |
CtrlH | Edit Mask | |
CmdM | Copy Outline to Mask | |
CtrlAltH | Swap Outline with Mask | |
CmdK | Clear Mask | |
ShiftCmdM | Copy Outline to Global Mask | |
ShiftCmdK | Clear Global Mask | |
CtrlX | Add Horizontal Hint | |
CtrlY | Add Vertical Hint | |
F7 | Autohinting | |
ShiftF7 | Remove Hints | |
ShiftCmdF7 | TrueType Hinting | |
CtrlA | Rewind > Record | |
CtrlV | Rewind > Rewind | |
CtrlB | Rewind > Fast Forward | |
ShiftCmdP | Commands | |
View | Cmd+ | Zoom In |
Cmd- | Zoom Out | |
Cmd0 | Fit Content on Screen | |
Cmd9 | Fit Text on Screen | |
Cmd1 | Actual Text Size | |
Cmd2 | Zoom 50% | |
Cmd3 | Zoom 100% | |
Cmd6 | Zoom 200% | |
Cmd7 | Zoom 400% | |
Cmd5 | Zoom 1:1px | |
CmdR | Rulers | |
ShiftCmdU | Suggest Nodes | |
Cmd; | Glyph Guides | |
ShiftCmd; | Font Guides | |
L | Tunni Lines | |
CtrlAltC | Coordinates | |
ShiftCmdF | FontAudit | |
Cmd' | Grid | |
ShiftCmdH | Hints | |
CtrlAltN | Nodes | |
AltCmd' | Snap > Outline | |
CmdF9 | Snap > Guides | |
ShiftCmdF9 | Snap > Font Guides | |
ShiftCmd' | Snap > Grid | |
AltCmd; | Lock > Glyph Guides | |
AltShiftCmd; | Lock > Font Guides | |
ShiftCmdR | Element Frame | |
ShiftSpace | True Fill | |
Apply Italic Angle | ||
Window | AltShiftCmdM | New Metrics Tab |
AltShiftCmdK | New Kerning Tab | |
AltCmdP | Preview panel | |
AltCmdT | Transform panel | |
Cmd` | Next Window | |
ShiftCmd` | Previous Window | |
AltTab | Next Tab | |
AltShiftTab | Previous Tab | |
CmdW | Close Tab/Window |
Of all the shortcuts listed above, Nodes and Coordinates are Mac-only shortcuts, and cannot be translated to Windows.
See also keyboard shortcuts for tools.