Professional Documents
Culture Documents
1. Write down a list of different Vim Shortcuts/Commands and mention briefly their usage.
Note: For using commands, make sure that the vim operates in either Escape mode or the
Visual mode. For entering into the Escape mode we need to press the ‘Escape’ key only and
for the Visual mode we need to press the ‘CTRL + q’ key.
2. Write down a list of minimum 50 vimrc commands which may be needed permanently.
For making any changes in vimrc file first copy it some other directory instead of home
directory so that desired changes can be done. After doing that paste the modified vimrc in
place of original vimrc in the home directory.
Sl No. Command Description
1 Set autoindent New lines inherit the indentation of previous lines
2 Set expandtab Convert tabs into spaces
3 Set filetype indent on Enable indentation rules that are file-type specific
4 Set shiftround When shifting lines, round the indentation to the nearest multiple of
“shiftwidth”
5 Set shiftwidth=4 When shifting, indent using four spaces
6 Set smarttab Insert “tabstop” number of spaces when the “tab” key is pressed
7 Set tabstop=4 Indent using four spaces
8 Set hlsearch Enable search highlighting
9 Set ignorecase Ignore case when searching
10 Set incsearch Incremental search that shows partial matches
11 Set smartcase Automatically switch search to case-sensitive when search query
contains an uppercase letter
12 Set complete-=i Limit the files searched for auto-completes
13 Set lazyredraw Don’t update screen during macro and script execution
14 Set display+=lastline Always try to show a paragraph’s last line
15 Set encoding=utf-8 Use an encoding that supports Unicode
16 Set linebreak Avoid wrapping a line in the middle of a word
17 Set scrolloff=1 The number of screen columns to keep to the left and right of the
cursor
18 Syntax enable Enable syntax highlighting
19 Set wrap Enable line wrapping
20 Set laststatus=2 Always display the status bar
21 Set ruler Always show cursor position
22 Set wildmenu Display command line’s tab complete option as a menu
23 Set tabpagemax=50 Maximum number of tab pages that can be opened from the command
line
24 Set colorscheme <color> Change color scheme
25 Set cursorline Highlight the line currently under cursor
26 Set number Show the line numbers on the sidebar
27 Set relativenumber Show the line number on the current line and relative numbers on all
other lines
28 Set noerrorbells Disable beep on errors
29 Set visualbell Flash the screen instead of beeping on errors
30 Set mouse=a Enable mouse for scrolling and resizing
31 Set title Set the window’s title, reflecting the file currently being edited
32 Set background=dark Use colors that suit a dark background
33 Set foldmethod=indent Fold based on indentation levels
34 Set foldnestmax=3 Only fold up to three nested levels
35 Set nofoldenable Disable folding by default
36 Set autoread Automatically re-read files if unmodified inside Vim
37 Swt Allowbackspacing over indentation, line breaks and insertion start
backspace=indent,eol,start
38 Set bakupdir=~/.cache/vim Directory to store backup files
39 Set confirm Display a confirmation dialog when closing an unsaved file.
40 set dir=~/.cache/vim Directory to store swap files
41 Set formatoptions+=j Delete comment characters when joining lines
42 Set hidden Hide files in the background instead of closing them
43 Set history=1000 Increase the undo limit
44 Set nomodeline Ignore file’s mode lines; use vimrc configurations instead
45 Set noswapfiles Disable swap files
46 Set nrformats-=octal Interpret octal as decimal when incrementing numbers
47 Set shell The shell used to execute commands
48 Set spell Enable spell checking
49 Set wildignore+=.pyc,.swp Ignore files matching these patterns when opening files based on a
glob pattern
50 Set autowrite Automatically save before command like :next and :make
3. Install minimum 5 Plugins and describe briefly about each one.
The methods that I have used is PlugInstall method. The steps of installation are given
below:
• First of all we need to install ‘vim.plug’ in our home directory, for that we need to
make a directory in our $HOME folder where all the vim files are stored. To know
the location of the vim’s home directory just type ‘:echo $HOME’ in vim, it will give
you the home file path.
• Or we can run the following lines of codes in the windows powershell:
md ~\vimfiles\autoload
$uri = 'https://raw.githubusercontent.com/junegunn/vim-
plug/master/plug.vim'
(New-Object Net.WebClient).DownloadFile(
$uri,
$ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSP
ath(
"~\vimfiles\autoload\plug.vim"
)
)
• After creation of home directory, next we need to go to our vimrc and perform the
following steps:
➢ begin the selection with ‘call plug#begin()’
➢ List all the Plug commands (for example: Plug 'morhetz/gruvbox')
➢ ‘call plug#end()’ to update &runtimepath and initialize plugin system
• Now type’:PlugInstall’ in the vimrc and wait for the plugins to finish installing.
Completion (omni-completion)
Navigate to the location where a symbol is defined.
Show location(s) where a symbol is referenced.
Display a list of syntax and semantics errors to Vim
quickfix window.
and so on,,,
5 Ctrlp.vim Full path fuzzy file, buffer, mru, tag, ... finder for Vim.