Skip to content

Instantly share code, notes, and snippets.

@markson
Created April 15, 2013 06:11
Show Gist options
  • Select an option

  • Save markson/5386041 to your computer and use it in GitHub Desktop.

Select an option

Save markson/5386041 to your computer and use it in GitHub Desktop.
syntax on
set laststatus=2
set encoding=utf-8
set guifont=Lucida\ Sans\ Typewriter\ for\ Powerline:h13
let g:Powerline_symbols = 'fancy'
if has("gui_running")
set guioptions=egmrt
set transparency=10
set guifont=menlo:h14
endif
"indent guides shows when vim startup
let g:indent_guides_enable_on_vim_startup = 1
"vimrc access and automatic source
map <leader>vim :e ~/.vimrc<cr>
autocmd! bufwritepost .vimrc source %
imap jj <Esc>
set autoindent
set tabstop=4
set shiftwidth=4
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
" My Bundles here:
" original repos on github
Bundle 'scrooloose/nerdtree'
Bundle 'majutsushi/tagbar'
Bundle 'tpope/vim-rails'
Bundle 'Shougo/neocomplcache'
Bundle 'nanotech/jellybeans.vim'
colorscheme jellybeans
Bundle 'Rip-Rip/clang_complete'
Bundle 'osyo-manga/neocomplcache-clang_complete'
Bundle 'suan/vim-instant-markdown'
Bundle 'kien/ctrlp.vim'
let g:ctrlp_working_path_mode = 0
nmap <leader><leader> :CtrlP<cr>
Bundle 'mattn/webapi-vim'
Bundle 'mattn/gist-vim'
Bundle 'godlygeek/tabular'
Bundle 'Lokaltog/vim-powerline'
Bundle 'tpope/vim-haml'
Bundle 'nathanaelkane/vim-indent-guides'
Bundle 'vim-ruby/vim-ruby'
Bundle 'kchmck/vim-coffee-script'
"Two-space indentation
au BufNewFile,BufReadPost *.coffee setl shiftwidth=2 expandtab
"fold by indentation
au BufNewFile,BufReadPost *.coffee setl foldmethod=indent nofoldenable
Bundle 'airblade/vim-gitgutter'
Bundle 'LaTeX-Box-Team/LaTeX-Box'
Bundle 'terryma/vim-multiple-cursors'
"let g:multi_cursor_use_default_mapping=0
"let g:multi_cursor_next_key="\<c-n>"
"let g:multi_cursor_prev_key="\<c->"
"let g:multi_cursor_skip_key="\<c-n>"
"let g:multi_cursor_exit_key="\<Esc>"
" end of the github repo
" vim-scripts repos
Bundle 'DrawIt'
Bundle 'tComment'
Bundle 'sudo.vim'
Bundle 'Align'
" non github repos
"Bundle 'git://git.wincent.com/command-t.git'
Bundle 'git://github.com/fholgado/minibufexpl.vim.git'
let g:miniBufExplModSelTarget = 1
nmap <Leader>t :TMiniBufExplorer<cr>
" MiniBufExpl Colors
nmap <C-W>[ :bp<cr>
nmap <C-W>] :bn<cr>
set cursorline
set cursorcolumn
hi CursorLine cterm=NONE ctermbg=237 guibg=#3A3A3A
hi CursorColumn cterm=NONE ctermbg=237 guibg=#3A3A3A
filetype plugin indent on " required!
nmap 88 :TagbarToggle<CR>
nmap 99 :NERDTreeToggle<CR>
" use neocomplcache & clang_complete
" add neocomplcache option
let g:neocomplcache_force_overwrite_completefunc=1
" add clang_complete option
let g:clang_complete_auto=1
" Disable AutoComplPop.
let g:acp_enableAtStartup = 0
" Use neocomplcache.
let g:neocomplcache_enable_at_startup = 1
" Use smartcase.
let g:neocomplcache_enable_smart_case = 1
" Use camel case completion.
let g:neocomplcache_enable_camel_case_completion = 1
" Use underbar completion.
let g:neocomplcache_enable_underbar_completion = 1
" Set minimum syntax keyword length.
let g:neocomplcache_min_syntax_length = 3
let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*'
" Define dictionary.
let g:neocomplcache_dictionary_filetype_lists = {
\ 'default' : '',
\ 'vimshell' : $HOME.'/.vimshell_hist',
\ 'scheme' : $HOME.'/.gosh_completions'
\ }
" Define keyword.
if !exists('g:neocomplcache_keyword_patterns')
let g:neocomplcache_keyword_patterns = {}
endif
let g:neocomplcache_keyword_patterns['default'] = '\h\w*'
" Plugin key-mappings.
imap <C-k> <Plug>(neocomplcache_snippets_expand)
smap <C-k> <Plug>(neocomplcache_snippets_expand)
inoremap <expr><C-g> neocomplcache#undo_completion()
inoremap <expr><C-l> neocomplcache#complete_common_string()
" SuperTab like snippets behavior.
"imap <expr><TAB> neocomplcache#sources#snippets_complete#expandable() ? "\<Plug>(neocomplcache_snippets_expand)" : pumvisible() ? "\<C-n>" : "\<TAB>"
" Recommended key-mappings.
" <CR>: close popup and save indent.
inoremap <expr><CR> neocomplcache#smart_close_popup() . "\<CR>"
" <TAB>: completion.
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" <C-h>, <BS>: close popup and delete backword char.
inoremap <expr><C-h> neocomplcache#smart_close_popup()."\<C-h>"
inoremap <expr><BS> neocomplcache#smart_close_popup()."\<C-h>"
inoremap <expr><C-y> neocomplcache#close_popup()
inoremap <expr><C-e> neocomplcache#cancel_popup()
" AutoComplPop like behavior.
"let g:neocomplcache_enable_auto_select = 1
" Shell like behavior(not recommended).
"set completeopt+=longest
"let g:neocomplcache_enable_auto_select = 1
"let g:neocomplcache_disable_auto_complete = 1
"inoremap <expr><TAB> pumvisible() ? "\<Down>" : "\<TAB>"
"inoremap <expr><CR> neocomplcache#smart_close_popup() . "\<CR>"
" Enable omni completion.
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
" Enable heavy omni completion.
if !exists('g:neocomplcache_omni_patterns')
let g:neocomplcache_omni_patterns = {}
endif
let g:neocomplcache_omni_patterns.ruby = '[^. *\t]\.\w*\|\h\w*::'
"autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete
let g:neocomplcache_omni_patterns.php = '[^. \t]->\h\w*\|\h\w*::'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment