Skip to content

Instantly share code, notes, and snippets.

@thogg4
Created November 7, 2012 07:07
Show Gist options
  • Select an option

  • Save thogg4/4029943 to your computer and use it in GitHub Desktop.

Select an option

Save thogg4/4029943 to your computer and use it in GitHub Desktop.
vimrc
call pathogen#runtime_append_all_bundles()
set noswapfile
filetype plugin indent on
" Make Vim remember cursor position
if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
\| exe "normal! g'\"" | endif
endif
" ----------------------------------------------------------------------------
" Text Formatting
" ----------------------------------------------------------------------------
set autoindent " automatic indent new lines
set smartindent " be smart about it
inoremap # X<BS>#
set nowrap " do not wrap lines
set softtabstop=2 " yep, two
set shiftwidth=2 " ..
set tabstop=4
set expandtab " expand tabs to spaces
set nosmarttab " fuck tabs
set formatoptions+=n " support for numbered/bullet lists
"set textwidth=80 " wrap at 80 chars by default
set virtualedit=block " allow virtual edit in visual block ..
" ----------------------------------------------------------------------------
" Remapping
" ----------------------------------------------------------------------------
" exit to normal mode with 'jj'
inoremap jj <ESC>
" reflow paragraph with Q in normal and visual mode
nnoremap Q gqap
vnoremap Q gq
" sane movement with wrap turned on
nnoremap j gj
nnoremap k gk
vnoremap j gj
vnoremap k gk
nnoremap <Down> gj
nnoremap <Up> gk
vnoremap <Down> gj
vnoremap <Up> gk
inoremap <Down> <C-o>gj
inoremap <Up> <C-o>gk
" ----------------------------------------------------------------------------
" UI
" ----------------------------------------------------------------------------
set ruler " show the cursor position all the time
set noshowcmd " don't display incomplete commands
set nolazyredraw " turn off lazy redraw
set number " line numbers
set wildmenu " turn on wild menu
set wildmode=list:longest,full
set ch=2 " command line height
set backspace=2 " allow backspacing over everything in insert mode
"set whichwrap+=<,>,h,l,[,] " backspace and cursor keys wrap to
set shortmess=filtIoOA " shorten messages
set report=0 " tell us about changes
set nostartofline " don't jump to the start of line when scrolling
colorscheme blacksea
set background=dark
syntax on
set pastetoggle=<Leader>p
" ----------------------------------------------------------------------------
" Visual Cues
" ----------------------------------------------------------------------------
set showmatch " brackets/braces that is
set mat=5 " duration to show matching brace (1/10 sec)
set incsearch " do incremental searching
set laststatus=2 " always show the status line
set ignorecase " ignore case when searching
set nohlsearch " don't highlight searches
set visualbell " shut the fuck up
" ---------------------------------------------------------------------------
" Strip all trailing whitespace in file
" ---------------------------------------------------------------------------
function! StripWhitespace ()
exec ':%s/ \+$//gc'
endfunction
map ,s :call StripWhitespace ()<CR>
" ---------------------------------------------------------------------------
" NERDTree
" ---------------------------------------------------------------------------
let g:NERDTreeDirArrows=0
nmap <Leader>n :NERDTreeToggle<CR>
nmap <Leader>m :NERDTreeClose<CR>:NERDTreeFind<CR>
" ---------------------------------------------------------------------------
" CTRL P
" ---------------------------------------------------------------------------
let g:ctrlp_custom_ignore = 'vendor\/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment