Skip to content
Snippets Groups Projects
.vimrc 2.95 KiB
Newer Older
  • Learn to ignore specific revisions
  • Maxime Veber's avatar
    Maxime Veber committed
    " Vundle configuration
    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 'gmarik/Vundle.vim'
    Plugin 'sjbach/lusty.git'
    Plugin 'kien/ctrlp.vim.git'
    Plugin 'arnaud-lb/vim-php-namespace.git'
    Plugin 'danro/rename.vim.git'
    
    " Here should be other plugins
    " Bundle 'joonty/vim-phpqa.git'
    
    " 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          - list configured plugins
    " :PluginInstall(!)    - install (update) plugins
    " :PluginSearch(!) foo - search (or refresh cache first) for foo
    " :PluginClean(!)      - confirm (or auto-approve) removal of unused plugins
    "
    " see :h vundle for more details or wiki for FAQ
    " Put your non-Plugin stuff after this line
    
    
    
    
    
    
    " Basics
    set t_Co=256
    colorscheme molokai
    syntax on
    set number
    set tabstop=4
    set expandtab
    set smartindent
    set autoindent
    set shiftwidth=4
    set directory=/tmp/
    filetype plugin indent on
    
    set nobackup                    " Don't make a backup before overwriting a file.
    set nowritebackup               " And again.
    
    set wildmenu                    " Better completion
    set wildmode=list:longest       " BASH style completion
    set wildignore=.svn,CVS,.git,.hg,*.o,*.a,*.class,*.mo,*.la,*.so,*.obj,*.swp,*.jpg,*.png,*.xpm,*.gif,*.pyc,*.pyo,*.log,**/cache/**,**/logs/**,**/zend/**,**/vendor/**/vendor/**,web/css,web/js,web/bundles,*/project/*,*/target/*,*.hi
    
    " Not sure theses 3 lines are usefull
    set clipboard+=unnamedplus
    set paste
    set go+=a
    
    set hidden
    set showcmd
    
    " Tags
    :set tags+=vendor.tags
    nnoremap <F7> :!ctags -h ".php" --PHP-kinds=+cf --recurse --exclude="*/cache/*" --exclude="*/logs/*" --exclude="*/data/*" --exclude="\.git" --exclude="\.svn" --languages=PHP
    
    " Automatic folder creation
    au BufWrite * :call <SID>MkdirsIfNotExists(expand('<afile>:h'))
    function! <SID>MkdirsIfNotExists(directory)
        if(!isdirectory(a:directory))
            call system('mkdir -p '.shellescape(a:directory))
        endif
    endfunction
    let mapleader=","
    
    " Use the htmljinja syntax for twig files
    au BufNewFile,BufRead *.twig set ft=htmljinja
    
    
    " Remove trailing whitespaces and ^M chars
    autocmd FileType c,cpp,java,php,js,css,html,xml,yml,vim,twig autocmd BufWritePre <buffer> :call setline(1,map(getline(1,"$"),'substitute(v:val,"\\s\\+$","","")'))
    
    " In order to have right colors on tmux
    
    if !has("gui_running")
        set term=screen-256color
    endif
    
    " Make CTRLP checking tags
    noremap <silent> <C-t> :CtrlPTag<cr>
    
    " Add php namespace plugin
    " Add a `use` statement while tapping `,u`
    inoremap <Leader>u <C-O>:call PhpInsertUse()<CR>
    noremap <Leader>u :call PhpInsertUse()<CR>