Personal blog written from scratch using Node.js, Bootstrap, and MySQL. https://jrtechs.net
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

1.7 KiB

Vim Introduction

Appearance

syntax enable
" Enable 256 colors palette in Gnome Terminal
if $COLORTERM == 'gnome-terminal'
    set t_Co=256
endif

try
    colorscheme desert
catch
endtry

set background=dark

" Set extra options when running in GUI mode
if has("gui_running")
    set guioptions-=T
    set guioptions-=e
    set t_Co=256
    set guitablabel=%M\ %t
endif

Spell Check

autocmd BufRead,BufNewFile *.md setlocal spell spelllang=en_us
autocmd BufRead,BufNewFile *.txt setlocal spell spelllang=en_us

Indentation and Tabs

" search as characters are entered
set incsearch
" highlight matched characters
set hlsearch

" Ignore case when searching
set ignorecase

Useful UI Tweaks

" Set Line Numbers to show
set number

" Highlights the current line with a underscore
set cursorline

" Displays a red bar at 80 characters
set colorcolumn=80

Searching and Auto Complete

" Shows a auto complete tab when you are typing a command
" like :sp <tab>
set wildmenu
set wildignorecase

"  Searching when in command mode type /words to find
" search as characters are entered
set incsearch
" highlight matched characters
set hlsearch

" Ignore case when searching
set ignorecase

Useful Things to Have

"Disable ding sound on error, flashes cursor instead
set visualbell

" Display ruler on bottom right -- should be there by default
set ruler

" Enables mouse support
set mouse=a

" Auto updates file if an external source edits the file
set autoread

" Improves performance by only redrawing screen when needed
set lazyredraw
" Set utf8 as standard encoding and en_US as the standard language
set encoding=utf8

" Use Unix as the standard file type
set ffs=unix,dos,mac