There are billions and billions (yes, I’m channeling Carl Sagan a bit, here) of possible configuration combinations and they can be daunting to the new user, so I’m going to suggest using my configuration. Now that you’ve learned, or rediscovered, just how awesome Vim is, let’s customize it. You’ll need to either write the file with “:w” or use “:q!” (note the exclamation point) if you are sure you want to exit without saving.
#MAC VIM CONFIG FILES HOW TO#
One of the most important commands to know is how to exit. This mode is displayed at the bottom of the screen, but if you use my vim configuration enhancements described later in this article, this value will be easier to spot. If you are in insert mode, you hit ESC to issue commands, then use “a” or “I” to return to insert mode. If you need to paste the text multiple times, while in command mode, type the number (for example, 3), then press “p”. Now, position the cursor to where you want the text to be pasted, then press “p”. If you prefer to cut instead of copy, use “x”. You can select as little or as much text as you want, then hit “y” to “yank” the text to the clipboard. The “v” command brings you into visual mode, allowing you to highlight blocks of text with the arrow keys. Hit ESC to ensure you’re back in command mode and press “v”. Using the arrow keys, position the cursor at the beginning of the line you wish to copy. In Vim, this can all be done with the keyboard without your fingers straying too far from the home row. For example, let’s say you need to copy and paste text. But Vim’s command mode shines when you need extra functionality. If you simply loaded a text file and saved it, or just typed regular text and never needed any extra functionality, the modal interface may seem awkward and of limited use. In that case, you’d hit ESC to change modes, then type “:w filename” The “:w” is the command for writing a file, and the file you specify after that is where it is written. But eventually you’ll need to save your work. The rest of your Vim session could be like any other editor if you simply did nothing but enter text. To begin typing, you would press “a” or “I” to switch to insert mode to start typing text. When you start Vim, you are in command mode, where you can type characters to issue commands (more on this later). This interface works well for plain text files, but more complex work benefits from a modal editor. If you want to perform a special command, like highlight a certain area of text to copy it to the clipboard or reformat a section, you would use either the mouse or menu-driven commands. These editors simply allow for the input of text.
#MAC VIM CONFIG FILES WINDOWS#
Most editors, including Notepad included with Microsoft Windows or TextEdit included with macOS are modeless. We’ll expand on customizing it later, but for now, let’s focus on what sets Vim apart from most text editors - it’s interface. The ubiquitous nature of Vim is an important part of its success, but its two greatest strengths come from its unique modal interface and extreme flexibility.
#MAC VIM CONFIG FILES INSTALL#
MacOS comes with Vim pre-installed in Terminal, but if you want the GUI version, you’ll have to install MacVim. You can also type “vim” at the command or PowerShell prompt to run Vim in console mode, but for most users, GVim will be best. Three icons will be placed on your desktop, but the only one you really need is “GVim”. If you’re on Windows, Vim can be installed by simply downloading the setup package and running it. If not, run one of these commands: sudo apt install vim vim-gnome sudo yum install vim gvim If you’re on Linux, you likely already have Vim installed. It even runs on 16-bit DOS! Getting Vim Installed Let’s dig a bit deeper into the time capsule - Did you know that Vim was originally developed for the Commodore Amiga? It soon became cross platform, covering nearly every operating system that you can think of. Vim was developed by Brian Moolenaar as an improvement upon vi. You may even know it by its inspiration, vi, the text editor written by Bill Joy in 1976. If you have experience with any form of UNIX (Linux, FreeBSD, Solaris, etc.), then you undoubtedly have used, or at least heard of, Vim.