Skip to content
Low Jun Kai, Sean edited this page Jan 1, 2021 · 1 revision

Setting Up Vim


This only applies to Windows Users.

You can get the recommended .vimrc file here

If you are a Mac User, you will most likely have Vim pre-installed.

If you wish to have MacVim Installed (similar functionality to gVim), please refer to here!

  1. To download the vim installer, go to the link here

vimGuide01

  1. Follow the instructions in the installer.

vimGuide02

  1. To check if you have vim installed, simple type vim -version on your terminal.

vimGuide03

Working with .vimrc file

After downloading the .vimrc file,

For Windows Users if you have followed the other guides closely in installing Vim, proceed to

C:\Users\[WIN_USERNAME]\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState\rootfs\home\[UBUNTU_USERNAME]

Alternatively, Win-Key + R and type in %appdata% (case insensitive), and navigate to the path above.

From there, copy the downloaded .vimrc file and place it into the path (image below for reference).

image

For permissions denied after executing vim ~/.vimrc (if you drag and drop the .vimrc file from this repository),

Enter command sudo chmod 777 ~/.vimrc to give excess full access (Read, Write and Execute).

If you encounter this error, E488: Trailing characters: nocompatible^M due to the line endings of Windows and Ubuntu being different OR copying and pasting from the .vimrc file in this repository into a self-created .vimrc file in your Ubuntu system,

image

Proceed to perform these steps (in the Command Line):

  1. vim ~/.vimrc, press Enter to go into the Vim Editor
  2. :w! ++ff=unix this command changes the file's (.vimrc) format to unix.

Conversion of File Formats (Stack Overflow)