- This is the default mode in which Vim starts up. Insert mode is the mode where you insert/write your text. Visual mode is where you visually select a bunch of text so that you can run a command/operation only on that part of the text. Basic Vim Commands. Let’s start with an easy set of Vim commands to open, save, and exit Vim.
- Apple offers a PDF cheat sheet for Mac users to print out and fill in in case they need to call in for service. The 'My Mac Cheat Sheet' even offers spaces to write down Keychain and email passwords.
Congratulate yourself on choosing Mac OS X, the Macintosh Operating System X — that’s the Roman numeral ten. Upgrade to Mac OS X Lion, and get new features that make your Mac easier to use and improvements that make you more productive.
Vim editor is a more enhanced version of the venerable VI Editor. The Vim Editor, a cross-platform text editor, is a very lightweight, efficient, highly configurable and powerful tool. The Vim helps you to work with more than one document at a time, and it can do extraordinary things without a mouse. List of Vim Shortcuts – Vim Cheat sheet. Vi Cheat Sheet (PDF)Download Vim Cheat Sheet (PDF) Download Share this: Facebook Twitter LinkedIn Pocket Related Categories: Linux Tagged With: Cheat sheet, downloads, linux, vim, Web Programming Give me your feedback Cancel reply. Neovim Cheat Sheet. A modern and customizable take on the excellent viemu cheat sheet, supporting vanilla QWERTY as well as alternative keyboard layouts such as Colemak and Dvorak. Project genesis. When I was first learning neovim, having a cheatsheet was incredibly helpful. There are many excellent ones online, but most of them were.
Top Six Things You Should Never Do with Your Mac
Here’s how to treat your Mac with care — especially if it’s loaded with Mac OS X Lion. Never do these six things with your Mac, MacBook, or MacBook Pro:
- Never clean your monitor with Windex (or another product not designed to be used on a video display). And nix the paper towels and tissues, too. Use a soft cloth (microfiber is best) if you want to avoid scratching the display.
- Never pay attention to anyone who says that PCs are just like the Mac. Yeah, right. And Kia is the Asian cousin of BMW.
- Never bump, drop, shake, wobble, dribble, drop-kick, or play catch with a hard drive while it’s running Lion. Don’t forget: Your desktop Mac has a hard drive inside it, too.
- Never shut off your Mac by pulling the plug. Always use the Shut Down command from the Apple menu in Lion (or press the Power button and then click the Shut Down button).If you’re using a laptop, you can usually get away with pulling the plug while it’s running. The only caveat is that if your battery is totally depleted, damaged, or missing entirely, you could suffer directory damage or data loss by pulling the plug. Just use the Shut Down command and you’ll sleep well.
- Never get up from your Mac without saving your work. Just before your behind leaves the chair, your fingers should be pressing Command+S (which is the keyboard shortcut in Mac OS X Lion that saves your work). Make it a habit.
- Never keep only one copy of your important documents. Make at least two backup copies and keep one of them in another location. Period.
Five Awesome Websites for Mac OS X and Lion Lovers
Want to know how to find out about all things Macintosh? Hop onto the Web to check these Apple-related sites and stuff your brain with information about your Mac and Mac OS X Lion:
- The Apple support site and Knowledge Base are treasure troves of tech notes, software update information, troubleshooting tips, and documentation for most Apple products.
- MacInTouch is the preeminent Mac news and information site, full of tips, hints, and troubleshooting information. Many users consider MacInTouch (along with MacSurfer and MacFixit) a must-read every day.
- CNET Downloads, the site formerly known as VersionTracker, is the place to go to find freeware, shareware, and software updates for Mac OS X. If this site doesn’t have it, it probably doesn’t exist.
- Alltop aggregates information from dozens of great Mac-oriented Web sites and makes it easy to skim headlines and story summaries. You can even build your own custom version that contains only sites you want to see.
- TidBITS bills itself as, “Apple news for the rest of us,” but there’s much more to TidBITS than just the news. You can also find thoughtful commentary, in-depth analysis, and detailed product reviews, written and edited by pros who really know the Apple ecosystem.
Mac OS X Lion Keyboard Shortcuts
All these Mac OS X Lion shortcuts work in the Finder, and many work in other programs you find in Mac OS X Lion, as well. Want to know how to make these shortcuts second nature? Print out this chart and tape it to your monitor where you’ll see it while using Mac OS X Lion.
Command | Keyboard Shortcut |
---|---|
Add Selected Item to Sidebar | Command+T |
Close All Windows | Option+Command+W |
Close Window | Command+W |
Copy | Command+C |
Cut | Command+X |
Dashboard | F12 (fn+F12 on laptops) |
Duplicate | Command+D |
Eject Disk | Command+E |
Empty Trash | Shift+Command+Delete |
Find | Command+F |
Get Info (on selected item or items) | Command+I |
Go to All My Files | Shift+Command+F |
Go to Applications Folder | Shift+Command+A |
Go to Desktop | Shift+Command+D |
Go to Home Folder | Shift+Command+H |
Help | Shift+Command+? |
Hide Current Application | Command+H |
Log Out Current User | Shift+Command+Q |
Make Alias | Command+L |
Minimize Window | Command+M |
Mission Control: All Windows | Control+Up Arrow (F3 on Apple keyboards) |
Mission Control: Application Windows | Control+Down Arrow (Control+F3 on Apple keyboards) |
Mission Control: Show Desktop | F11 (fn+F11 on laptops) (Command+F3 on Apple keyboards) |
Move to Trash | Command+Delete |
Empty Trash | Shift+Command+Delete |
New Finder Window | Command+N |
New Folder | Shift+Command+N |
New Smart Folder | Option+Command+N |
Next Window | Command+` |
Open | Command+O |
Open Inspector | Option+Command+I |
Paste | Command+V |
Quick Look (at selected item) | Command+Y or Spacebar |
Select All | Command+A |
Show Original (of selected alias) | Command+R |
Show View Options | Command+J |
Show/Hide Sidebar | Option+Command+S |
Show/Hide Dock | Option+Command+D |
Show/Hide Status Bar | Command+/ |
Turn VoiceOver On/Off | Command+F5 (fn+F5 on laptops) |
Turn Zoom On/Off | Option+Command+8 |
Undo | Command+Z |
View Window as Icons | Command+1 |
View Window as List | Command+2 |
View Window as Columns | Command+3 |
View Window as Cover Flow | Command+4 |
Note: If you’re decent at Vim and want your mind blown, check out Advanced Vim.
I’ve compiled a list of essential Vim commands that I use every day. I have then given a few instructions on how to make Vim as great as it should be, because it’s painful without configuration.
Cursor movement (Inside command/normal mode)
w
- jump by start of words (punctuation considered words)W
- jump by words (spaces separate words)e
- jump to end of words (punctuation considered words)E
- jump to end of words (no punctuation)b
- jump backward by words (punctuation considered words)B
- jump backward by words (no punctuation)0
- (zero) start of line^
- first non-blank character of line (same as 0w)$
- end of line- Advanced (in order of what I find most useful)
Ctrl+d
- move down half a pageCtrl+u
- move up half a page}
- go forward by paragraph (the next blank line){
- go backward by paragraph (the next blank line)gg
- go to the top of the pageG
- go the bottom of the page: [num] [enter]
- Go to that line in the document- Searching
f [char]
- Move to the next char on the current line after the cursorF [char]
- Move to the next char on the current line before the cursort [char]
- Move to before the next char on the current line after the cursorT [char]
- Move to before the next char on the current line before the cursor- All these commands can be followed by
;
(semicolon) to go to the next searched item, and,
(comma) to go the previous searched item
Insert/Appending/Editing Text
- Results in Insert mode
i
- start insert mode at cursorI
- insert at the beginning of the linea
- append after the cursorA
- append at the end of the lineo
- open (append) blank line below current line (no need to press return)O
- open blank line above current linecc
- change (replace) an entire linec [movement command]
- change (replace) from the cursor to the move-to point.- ex.
ce
changes from the cursor to the end of the cursor word
Esc
orCtrl+[
- exit insert moder [char]
- replace a single character with the specified char (does not use Insert mode)d
- deleted
- [movement command] deletes from the cursor to the move-to point.- ex.
de
deletes from the cursor to the end of the current word
dd
- delete the current line- Advanced
J
- join line below to the current one
Marking text (visual mode)
v
- starts visual mode- From here you can move around as in normal mode (
h
,j
,k
,l
etc.) and can then do a command (such asy
,d
, orc
)
- From here you can move around as in normal mode (
V
- starts linewise visual modeCtrl+v
- start visual block modeEsc
orCtrl+[
- exit visual mode- Advanced
O
- move to other corner of blocko
- move to other end of marked area
Visual commands
Type any of these while some text is selected to apply the action
y
- yank (copy) marked textd
- delete marked textc
- delete the marked text and go into insert mode (like c does above)
Cut and Paste
yy
- yank (copy) a linep
- put (paste) the clipboard after cursorP
- put (paste) before cursordd
- delete (cut) a linex
- delete (cut) current characterX
- delete previous character (like backspace)
Exiting
:w
- write (save) the file, but don’t exit:wq
- write (save) and quit:q
- quit (fails if anything has changed):q!
- quit and throw away changes
Search/Replace
/pattern
- search for pattern?pattern
- search backward for patternn
- repeat search in same directionN
- repeat search in opposite direction:%s/old/new/g
- replace all old with new throughout file (gn is better though):%s/old/new/gc
- replace all old with new throughout file with confirmations
Working with multiple files
:e filename
- Edit a file:tabe
- Make a new tabgt
- Go to the next tabgT
- Go to the previous tab- Advanced
:vsp
- vertically split windowsctrl+ws
- Split windows horizontallyctrl+wv
- Split windows verticallyctrl+ww
- switch between windowsctrl+wq
- Quit a window
Marks
Marks allow you to jump to designated points in your code.
m{a-z}
- Set mark {a-z} at cursor position- A capital mark {A-Z} sets a global mark and will work between files
‘{a-z}
- move the cursor to the start of the line where the mark was set‘’
- go back to the previous jump location
General
u
- undoCtrl+r
- redo.
- repeat last command
Vim is quite unpleasant out of the box. For example, typing
:w
for every file save is awkward and copying and pasting to the system clipboard does not work. However, a few changes will get you much closer to the editor of your dreams..vimrc
![Pdf Pdf](/uploads/1/1/9/0/119032484/180973376.png)
- My .vimrc file has some pretty great ideas I haven’t seen elsewhere.
- This is a minimal vimrc that focuses on three priorities:
- adding options that are strictly better (like more information showing in autocomplete)
- more convenient keystrokes (like
[space]w
for write, instead of:w [enter]
) - a similar workflow to normal text editors (like enabling the mouse)
Installation
Vim Cheat Sheet Pdf For Mac Os
- Copy this to your home directory and restart Vim. Read through it to see what you can now do (like
[space]w
to save a file)- Mac users - making a hidden normal file is suprisingly tricky. Here’s one way:
- in the command line, go to the home directory
- type
nano .vimrc
- paste in the contents of the .vimrc file
ctrl+x
,y
,[enter]
to save
- Mac users - making a hidden normal file is suprisingly tricky. Here’s one way:
- You should now be able to press
[space]w
in normal mode to save a file. [space]p
should paste from the system clipboard (outside of Vim).- If you can’t paste, it’s probably because Vim was not built with the system clipboard option. To check, run
vim --version
and see if+clipboard
exists. If it says-clipboard
, you will not be able to copy from outside of Vim. - For Mac users, homebrew install Vim with the clipboard option. Install homebrew and then run
brew install vim
.- then move the old Vim binary:
$ mv /usr/bin/vim /usr/bin/vimold
- restart your terminal and you should see
vim --version
now with+clipboard
- then move the old Vim binary:
- If you can’t paste, it’s probably because Vim was not built with the system clipboard option. To check, run
Plugins
- The easiest way to make Vim more powerful is to use Vintageous in Sublime Text (version 3). This gives you Vim mode inside Sublime. I suggest this (or a similar setup with the Atom editor) if you aren’t a Vim master. Check out Advanced Vim if you are.
- Vintageous is great, but I suggest you change a few settings to make it better.
- Clone this repository to
~/.config/sublime-text-3/Packages/Vintageous
, or similar. Then check out the “custom” branch.- Alternatively, you can get a more updated Vintageous version by cloning the official repository and then copying over this patch.
- Change the user settings (
User/Preferences.sublime-settings
) to include:'caret_style': 'solid'
- This will make the cursor not blink, like in Vim.
- Sublime Text might freeze when you do this. It’s a bug; just restart Sublime Text after changing the file.
ctrl+r
in Vim means “redo”. But there is a handy Ctrl + R shortcut in Sublime Text that gives an “outline” of a file. I remapped it to alt+r by putting this in the User keymap{ 'keys': ['alt+r'], 'command': 'show_overlay', 'args': {'overlay': 'goto', 'text': '@'} },
- Mac users: you will not have the ability to hold down a navigation key (like holding j to go down). To fix this, run the commands specified here: https://gist.github.com/kconragan/2510186
- Clone this repository to
- Now you should be able to restart sublime and have a great Vim environment! Sweet Dude.
Switch Caps Lock and Escape
- I highly recommend you switch the mapping of your caps lock and escape keys. You’ll love it, promise! Switching the two keys is platform dependent; Google should get you the answer.
Other
Vim Cheat Sheet Pdf
I don’t personally use these yet, but I’ve heard other people do!
Printable Vim Cheat Sheet Pdf
:wqa
- Write and quit all open tabs (thanks Brian Zick)