.vimrc
Configuration
=============
set nocompatible
filetype on
filetype plugin on
filetype indent on
syntax on
set number
set cursorcolumn
set shiftwidth=4
set tabstop=4
set scrolloff=10
set incsearch
set ignorecase
set smartcase
set showcmd
set showmode
set showmatch
set hlsearch
set history=1000
set colorcolumn=78
set laststatus=2
set ruler
set list
set spell spelllang=en_us
Delete empty spaces at beginning
================================
:%s/^\s\+//e
Delete empty spaces at end
================================
:%s/\s\+$//e
Copy lines
==========
yy -- copy line
p -- past line
d -- delete line
v -- visual mode
yiw -- copy current word
Copy all content to clipboard
=============================
:%y+
Search forward in file
======================
/ -- search word
n/N -- next/previous word
Search backward in file
======================
? -- search word
n/N -- next/previous word
Search ignore lowercase
=======================
/word\c -- case insensitive
/word\C -- case sensitive
Encrypt file
============
:X -- set password
(Set empty pwd to delete key)
Set as default editor
=====================
sudo update-alternatives --config editor