Skip to content

Instantly share code, notes, and snippets.

@jkubicek
Created January 7, 2012 04:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkubicek/1573826 to your computer and use it in GitHub Desktop.
Save jkubicek/1573826 to your computer and use it in GitHub Desktop.
My .vimrc
set nocompatible " choose no compatibility with legacy vi
syntax enable
set encoding=utf-8
set showcmd " display incomplete commands
filetype plugin indent on " load file type plugins + indentation
set relativenumber " line numbers start from 0 at current line
"" Whitespace
set nowrap " don't wrap lines
set tabstop=2 shiftwidth=2 " a tab is two spaces (or set this to 4)
set expandtab " use spaces, not tabs (optional)
set backspace=indent,eol,start " backspace through everything in insert mode
"" Searching
set hlsearch " highlight matches
set incsearch " incremental searching
set showmatch " help highlight searches
set ignorecase " searches are case insensitive...
set smartcase " ... unless they contain at least one capital letter
set gdefault " apply subtitutions globally on lines
nnoremap <leader><space> :noh<cr>
nnoremap <tab> %
vnoremap <tab> %
"" Wrapping
set wrap
set textwidth=79
set formatoptions=qrn1
"" Disable arrow keys
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
nnoremap j gj
nnoremap k gk
"" hit jj instead of exc
inoremap jj <ESC>
"" Let me hit ; instead of :
nnoremap ; :
"" Macros
"" leader key is now ,
let mapleader = ","
"" insert a row of = below the current line
nnoremap <leader>1 yypVr=
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment