Created
September 7, 2018 02:06
-
-
Save nicoaudy/c83bd8623c7747c2bab1ea50a6d263c7 to your computer and use it in GitHub Desktop.
.vimrc ubuntu kantor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " be iMproved, required | |
filetype off " required <<========== We can turn it on later | |
" 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 'dracula/vim' | |
Plugin 'NLKNguyen/papercolor-theme' | |
Plugin 'scrooloose/nerdtree' | |
Plugin 'airblade/vim-gitgutter' | |
Plugin 'vim-airline/vim-airline' | |
Plugin 'vim-airline/vim-airline-themes' | |
Plugin 'Valloric/YouCompleteMe' | |
Plugin 'tpope/vim-surround' " https://vimawesome.com/plugin/surround-vim | |
Plugin 'Yggdroot/indentLine' | |
Plugin 'arnaud-lb/vim-php-namespace' | |
Plugin 'zhou13/vim-easyescape' | |
" <============================================> | |
" Specify the plugins you want to install here. | |
" We'll come on that later | |
" <============================================> | |
" 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 | |
" Put the rest of your .vimrc file here | |
" | |
" | |
" importing namespace | |
function! IPhpExpandClass() | |
call PhpExpandClass() | |
call feedkeys('a', 'n') | |
endfunction | |
autocmd FileType php inoremap <Leader>e <Esc>:call IPhpExpandClass()<CR> | |
autocmd FileType php noremap <Leader>e :call PhpExpandClass()<CR> | |
" Visual | |
set background=dark | |
colorscheme PaperColor | |
set number " rules | |
set laststatus=2 " status bar | |
set noswapfile | |
filetype plugin indent on " show existing tab with 4 spaces width | |
set tabstop=4 " when indenting with '>', use 4 spaces width | |
set shiftwidth=4 " On pressing tab, insert 4 spaces | |
set expandtab | |
set tabstop=4 | |
" Open NERDTREE on first | |
autocmd StdinReadPre * let s:std_in=1 | |
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif | |
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | endif | |
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif | |
" show hidden file | |
let NERDTreeShowHidden=1 | |
" Keymap | |
map <F2> :NERDTreeToggle<CR> | |
" Dislaying powerline status bar | |
set rtp+=/usr/local/lib/python2.7/dist-packages/powerline/bindings/vim/ | |
set laststatus=2 | |
set t_Co=256 | |
" Autocompleted bracket | |
:inoremap ( ()<Esc>i | |
:inoremap { {}<Esc>i | |
:inoremap [ []<Esc>i | |
" Call ctrl p plugin | |
set runtimepath^=~/.vim/bundle/ctrlp.vim | |
set mouse=a " Mouse Scrolling | |
"---------------Import namespace setup------------" | |
function! IPhpInsertUse() | |
call PhpInsertUse() | |
call feedkeys('a', 'n') | |
endfunction | |
autocmd FileType php inoremap <Leader>u <Esc>:call IPhpInsertUse()<CR> | |
autocmd FileType php noremap <Leader>u :call PhpInsertUse()<CR> | |
"https://github.com/arnaud-lb/vim-php-namespace | |
autocmd FileType php inoremap <Leader>s <Esc>:call PhpSortUse()<CR> | |
autocmd FileType php noremap <Leader>s :call PhpSortUse()<CR> | |
let g:php_namespace_sort_after_insert = 1 | |
" initialize ctags | |
set tags=ctags | |
" easyescape setup | |
let g:easyescape_chars = { "j": 1, "k": 1 } | |
let g:easyescape_timeout = 100 | |
cnoremap jk <ESC> | |
cnoremap kj <ESC>} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment