Skip to content

Instantly share code, notes, and snippets.

@Quinten
Last active January 6, 2016 12:50
Show Gist options
  • Save Quinten/bde17c2002e1168ac028 to your computer and use it in GitHub Desktop.
Save Quinten/bde17c2002e1168ac028 to your computer and use it in GitHub Desktop.
fun with visual selections in vim (on mac)

fun with visual selections in vim (on mac)

Math

In insert mode type some math like 2+2

Then switch to visual mode and select it.

With visual mode still active type !bc

Your selection is now replaced by the result.

text to speech

In visual mode select a sentence somewhere in a file.

With visual mode still active type :w !say

The computer should read your text out loud.

If you want the computer to read out loud the whole file type :%w !say

Tips

Tip: By typing :w before the command you avoid that the selection is replaced by the output of the command.

Tip 2: This also works with other shell commands, but bc and say seemed cool to note here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment