Created
June 27, 2015 11:08
-
-
Save regedarek/9d42fe0b1c9c6da6eca8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " be iMproved, required | |
filetype off " required | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'gmarik/Vundle.vim' | |
Plugin 'bling/vim-airline' | |
Plugin 'edkolev/tmuxline.vim' | |
Plugin 'Zuckonit/vim-airline-tomato' | |
Plugin 'chriskempson/base16-vim' | |
Plugin 'scrooloose/nerdtree' | |
Plugin 'maxbrunsfeld/vim-yankstack' | |
Plugin 'SirVer/ultisnips' | |
Plugin 'dockyard/vim-easydir' | |
Plugin 'kien/ctrlp.vim' | |
Plugin 'FelikZ/ctrlp-py-matcher' | |
Plugin 'ekalinin/Dockerfile.vim' | |
Plugin 'cakebaker/scss-syntax.vim' | |
Plugin 'ntpeters/vim-better-whitespace' | |
Plugin 'ervandew/supertab' | |
Plugin 'airblade/vim-rooter' | |
Plugin 'tpope/vim-rails' | |
Plugin 'AndrewRadev/simple_bookmarks.vim' | |
Plugin 'killphi/vim-ruby-refactoring' | |
Plugin 'Valloric/YouCompleteMe' | |
Plugin 'tpope/vim-haml' | |
Plugin 'tpope/vim-eunuch' | |
Plugin 'majutsushi/tagbar' | |
Plugin 'benmills/vimux' | |
Plugin 'thoughtbot/vim-rspec' | |
Plugin 'tpope/vim-dispatch' | |
Plugin 'tpope/vim-endwise' | |
Plugin 'tpope/vim-fugitive' | |
Plugin 'tpope/vim-commentary' | |
Plugin 'tommcdo/vim-exchange' | |
Plugin 'pangloss/vim-javascript' | |
Plugin 'kchmck/vim-coffee-script' | |
Plugin 'slim-template/vim-slim.git' | |
Plugin 'mattn/webapi-vim' | |
Plugin 'mattn/gist-vim' | |
Plugin 'rking/ag.vim' | |
Plugin 'duff/vim-bufonly' | |
Plugin 'regedarek/vim-bufexplorer' | |
Plugin 'vim-scripts/bufkill.vim' | |
Plugin 'jiangmiao/auto-pairs' | |
Plugin 'tpope/vim-surround' | |
call vundle#end() | |
colorscheme base16-railscasts | |
syntax enable | |
let mapleader="," | |
set t_Co=256 | |
set background=dark | |
set hidden " allow unsaved background buffers and remember marks/undo for them | |
set history=700 " remember more commands and search history | |
set noswapfile " No swap files when editing please | |
set autoread " Set to auto read when a file is changed from the outside | |
set expandtab shiftwidth=2 " set tab | |
set softtabstop=2 tabstop=2 " set tab | |
set autoindent | |
set laststatus=2 | |
set showmatch | |
set nofoldenable " disable folding | |
set clipboard=unnamed | |
set mouse=a | |
set incsearch | |
set hlsearch | |
set ignorecase smartcase " make searches case-sensitive only if they contain upper-case characters | |
set number | |
set switchbuf=useopen | |
set numberwidth=5 | |
set winwidth=79 | |
set t_ti= t_te= " Prevent Vim from clobbering the scrollback buffer. See | |
set scrolloff=3 " keep more context when scrolling off the end of a buffer | |
set backup " Store temporary files in a central spot | |
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp | |
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp | |
set tags=./tags;,~/.vimtags | |
set noesckeys | |
set ttimeout | |
set backspace=indent,eol,start " allow backspacing over everything in insert mode | |
set showcmd " display incomplete commands | |
set wildmode=longest,list " use emacs-style tab completion when selecting files, etc | |
set wildignore+=*.o,*.png,*.gif,*.obj | |
set wildignore+=.git,*/public/*,*/tmp/*,*/log/* | |
set wildignore+=*.so,*.swp,*.zip " MacOSX/Linux | |
set wildmenu " make tab completion for files/buffers act like bash | |
set statusline=%<%f\ (%{&ft})\ %-4(%m%)%=%-19(%3l,%02c%03V%) | |
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" CUSTOM AUTOCMDS | |
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
augroup vimrcEx | |
" Clear all autocmds in the group | |
autocmd! | |
autocmd FileType text setlocal textwidth=78 | |
" markdown filetype file | |
au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn} set filetype=conf | |
" Jump to last cursor position unless it's invalid or in an event handler | |
autocmd BufReadPost * | |
\ if line("'\"") > 0 && line("'\"") <= line("$") | | |
\ exe "normal g`\"" | | |
\ endif | |
"for ruby, autoindent with two spaces, always expand tabs | |
autocmd FileType ruby,haml,eruby,yaml,html,javascript,sass,cucumber set ai sw=2 sts=2 et | |
autocmd BufEnter *.rb :Rooter | |
autocmd BufEnter *.erb :Rooter | |
" Unbind <enter> nohl behaviour on quickfix | |
autocmd BufReadPost quickfix nnoremap <buffer> <CR> <CR> | |
autocmd CmdwinEnter * nnoremap <buffer> <CR> <CR> | |
augroup END | |
" Keys maps | |
map <silent> <F1> :BufExplorer<CR> | |
map <silent> <F2> :Gstatus<CR> | |
map <silent> <F7> :s/:\([^ ]*\)\(\s*\)=>/\1:/g<CR> | |
imap jj <Esc> | |
nmap zz v$h | |
nmap <silent> rr :NERDTreeToggle<CR> | |
nmap <silent> <leader>b :Gbrowse<CR> | |
nmap <silent> <leader>d :BufOnly<CR> | |
nmap <silent> ff :BD<CR> | |
nmap <S-j> << | |
nmap <S-k> >> | |
vnoremap < <gv | |
vnoremap > >gv | |
nnoremap <c-j> <c-w>j | |
nnoremap <c-k> <c-w>k | |
nnoremap <c-h> <c-w>h | |
nnoremap <c-l> <c-w>l | |
nnoremap <CR> :nohlsearch<CR> | |
imap <c-c> <esc> | |
cnoremap %% <C-R>=expand('%:h').'/'<cr> | |
vmap s S | |
noremap <leader>w :StripWhitespace<CR> | |
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" Ctrlp.vim | |
let g:ctrlp_custom_ignore = { | |
\ 'file': '\v\.(exe|dat|so|dll|log|gif|jpg|jpeg|png)$' | |
\ } | |
let g:ctrlp_cmd = 'CtrlP' | |
let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' } | |
let g:ctrlp_map = '<c-p>' | |
let g:ctrlp_mruf_relative = 1 | |
let g:ctrlp_mruf_exclude = '\v\.git/(MERGE_MSG|rebase-merge|COMMIT_EDITMSG|PULLREQ_EDITMSG|index)' | |
let g:ctrlp_working_path_mode = 0 | |
let g:ctrlp_clear_cache_on_exit = 0 | |
let g:ctrlp_mruf_last_entered = 1 | |
let g:ctrlp_prompt_mappings = { | |
\ 'PrtSelectMove("j")': ['<s-j>', '<down>'], | |
\ 'PrtSelectMove("k")': ['<s-k>', '<up>'], | |
\ 'CreateNewFile()': ['<s-n>'], | |
\ 'ToggleFocus()': ['<tab>'], | |
\ 'ToggleByFname()': ['<c-d>'], | |
\ 'ToggleType(1)': ['<c-f>', '<c-j>', '<c-up>'], | |
\ 'ToggleType(-1)': ['<c-b>', '<c-k>', '<c-down>'], | |
\ 'MarkToOpen()': ['<s-l>'], | |
\ 'OpenMulti()': ['<s-D>'], | |
\ } | |
let g:ctrlp_extensions = ['tag'] | |
let g:ctrlp_open_new_file = 0 | |
let g:ctrlp_open_multi = 'vr' | |
let g:ctrlp_arg_map = 0 | |
let g:ctrlp_jump_to_buffer = 1 | |
let g:ctrlp_dotfiles = 0 | |
let g:ctrlp_match_window_reversed = 0 | |
let g:ctrlp_user_command = 'ag %s -i --nocolor --nogroup --hidden | |
\ --ignore .git | |
\ --ignore .svn | |
\ --ignore .hg | |
\ --ignore .DS_Store | |
\ --ignore "**/*.pyc" | |
\ -g ""' | |
" Ag | |
let g:ackprg = 'ag --nogroup --nocolor --column --smart-case' | |
" Gist | |
let g:gist_clip_command = 'pbcopy' | |
let g:gist_detect_filetype = 1 | |
let g:gist_post_private = 1 | |
" Airline | |
let g:airline_left_sep='' | |
let g:airline_right_sep='' | |
let g:airline#extensions#tmuxline#enabled = 0 | |
" Tmuxline | |
let g:tmuxline_powerline_separators = 0 | |
let g:tmuxline_preset = 'nightly_fox' | |
let g:tomato#show_clock = 1 | |
let g:tomato#show_count_down = 1 | |
" Rspec | |
let g:VimuxUseNearest = 1 | |
let g:rspec_command = "Dispatch rspec {spec}" | |
map <Leader>t :call RunCurrentSpecFile()<CR> | |
map <Leader>T :call RunNearestSpec()<CR> | |
map <Leader>l :call RunLastSpec()<CR> | |
map <Leader>a :call RunAllSpecs()<CR> | |
" Yankrings | |
let g:yankstack_map_keys = 0 | |
nmap <leader>p <Plug>yankstack_substitute_older_paste | |
nmap <leader>P <Plug>yankstack_substitute_newer_paste | |
" Ultisnips | |
let g:UltiSnipsExpandTrigger="<tab>" | |
" Vimux | |
function! VimuxSlime() | |
call VimuxSendText(@v) | |
call VimuxSendKeys("Enter") | |
endfunction | |
vmap <leader>s "vy :call VimuxSlime()<CR> | |
" Tagbar | |
nmap <silent> <leader>b :TagbarToggle<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment