Skip to content

Instantly share code, notes, and snippets.

@hryk
Created September 4, 2010 18:32
Show Gist options
  • Select an option

  • Save hryk/565382 to your computer and use it in GitHub Desktop.

Select an option

Save hryk/565382 to your computer and use it in GitHub Desktop.
my vimrc
set nocompatible
filetype off " for Vundle
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" github repos
Bundle 'Shougo/neocomplcache.git'
Bundle 'astashov/vim-ruby-debugger'
Bundle 'c9s/perlomni.vim.git'
Bundle 'ciaranm/detectindent'
Bundle 'ciaranm/detectindent.git'
Bundle 'edsono/vim-matchit.git'
Bundle 'hotchpotch/perldoc-vim.git'
Bundle 'kchmck/vim-coffee-script'
Bundle 'msanders/snipmate.vim'
Bundle 'pangloss/vim-javascript.git'
Bundle 'scrooloose/nerdcommenter.git'
Bundle 'shemerey/vim-project.git'
Bundle 'timcharper/textile.vim'
Bundle 'tpope/vim-fugitive'
Bundle 'tpope/vim-git'
Bundle 'tpope/vim-haml'
Bundle 'tpope/vim-markdown.git'
Bundle 'tpope/vim-rails.git'
Bundle 'tpope/vim-repeat.git'
Bundle 'tpope/vim-surround.git'
Bundle 'tpope/vim-vividchalk.git'
Bundle 'tsaleh/vim-align.git'
Bundle 'vim-ruby/vim-ruby.git'
Bundle 'vim-scripts/jade.vim.git'
Bundle 'vim-scripts/spec.vim.git'
" vim-scripts
Bundle 'L9'
Bundle 'FuzzyFinder'
Bundle 'rails.vim'
Bundle 'taglist-plus'
filetype plugin indent on
" vimrc
set nocompatible
source $HOME/.vim/bundles.vim
syntax on
set backspace=eol,indent,start
"" search pattern
set ignorecase
set smartcase
set hlsearch
set incsearch
"" status
set showmode
set showcmd
set showmatch
"" show line number
set number
"" indenting
set expandtab
set ts=2
set shiftwidth=2
set softtabstop=2
"" backup
set nobackup
"" statusline
set laststatus=2
set statusline=%<%f\%m%r%h%w%{'['.(&fenc!=''?&fenc:&enc).']['.&ff.']['.&ft.']'}%{fugitive#statusline()}/1p%=%l,%c%V%8P
"" encodings
set termencoding=utf-8
set encoding=utf-8
set fileencodings=utf-8,euc-jp,iso-2022-jp
set ambiwidth=double
nnoremap fe :<C-u>e ++enc=euc-jp<Enter>
nnoremap fs :<C-u>e ++enc=shift-jis<Enter>
nnoremap fu :<C-u>e ++enc=utf-8<Enter>
"" folding
set foldmethod=marker
" key binding
"" leader
let mapleader=","
"" edit vimrc
nnoremap <Space>. :<C-u>edit $MYVIMRC<Enter>
"" reload vimrc
nnoremap <Space>s. :<C-u>source $MYVIMRC<Enter>
"" help
nnoremap <C-h> :<C-u>help<Space>
"" show help about a word under cursor
nnoremap <C-h><C-h> :<C-u>help<Space><C-r><C-w><Enter>
"" : -> ;
noremap ; :
noremap : ;
"" j -> gj, k -> gk
noremap j gj
noremap k gk
noremap gj j
noremap gk k
"" insert date
inoremap <expr> ,df strftime('%Y-%m-%dT%H:%M:%S')
inoremap <expr> ,dd strftime('%Y-%m-%d')
inoremap <expr> ,dt strftime('%H:%M:%S')
"" gc (g changee)
nnoremap gc `[v`]
vnoremap gc :<C-u>normal gc<Enter>
onoremap gc :<C-u>normal gc<Enter>
"" redraw
nnoremap sh :<C-u>redraw!<Enter>
"""""""""""""""""""""""""""""""""""""""""
" autocmds
"----------------------------------------
" autocmd!
"
au BufRead,BufNewFile *.thor setfiletype ruby
au BufNewFile,BufRead *.as setf actionscript
""""""""""""""""""""""""""""""""""""""""""
" Plugin Settings
"
" MEMO
" - install help tag
" :helptags ~/.vim/doc
""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""
" Fuzzy Finder - 3.2
"-----------------------------------------
"" Options
let g:fuf_modesDisable = []
let g:fuf_keyOpen = '<C-j>'
let g:fuf_keyOpenSplit = '<CR>'
let g:fuf_infoFile = '~/.vim/fufinfo'
" Binding
nnoremap <silent> <C-f><C-d> :<C-u>FufAddBookmark<Enter>
nnoremap <silent> <C-f><C-e> :<C-u>FufEditInfo<Enter>
nnoremap <silent> gb :<C-u>FufFile<Enter>
nnoremap <silent> bg :<C-u>FufBuffer<Enter>
nnoremap <silent> gd :<C-u>FufDir<Enter>
nnoremap <silent> bd :<C-u>FufBookmark<Enter>
nnoremap <silent> br :<C-u>FufMruFile<Enter>
nnoremap <silent> bc :<C-u>FufMruCmd<Enter>
nnoremap <silent> gt :<C-u>FufTag<Enker>
nnoremap <silent> bG :<C-u>FufFile <C-r>=expand('%:~:.')[:-1-len(expand('%:~:.:t'))]<Enter><Enter>
""""""""""""""""""""""""""""""""""""""""""
" Rails.vim
"-----------------------------------------
""""""""""""""""""""""""""""""""""""""""""
" Surround
"-----------------------------------------
let g:surround_45 = "<% \r -%>"
let g:surround_61 = "<%= \r %>"
let g:surround_{char2nr("g")} = "[[\r]]"
""""""""""""""""""""""""""""""""""""""""""
" taglist
" ----------------------------------------
let Tlist_Auto_Open = 0
let Tlist_Close_On_Select = 1
let Tlist_Ctags_Cmd='/usr/local/bin/ctags'
nnoremap <silent> tl :TlistToggle<CR>
nnoremap <silent> tq :TlistClose<CR>
""""""""""""""""""""""""""""""""""""""""""
" git-branch-info
" ----------------------------------------
let g:git_branch_status_text=": git :"
""""""""""""""""""""""""""""""""""""""""""
" changelog.vim
" ----------------------------------------
let g:changelog_timeformat = "%Y-%m-%d"
let g:changelog_username = "Hiroyuki Nakamura <>"
let g:spec_chglog_format = "%c Hiroyuki Nakamura <>"
au BufNewFile,BufRead *.changelog,Changelog,Changes,ChangeLog setf spec
""""""""""""""""""""""""""""""""""""""""""
" neocomplecache
" ----------------------------------------
let g:neocomplcache_enable_at_startup = 1
let g:neocomplcache_enable_auto_select = 1
let g:neocomplcache_enable_smart_case = 1
let g:neocomplcache_enable_underbar_completion = 1
let g:neocomplcache_lock_buffer_name_pattern = '\*fuf\*'
let g:neocomplcache_snippets_dir='~/.vim/snippets'
let g:neocomplcache_max_list = 5
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
inoremap <expr><C-n> pumvisible() ? "\<C-n>" : "\<C-x>\<C-u>\<C-p>"
inoremap <expr><C-e> neocomplcache#close_popup()
inoremap <expr><CR> neocomplcache#smart_close_popup() ."\<CR>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment