set shell=/bin/bash scriptencoding utf-8 set encoding=utf-8 set shortmess=I "turn off splash screen let have_plug=filereadable(expand('~/.vim/autoload/plug.vim')) if(!have_plug && executable('curl')) echo "Installing Plug" !curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim endif if(have_plug) call plug#begin('~/.vim/plugged') Plug 'ivyl/vim-bling' "blink search results Plug 'kien/ctrlp.vim' "Fuzzy search Plug 'mattn/emmet-vim' "ZenCoding Plug 'tpope/vim-fugitive' "Work with git repos Plug 'gregsexton/gitv' "GitK for Fugitive Plug 'w0ng/vim-hybrid' "Hybrid colorscheme Plug 'leshill/vim-json' "JSON support Plug 'tommcdo/vim-lion' "Align stuff Plug 'evanmiller/nginx-vim-syntax' "Nginx Syntax Plug 'msanders/snipmate.vim' "Snippets Plug 'tpope/vim-surround' "Surround with quotes Plug 'scrooloose/syntastic' "Syntax checker Plug 'majutsushi/tagbar' "Ctags integration Plug 'bling/vim-airline' "Status bar call plug#end() if empty(glob("~/.vim/plugged")) PlugInstall endif endif syntax on "enable syntax hightlighting set autoindent "enable autoindent set autoread "automatically reload files set encoding=utf-8 "set encoding set hidden "enable multiple dirty buffers set laststatus=2 "show 2 status lines set modelines=0 set nocompatible set number "show line numbers set visualbell set wildmenu "show autocomplete menu set wildmode=full silent! colorscheme hybrid "Set before any key remapping let mapleader = '\' "Javascript Function lookup function! JsFunctionLookup() let l:Name = expand("") execute "/function ".l:Name endfu if has("autocmd") filetype plugin indent on augroup InsertTimer au! "Autoexit to normal mode after 15 seconds of inactivity autocmd CursorHoldI * stopinsert autocmd InsertEnter * let updaterestore=&updatetime | set updatetime=15000 autocmd InsertLeave * let &updatetime=updaterestore augroup END augroup vimrc "Automatically reload VIMRC file after saving au! autocmd bufwritepost $MYVIMRC source $MYVIMRC augroup END "Mappings for diff mode autocmd filterwritepre * if &diff | map { :diffget \\2| endif autocmd filterwritepre * if &diff | map } :diffget \\3| endif augroup javascript "Custom mappings au! autocmd BufRead *.js nmap f* :call JsFunctionLookup()zz autocmd BufRead *.js let g:syntastic_javascript_checkers = ['jsxhint'] augroup END endif "open config with \r nmap r :e $MYVIMRC nmap T :TagbarToggle nmap qt :QuickfixsignsToggle nmap qq :QuickfixsignsSet nmap w :up imap w :upa "Remove search highlight when is pressed nnoremap :nohlsearch "highlight search results set hlsearch "ignore capitalization set ignorecase set smartcase "highlight current line set cursorline "show whitespace "set list set listchars=tab:▸\ ,eol:¬ "Invisible character colors highlight NonText guifg=#4a4a59 highlight SpecialKey guifg=#4a4a59 "toggle whitespace nmap l :set list! noremap R :! echo reload \| nc localhost 32000 "tab settings set shiftwidth=4 set tabstop=4 set expandtab "set sane backspace behaviour set backspace=2 "No more arrow keys nnoremap nnoremap nnoremap nnoremap "inoremap "inoremap "inoremap "inoremap "move up and down within virtual lines nnoremap j gj nnoremap k gk "press jk in quick succession for esc key imap jk "press space in normal mode to center screen nmap zz if has("gui_running") "set guifont=Consolas:h10:cRUSSIAN,Lucida\ Console:h10:cRUSSIAN set guifont=Menlo_for_Powerline:h10:cANSI else let g:Powerline_symbols = 'fancy' let g:airline_powerline_fonts = 1 set mouse=a endif "Powerline fonts for Airline let g:airline#extensions#tabline#enabled = 1 if exists("g:loaded_syntastic_c_autoload") nmap c :SyntasticCheck nmap e :Errors endif nmap ] :bn nmap [ :bp nmap d :bd set wildignore+=*/Deploy/*,*/node_modules/*,*/build/*,*/lib/* set completeopt=longest,menu,menuone