Skip to content

Instantly share code, notes, and snippets.

@afdallah
Last active April 1, 2017 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afdallah/b281a5db2abd1efafebf8a08d7d60ff0 to your computer and use it in GitHub Desktop.
Save afdallah/b281a5db2abd1efafebf8a08d7d60ff0 to your computer and use it in GitHub Desktop.
Enable omnifcomplete on YouCompleteMe
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'git://git.wincent.com/command-t.git'
Plugin 'Valloric/YouCompleteMe'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
let mapleader=","
nmap <Leader>ev :e ~/.vimrc <cr>
nmap <Leader>es :so ~/.vimrc <cr>
set number
set relativenumber
" Theme
syntax on
color molokai
set background=dark
set smartindent
set tabstop=2
set listchars=tab:▸\ ,trail:.,eol:¬
set t_Co=256
let g:molokai_original = 0
set textwidth=80
syntax enable
" Autocommand
" Enable omni completion.
autocmd FileType python setlocal et sta sw=4 sts=4
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html,markdown set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css,scss set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType java set omnifunc=javacomplete#Complete
" YouCompleteMe Enable Omnifunc
let g:ycm_semantic_triggers = {
\ 'css': [ 're!^\s{4}', 're!:\s+' ],
\ }
let g:ycm_semantic_triggers = {
\ 'c' : ['->', '.'],
\ 'objc' : ['->', '.'],
\ 'ocaml' : ['.', '#'],
\ 'cpp,objcpp' : ['->', '.', '::'],
\ 'perl' : ['->'],
\ 'php' : ['->', '::', '(', 'use ', 'namespace ', '\'],
\ 'cs,java,typescript,d,python,perl6,scala,vb,elixir,go' : ['.', 're!(?=[a-zA-Z]{3,4})'],
\ 'html': ['<', '"', '</', ' '],
\ 'vim' : ['re![_a-za-z]+[_\w]*\.'],
\ 'ruby' : ['.', '::'],
\ 'lua' : ['.', ':'],
\ 'erlang' : [':'],
\ 'haskell' : ['.', 're!.'],
\ 'scss,css': [ 're!^\s{2,4}', 're!:\s+' ],
\ }
let g:ycm_filetype_blacklist={
\ 'tagbar' : 1,
\ 'nerdtree' : 1,
\ 'markdown' : 1,
\ 'unite' : 1,
\ 'text' : 1,
\ 'csv' : 1,
\}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment