Site Tools


knowledgebase:linux:vim

This is an old revision of the document!


Some VIM tips & tricks

Setup VIM:

1 ) Create the following file structure in your homedirectory:

.vim/
 ├── autoload/
 ├── backup/
 ├── colors/
 └── plugged/
mkdir -p ~/.vim ~/.vim/autoload ~/.vim/backup ~/.vim/colors ~/.vim/plugged

2) Create a .vimrc file in your home directory

touch ~/.vimrc

3) Add the following lines to your .vimrc file:

#Disable compatibility with vi which can cause unexpected issues.
set nocompatible

#Enable type file detection. Vim will be able to try to detect the type of file in use.
filetype on

#Enable plugins and load plugin for the detected file type.
filetype plugin on

#Load an indent file for the detected file type.
filetype indent on

From command mode

command result
 :help rtp
show runtime path; shows directories where VIM will look for a .vimrc file
knowledgebase/linux/vim.1667229628.txt.gz · Last modified: (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki