Select the block of text:
1. Position the cursor at the beginning of the text you want to replace
2. Press v to enter visual mode. (or upper case V to select whole lines, or Ctrl-v for a vertical block).
3. Move the cursor to the end of the text to be replaced. (While selecting text, you can perform searches and other advanced movement, a feature that sets vim apart from most other editors.)
4. Press c. This deletes the selection and leaves you in insert mode.
5. Type your replacement text.
The selection is done in visual mode.
To cut (or copy) and paste using visual selection:
1. Position the cursor at the beginning of the text you want to cut/copy.
2. Press v to begin character-based visual selection (or upper case V to select whole lines, or Ctrl-v for a vertical block).
3. Move the cursor to the end of the text to be cut/copied. (While selecting text, you can perform searches and other advanced movement, a feature that sets vim apart from most other editors.)
4. Press d (as in “delete”) to cut, or y (as in “yank”, which I imagine meaning “yank so hard and fast that it leaves a copy behind”) to copy.
5. Move the cursor to the desired paste location.
6. Press p to paste after the cursor, or P to paste before it.
Bonus Tip: To replace the selected text with new text (to be entered by you), press c instead of d or y on step 4. This deletes the selection and leaves you in insert mode. Then, instead of (or prior to) steps 5-6, type your replacement text.
Recording is a really useful feature of Vim.
You start recording by pressing “Q” key followed by any other letter keystroke, and you can end it by typing “Q” again.
It records everything you type. You can then replay it simply by typing “@“ followed by the letter.
Record search, movement, replacement…
This is one of the best features of Vim.
One more thing to note is that you can hit any number before the “@“ to replay the recording that many times like (100@<letter>) will play your recorded actions 100 times.
The Scenario is This:
I have a Bose Mini SoundLink bluetooth speaker and a headset connected to my MacBook. Normally you can only have one device making sound and can switch between them.
This is a native utility tool, Audio MIDI Setup, on OS X, that let you take advantage of multiple inputs and outputs.
Continue reading “How to Use Multiple Audio Outputs on Mac”
I have run out of space on my Win8 virtual machine, which only assigned 15GB space when I created it. Is there an easy way to increase it to, say, 25GB? I can’t see any obvious option in VirtualBox settings.
Here is the solution:
Continue reading “How to increase the hard disk size of a VirtualBox virtual machine”
Note: Although Our tutorial uses RDP protocol to control Windows PC, the same idea also applies to remote control Mac or Linux with VNC protocol.
Allow Remote Connections on Windows
To access one computer from another, you first need to allow remote connections on the computer you want to access, which must be running one of the following versions of Windows:
Continue reading “How to remote control your PC from outside your home network”
When it comes to what is the best email client for Mac, everyone has their own preferences.
The best choice really depends on your needs. Every email client is designed to fulfill a specific group’s needs.
Here we compare three clients: native Apple Mail, Postbox, and Sparrow, from two main aspects: their costs and features worth considering. Continue reading “Best Email Client for Mac”
We can do this trick with a single terminal command.
first dive into the directory where the file is stored.
touch -t YYYYMMDDhhmmss fileName.extension
Done, if the time you entered is before the original created time, both created and modified time would be changed to the new time assigned. However, if the time you entered is after the original created time, only the modified time would be affected.
eg. There is a file, test.doc, on your Desktop. Continue reading “How to hack to change the created and modified date of a file”
sudo nvram boot-args="iog=0x0"
This reverses the “Clamshell” mode for Apple’s laptop systems, where when you close the display but connect the system to an external monitor and keyboard the system will stay awake. After running this command, when connecting an external monitor, the internal display will be disabled, which can be beneficial in some situations such as those where you are mirroring your desktop but wish to run the external display at a higher resolution than your laptop can run.
To disable these features and have the system boot normally without any extra options, you can erase them from the nvram by either resetting it or, more specifically, by running either of the following commands in the Terminal (these will reset the boot arguments instead of resetting all the nvram variables):
sudo nvram boot-args=""
sudo nvram -d boot-args
For further reading, check out Boot argument options in OS X from CNet to see all options you could operate on NVRAM.