Skip to content

Instantly share code, notes, and snippets.

@PirosB3
Created July 9, 2013 13:55
Show Gist options
  • Save PirosB3/5957532 to your computer and use it in GitHub Desktop.
Save PirosB3/5957532 to your computer and use it in GitHub Desktop.
" This is Gary Bernhardt's .vimrc file
" vim:set ts=2 sts=2 sw=2 expandtab:
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" BASIC EDITING CONFIGURATION
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set nocompatible
set hidden
set history=10000
set noautoindent
set nowrap
set laststatus=2
set showmatch
set incsearch
set hlsearch
set ignorecase smartcase
set cursorline
set cmdheight=2
set switchbuf=useopen
set numberwidth=5
set showtabline=2
set winwidth=79
set t_ti= t_te=
set scrolloff=3
set backup
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set backspace=indent,eol,start
set showcmd
syntax on
filetype plugin indent on
set wildmode=longest,list
set wildmenu
let mapleader=","
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" COLOR
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
:set t_Co=256 " 256 colors
:set background=dark
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" STATUS LINE
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
:set statusline=%<%f\ (%{&ft})\ %-4(%m%)%=%-19(%3l,%02c%03V%)
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" MISC KEY MAPS
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
map <leader>y "*y
" Move around splits with <c-hjkl>
nnoremap <c-j> <c-w>j
nnoremap <c-k> <c-w>k
nnoremap <c-h> <c-w>h
nnoremap <c-l> <c-w>l
" Clear the search buffer when hitting return
function! MapCR()
nnoremap <cr> :nohlsearch<cr>
endfunction
call MapCR()
nnoremap <leader><leader> <c-^>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" MULTIPURPOSE TAB KEY
" Indent if we're at the beginning of a line. Else, do completion.
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
function! InsertTabWrapper()
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k'
return "\<tab>"
else
return "\<c-p>"
endif
endfunction
inoremap <tab> <c-r>=InsertTabWrapper()<cr>
inoremap <s-tab> <c-n>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" ARROW KEYS ARE UNACCEPTABLE
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
map <Left> <Nop>
map <Right> <Nop>
map <Up> <Nop>
map <Down> <Nop>
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'emilkje/sparkup-bundle'
Bundle 'tpope/vim-fugitive'
Bundle 'altercation/vim-colors-solarized'
Bundle 'mileszs/ack.vim'
Bundle 'scrooloose/nerdtree'
Bundle 'Lokaltog/vim-powerline'
Bundle 'scrooloose/nerdcommenter'
Bundle 'ervandew/supertab'
Bundle 'kien/ctrlp.vim'
Bundle 'chriskempson/base16-vim'
Bundle 'scrooloose/syntastic'
Bundle 'airblade/vim-gitgutter'
set autoread
nnoremap <silent> <leader>a :Ack!<space>
nnoremap <silent> <leader>s :vsplit<space>
nnoremap <leader>d :NERDTreeToggle<cr>
if has('gui_running')
colorscheme base16-railscasts
set guioptions-=T
set lines=58
set columns=253
set guifont=Monaco:h13
else
"colorscheme solarized
"
colorscheme base16-railscasts
set guioptions-=T
"set lines=58
"set columns=253
set guifont=Monaco:h13
endif
autocmd InsertEnter * :set number
autocmd InsertLeave * :set relativenumber
let g:ctrlp_switch_buffer = 0
let g:ctrlp_working_path_mode = 2
let g:ctrlp_custom_ignore = {
\ 'dir': '\.git$\|\.hg$\|\.svn$',
\ 'file': '\.exe$\|\.so$\|\.dll$' }
"Ocelot configuration
set noexpandtab
au FileType javascript set wildignore=client-build,client/css,client/img,application/logs
au FileType javascript set tabstop=2
au FileType javascript set shiftwidth=2
au FileType python setlocal tabstop=8 expandtab shiftwidth=4 softtabstop=4
"Indenting shortcuts
nnoremap <leader>1 :set list \| set noexpandtab<CR>
nnoremap <leader>2 :set nolist<CR>
nnoremap <leader>3 :CtrlPClearAllCache<CR>
"capital Y should yank till end of link
nnoremap Y y$
nnoremap <Space> %
vnoremap <Space> %
"avoid middle mouse blowing up
nnoremap <MiddleMouse> <Nop>
nnoremap <2-MiddleMouse> <Nop>
nnoremap <3-MiddleMouse> <Nop>
nnoremap <4-MiddleMouse> <Nop>
inoremap <MiddleMouse> <Nop>
inoremap <2-MiddleMouse> <Nop>
inoremap <3-MiddleMouse> <Nop>
inoremap <4-MiddleMouse> <Nop>
"insert ipdb
iabbrev ipdb; import ipdb; ipdb.set_trace()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment