From the course: Learning Vim
Unlock the full course today
Join today to access over 24,600 courses taught by industry experts.
Configuration files - vi Tutorial
From the course: Learning Vim
Configuration files
- [Instructor] Out of the box, Vim is very powerful, but one of Vim's main strengths is the amount of customization you can do. You can add commands, map keys, and even write extensions in various languages such as Vimscript, Python, and more. Depending on your operating system, Vim's configuration file will be in a different location. On Mac and Linux, it's .vimrc under your home directory. On windows, it will be c:/users/<yourlogin>_vimrc. If you work on many systems, try to avoid too much customization in your vimrc file. It will make it hard to use vanilla vim on other systems you are using. Vim users create their vimrc for years. Mine is 20 years in the making and I'm still tinkering with it. Let's try a small example. Vim hello.py. If you'd like to see line numbers, you can set his option with :set number and enter. :set can be abbreviated to :se and number can be abbreviated to nu. If you'd like to switch off line numbers, add the no before the option. Set, no, nu. And the line…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
(Locked)
Configuration files1m 57s
-
(Locked)
Challenge: Set line numbers5s
-
(Locked)
Solution: Set line numbers15s
-
(Locked)
Map keys1m 14s
-
(Locked)
Challenge: Map key6s
-
(Locked)
Solution: Map key19s
-
(Locked)
Abbreviations1m 47s
-
(Locked)
Challenge: Abbreviate email14s
-
(Locked)
Solution: Abbreviate email27s
-
(Locked)
Add commands1m 35s
-
Challenge: Create command15s
-
(Locked)
Solution: Create command27s
-
(Locked)
Various settings2m 46s
-
(Locked)
Challenge: Edit .vimrc10s
-
(Locked)
Solution: Edit .vimrc34s
-
(Locked)
-
-