-
Delete tiny vim and install vim version > 7
sudo apt-get remove vim vim-tiny sudo apt-get update sudo apt-get install vim- Now
vim, should display version > 7
- Now
-
Install the Vundle plugin manager for vim
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim -
Create a vimrc file with all the Plugins
- replace your ~/.vimrc file with the one available with this gist and save the file.
- Then open vim and run the command
:PluginInstall. Vundle should install all the plugins which may take a while. - Once it is done, it will indicate this at the bottom of the screen. You can then go ahead and close all screens using
:qall
-
Compile YouCompleteMe(python auto-completer)
- Now, if you open up any python file, you should get a warning saying that YouCompleteMe is not compiled and the server is down.
- To compile we first need cmake
sudo apt install build-essential cmake python3-dev - Then we cd into
~/.vim/bundle/YouCompleteMeand runpython3 install.py --clang-completer
-
To be able to use the flake8 linter plugin, make sure you have flake8 installed using
pip install flake8.
Usage:
-
Code Folding
- The code is automatically folded on opening.
- To open a section of the code, move the cursor to the folded text and press
zoin command mode. - To close(fold) the code, press
zc. :help fold-commandsfor the full set of commands
-
To run pep8 linting on the code, press F7. It lists the full set of issues with the code, use arrow keys to select and press enter to go to the issue.
-
To bring up the directory tree, you can press
ctrl+n. It brings up the current directory on the left of the current file. You can use arrows to select and press enter to choose a different file to open without closing the current file. To switch between choosing directory and editing file, you can pressctrl+h(to go left) andctrl+l(to go right).
For more customizations and options, check out the plugins: