vim

Displaying 1 - 4 of 4

List of all Vim script events

To get an idea of what Vimscript is capable of, take a look at all the events it can react to because basically your script won't do much except when something happens (usually caused by the user) and your script reacts. For example, do something when opening a file, or highlighting a word, or hitting some trigger key. You don't want your script to just be running constantly in a loop in the background, and you also don't want it to stall Vim during its handling of events, including at startup. If you go through Vim's built-in documentation you can find the list of events but I've created...

Vim is grep, and more vim search tips

Something I learned the other day blew my mind even after years of using VI/vim. Because I'd also been using grep for years.

The name 'grep' comes from the vi command g/re/p

g in ex-mode of vi means 'global', so any :g command will apply to all the text in the current buffer.

p after 're' means print.

're' in g/re/p actually just means a regular expression should go there (a vim regular expression, which is different fromregex in PHP or even a re string in grep - this is where vim magic modes...

Vim windows and window-splitting

A lifechanging feature of Vim for me was the window-splitting feature. In MacVim, you can even access a tiny slice of this through the Apple menu (File -> Split-Open). So you can view multiple files in other "windows" in the same Vim session. In fact, you can view the same file at different lines in different windows. And you can split windows both vertically (side by side) and horizontally (default). You can split already split...

Quickly start using Vim (and MacVim)

You've decided learning vi/vim is a good idea. You've heard it can be intimidating at first. But you know often times tools with steep learning curves are worth learning. You probably already have vim installed but if you're on Mac you should get MacVim as well: https://github.com/macvim-dev/macvim

Start vim (I mean just type 'vim' or 'vim <filename>' in a terminal. 

1. Don't start typing yet. Press 'i' to go into insert mode where you can just type and text appears like any normal text editor. Just stay in this

...