Skip to content

Instantly share code, notes, and snippets.

@mrcaron
Created September 21, 2010 13:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrcaron/589687 to your computer and use it in GitHub Desktop.
Save mrcaron/589687 to your computer and use it in GitHub Desktop.
.vimrc
# .vimrc
filetype off
filetype plugin indent on
set nocompatible
set modelines=0
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
set encoding=utf-8
set scrolloff=3
set autoindent
set showmode
set showcmd
set hidden
set wildmenu
set wildmode=list:longest
set visualbell
set cursorline
set ttyfast
set ruler
set backspace=indent,eol,start
set laststatus=2
set relativenumber
set undofile
let mapleader = ","
nnoremap / /\v
vnoremap / /\v
set ignorecase
set smartcase
set gdefault
set incsearch
set showmatch
set hlsearch
nnoremap <leader><space> :noh<cr>
nnoremap <tab> %
vnoremap <tab> %
set wrap
set textwidth=79
set formatoptions=qrn1
set colorcolumn=85
" remap j and k so that behavior is screen-specific, not line specific
nnoremap j gj
nnoremap k gk
" remap help key
inoremap <F1> <ESC>
nnoremap <F1> <ESC>
vnoremap <F1> <ESC>
" remap ';' to ':' in normal mode
nnoremap ; :
" save on focus lost
au FocusLost * :wa
" use ',ev' for editing ~\_vimrc
nnoremap <leader>ev <C-w><C-v><C-l>:e $MYVIMRC<cr>
" remap 'jj' to the Escape key in insert mode
inoremap jj <ESC>
" make a new key to open a window split
nnoremap <leader>w <C-w>v<C-w>l
" map keys for window navigation
nnoremap <C-h> <C-w>h
nnoremap <C-h> <C-w>j
nnoremap <C-h> <C-w>k
nnoremap <C-h> <C-w>l
" Set up the color
if has('gui_running')
set guifont=Mensch:h10
colorscheme molokai
set background=dark
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment