Skip to content

Instantly share code, notes, and snippets.

@rachid
Created April 2, 2014 09:34
Show Gist options
  • Save rachid/9930957 to your computer and use it in GitHub Desktop.
Save rachid/9930957 to your computer and use it in GitHub Desktop.
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'vim-scripts/renamer.vim'
" Git integration
Bundle "git.zip"
Bundle "fugitive.vim"
Bundle 'teranex/tslime.vim'
Bundle 'Lokaltog/vim-easymotion'
Bundle "Lokaltog/vim-powerline"
Bundle 'nanotech/jellybeans.vim'
Bundle 'tpope/vim-surround'
Bundle 'tpope/vim-cucumber'
Bundle 'kchmck/vim-coffee-script'
Bundle 'haml.zip'
Bundle 'vim-scripts/Mark'
Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
" Programming
Bundle "jQuery"
Bundle "rails.vim"
" (HT|X)ml tool
Bundle "ragtag.vim"
" Utility
Bundle "repeat.vim"
Bundle "surround.vim"
Bundle "SuperTab"
Bundle "file-line"
Bundle "Align"
" Ack
Bundle "ack.vim"
noremap <LocalLeader># "ayiw:Ack <C-r>a<CR>
vnoremap <LocalLeader># "ay:Ack <C-r>a<CR>
Bundle 'git://git.wincent.com/command-t.git'
filetype plugin indent on " required!
set backspace=indent,eol,start
if !empty($MY_RUBY_HOME)
let g:ruby_path = join(split(glob($MY_RUBY_HOME.'/lib/ruby/*.*')."\n".glob($MY_RUBY_HOME.'/lib/ruby/site_ruby/*'),"\n"),',')
endif
let mapleader=","
set pastetoggle=<F2>
set tabstop=2
set shiftwidth=2
set expandtab
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set scrolloff=3
set path+=./**
set suffixesadd+=.rb
call pathogen#infect()
syntax on
filetype plugin indent on
set number
colorscheme vividchalk
hi CursorLine cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white
hi CursorColumn cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white
set wildignore+=*.log,*.o,*.obj,.git,public/uploads,*/assets/images,tmp,doc
inoremap jj <Esc>
nmap <up> :bp<cr>
nmap <down> :bn<cr>
nmap <silent> <left> <<
nmap <silent> <right> >>
vmap <silent> <left> <
vmap <silent> <right> >
imap <silent> <left> <C-D>
imap <silent> <right> <C-T>
" Syntax highlighting
set showmatch " matching bret wildignore+=*.log,*.o,*.obj,.git,public/uploads,*/assets/images,tmp,doc
75 inoremap ces
set background=dark
" Tab completion
" will insert tab at beginning of line,
" will use completion if not at beginning
set wildmode=list:longest,list:full
set complete=.,w,t
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>
" " Command-T
nnoremap <silent> <C-b> :CommandTBuffer<CR>
nnoremap <silent> <C-t> :CommandT<CR>
nnoremap <silent> <C-x> :bd<CR>
let g:CommandTMaxHeight=20
let g:CommandTMatchWindowReverse=1
let g:Powerline_symbols = 'fancy'
set encoding=utf-8
set cursorline
set cursorcolumn
set hidden
set autoread
set t_Co=256
" window navigation
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
imap <Tab> <C-R>=SuperTab()<CR>
" Indenting
set ai " Automatically set the indent of a new line
set si " Smart indent
" Syntax highlighting
set showmatch " matching braces
set background=dark
colorscheme Tomorrow-Night
autocmd BufWritePre * :%s/\s\+$//e
nmap <leader>j :call Send_to_Tmux("clear\n wazza\n")<CR>|
function! SuperTab()
if (strpart(getline('.'),col('.')-2,1)=~'^\W\?$')
return "\<Tab>"
else
return "\<C-n>"
endif
endfunction
augroup Cucumber
au!
autocmd BufNewFile,BufReadPost,BufEnter *.feature,*.story
\ set filetype=cucumber|
\ :nmap <leader>r :call Send_to_Tmux("clear\ncucumber features -l " . expand("%") . "\n")<CR>|
\ :nmap <leader>R :call Send_to_Tmux("clear\ncucumber features -l " . expand("%") . "\:<C-R>=line(".")<CR>\n")<CR>|
augroup END
augroup Rspec
au!
autocmd BufNewFile,BufReadPost,BufEnter *_spec.rb
\ :nmap <leader>r :call Send_to_Tmux("clear\nrspec " . expand("%") . "\n")<CR>|
\ :nmap <leader>R :call Send_to_Tmux("clear\nrspec " . expand("%") . "\:<C-R>=line(".")<CR>\n")<CR>|
\ :nmap <leader>y :call Send_to_Tmux("clear\nrspec " . expand("%") . "\n")<CR>|
\ :nmap <leader>Y :call Send_to_Tmux("clear\nrspec " . expand("%") . "\:<C-R>=line(".")<CR>\n")<CR>|
augroup END
set ttimeoutlen=50
if &term =~ "xterm" || &term =~ "screen"
let g:CommandTCancelMap = ['<ESC>', '<C-c>']
let g:CommandTSelectNextMap = ['<C-n>', '<C-j>', '<ESC>OB']
let g:CommandTSelectPrevMap = ['<C-p>', '<C-k>', '<ESC>OA']
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment