« Back to Index

Basic Vim config for when ssh’ed onto an EC2 instance (yum install vim -y)

View original Gist on GitHub

1. alias.bash

alias vi='vi -c "set nocompatible" -c "set number" -c "set cursorline" -c "set expandtab" -c "set hlsearch" -c "set visualbell" -c "set tabstop=2" -c "set shiftwidth=2" -c "syntax on"'

basic-vim.vim

set nocompatible number cursorline expandtab hlsearch visualbell tabstop=2 shiftwidth=2
syntax on

" Stops odd issues like using arrow keys in insert mode will send key sequences that are misinterpreted by vi
" Turn on line numbers
" Highlight the current line
" Convert tabs to spaces
" Highlight all search matches
" Stop Vim from beeping at you when you make a mistake
" Set tab size in spaces (this is for manual indenting)
" The number of spaces inserted for a tab (used for auto indenting)
" Enable basic syntax highlighting

create-vimrc.bash

# You can also do the following:
echo set nocompatible number cursorline expandtab hlsearch visualbell tabstop=2 shiftwidth=2 >> ~/.vimrc
echo syntax on >> ~/.vimrc