Last active
January 9, 2019 07:45
-
-
Save ilnuribat/a734b36569718140392aabbf063d3315 to your computer and use it in GitHub Desktop.
vimrc
This file contains hidden or 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
:syntax on | |
:set tabstop=2 | |
:set shiftwidth=2 | |
:set smarttab | |
:set expandtab | |
:set smartindent | |
:set number | |
if empty(glob('~/.vim/autoload/plug.vim')) | |
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs | |
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC | |
endif | |
call plug#begin('~/.vim/plugged') | |
Plug 'Valloric/YouCompleteMe', { 'do': './install.py --tern-completer' } | |
Plug 'scrooloose/nerdtree' | |
Plug 'Xuyuanp/nerdtree-git-plugin' | |
Plug 'airblade/vim-gitgutter' | |
call plug#end() | |
" Start autocompletion after 4 chars | |
let g:ycm_min_num_of_chars_for_completion=3 | |
let g:ycm_min_num_identifier_candidate_chars=3 | |
let g:ycm_enable_diagnostic_highlighting=0 | |
let NERDTreeShowLineNumbers=1 | |
execute pathogen#infect() | |
call pathogen#helptags() | |
" NERDTress File highlighting | |
function! NERDTreeHighlightFile(extension, fg, bg, guifg, guibg) | |
exec 'autocmd filetype nerdtree highlight ' . a:extension .' ctermbg='. a:bg .' ctermfg='. a:fg .' guibg='. a:guibg .' guifg='. a:guifg | |
exec 'autocmd filetype nerdtree syn match ' . a:extension .' #^\s\+.*'. a:extension .'$#' | |
endfunction | |
call NERDTreeHighlightFile('jade', 'green', 'none', 'green', '#151515') | |
call NERDTreeHighlightFile('ini', 'yellow', 'none', 'yellow', '#151515') | |
call NERDTreeHighlightFile('md', 'blue', 'none', '#3366FF', '#151515') | |
call NERDTreeHighlightFile('yml', 'yellow', 'none', 'yellow', '#151515') | |
call NERDTreeHighlightFile('config', 'yellow', 'none', 'yellow', '#151515') | |
call NERDTreeHighlightFile('conf', 'yellow', 'none', 'yellow', '#151515') | |
call NERDTreeHighlightFile('json', 'yellow', 'none', 'yellow', '#151515') | |
call NERDTreeHighlightFile('html', 'yellow', 'none', 'yellow', '#151515') | |
call NERDTreeHighlightFile('styl', 'cyan', 'none', 'cyan', '#151515') | |
call NERDTreeHighlightFile('css', 'cyan', 'none', 'cyan', '#151515') | |
call NERDTreeHighlightFile('coffee', 'Red', 'none', 'red', '#151515') | |
call NERDTreeHighlightFile('js', 'Red', 'none', '#ffa500', '#151515') | |
call NERDTreeHighlightFile('php', 'Magenta', 'none', '#ff00ff', '#151515') | |
autocmd StdinReadPre * let s:std_in=1 | |
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif | |
autocmd BufWinEnter * NERDTreeMirror | |
map <C-f> :NERDTreeFocus<CR> | |
map <F6> :NERDTreeClose<CR> | |
noremap qt :tabclose<CR> | |
noremap <C-PageUp> :tabprevious<CR> | |
noremap <C-PageDown :tabnext<CR> | |
noremap <C-J> <C-W>j | |
noremap <C-K> <C-W>k | |
noremap <C-H> <C-W>h | |
noremap <C-L> <C-W>l | |
noremap <F12> :TernDef<CR> | |
noremap qt :tabclose<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment