if has('python3') silent! python3 1 endif " Plug Required Block and plugins set nocompatible filetype off call plug#begin('~/.vim/bundle') Plug 'editorconfig/editorconfig-vim' Plug 'tpope/vim-fugitive' Plug 'tpope/vim-rails', { 'for': 'ruby' } Plug 'tpope/vim-endwise', { 'for': 'ruby' } " Plug 'tpope/vim-surround' Plug 'vim-syntastic/syntastic' Plug 'sheerun/vim-polyglot' Plug 'junegunn/gv.vim', { 'on': 'GV' } Plug 'junegunn/limelight.vim' Plug 'junegunn/goyo.vim', { 'on': 'Goyo' } Plug 'vim-scripts/bufexplorer.zip' Plug 'ycm-core/YouCompleteMe', { 'do': './install.py', 'commit': '4e480a317' } Plug 'Valloric/MatchTagAlways', { 'for': 'html' } Plug 'scrooloose/nerdcommenter' Plug 'scrooloose/nerdtree' Plug 'ctrlpvim/ctrlp.vim' Plug 'godlygeek/tabular' Plug 'SirVer/ultisnips' Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' Plug 'airblade/vim-gitgutter' Plug 'ngmy/vim-rubocop', { 'for': 'ruby' } Plug 'honza/vim-snippets' Plug 'majutsushi/tagbar' Plug 'kkoomen/vim-doge' " Plug 'szw/vim-ctrlspace' Plug 'nvie/vim-flake8', { 'for': 'python' } " Plug 'mustache/vim-mustache-handlebars' " Plug 'mhinz/vim-startify' Plug 'leafgarland/typescript-vim', { 'for': 'typescript' } Plug 'Quramy/tsuquyomi', { 'for': 'typescript' } Plug 'hashivim/vim-terraform', { 'for' : 'terraform' } Plug 'juliosueiras/vim-terraform-completion', { 'for' : 'terraform' } Plug 'prettier/vim-prettier', { \ 'do': 'yarn install', \ 'for': ['javascript', 'typescript', 'css', 'less', 'scss', 'json', 'graphql', 'yaml', 'html'] } call plug#end() syntax on filetype plugin indent on " End of Plug Required Block and plugins let mapleader = ';' " define map leader colorscheme xoria256 "set colorscheme """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Vim variables """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set encoding=utf-8 " set the encoding to utf-8 set t_Co=256 " set terminal color 265 set clipboard=unnamed " fix not copying between clipboard and vim set backspace=indent,eol,start " fix backspace not deleteing existing text set number " set numbers column on the left set complete-=i " Faster vim completion set complete+=k " Dictionary word completion using Ctrl+N set nrformats-=octal " Increment numbers decimally using Ctrl+A and Ctrl+X set autoindent " Auto indent " set smartindent " Smart indet (causes problems having differnt files indentation) set smarttab set softtabstop=2 " indentation set tabstop=2 " indentation set shiftwidth=2 " indentation set expandtab " convert tabs to spaces set ttyscroll=3 " speed up scrolling set ttyfast " Optimize for fast terminal connections set lazyredraw " to avoid scrolling problems " set ttimeout " less timeout for faster navigation " set ttimeoutlen=100 " time out for faster navigation set incsearch " Make search act like search in modern browsers set ignorecase " Ignore case when searching shortend ic " set noignorecase " Case Senetive searching shortend noic set smartcase " case-sensitive search if any caps set hlsearch " Highlight search things shortend hls or nohls set laststatus=2 " Always show the status line set ruler " Always show current position set showcmd " display incomplete commands set wildmenu " Turn on Wild menu " set wildmode=list:longest,full set wildignore=*.o,*~,*.pyc " Ignore compiled files set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+ set undofile " Save undo's after file closes set undodir=$HOME/.vim/undo " where to save undo histories set undolevels=200 " How many undos set undoreload=200 " number of lines to save for undo set fileformats+=mac " correct mac file format set tabpagemax=50 " Set the maximum number of tabs allowed set modelines=0 " disable the modelines which i don't understand set nomodeline " disable the modelines which i don't understand set lbr " Vim to wrap existing text as desired set nowrap " let Vim Wrap lines or leave them as long as they get set noeb vb t_vb= " set cursorline " highlight current line " set nocursorline " don't highlight current line set splitbelow " position the preview window below current windows set mouse=a " enable mouse movements, default set mouse= " set vim startup faster if !empty(&viminfo) set viminfo^=! endif """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Mappings """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "Fast saving and quiting nmap w :w nmap q :q " Use to clear the highlighting of :set hlsearch. nnoremap :nohlsearch "toggle folding set foldmethod=indent set foldlevelstart=20 nnoremap za "Easier window movement" "======================= nnoremap h :wincmd h nnoremap j :wincmd j nnoremap k :wincmd k nnoremap l :wincmd l nnoremap ml L nnoremap mk K nnoremap mh H nnoremap mj J """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Omni complete functions """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "set omnifunc=csscomplete#CompleteCSS "set omnifunc=htmlcomplete#CompleteTags "set omnifunc=phpcomplete#CompletePHP "set omnifunc=javascriptcomplete#CompleteJS set omnifunc=pythoncomplete#Complete """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Specific FileTypes configurations """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" autocmd BufNewFile,BufRead *.html.erb set filetype=html " for ruby erb template files autocmd BufNewFile,BufRead *.json.jbuilder set filetype=ruby " for ruby json template files autocmd BufNewFile,BufRead,BufReadPost *.tsx set syntax=javascript " better tsx highlighting than polyglot defaults autocmd FileType markdown setlocal spell " spell check markdown files autocmd FileType gitcommit setlocal spell " spell check commits autocmd FileType ruby setlocal nospell " disable spell checking for ruby documentation autocmd FileType typescript nmap t : echo tsuquyomi#hint() autocmd FileType typescript setlocal completeopt+=preview autocmd CompleteDone * pclose " auto-close preview after completion """""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => MISC """""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "Highlight the 80, 120 columns "============================= highlight ColorColumn ctermbg=235 guibg=#2c2d27 " let &colorcolumn="80,".join(range(121,999),",") let &colorcolumn="80,".join(range(121,130),",") " let &colorcolumn="80" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Plugin maps """""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "YouCompleteMe "============= let g:ycm_python_binary_path = '/usr/local/bin/python3' "polyglot" "============= " let g:polyglot_disabled = ['typescript'] "NerdTree" "========= nnoremap nt :NERDTreeToggle nnoremap nn :NERDTree "NerdCommenter" "============= let NERDSpaceDelims = 1 " add a space after comment delimiter "BufExp" "====== let g:bufExplorerShowRelativePath=1 " Show relative paths. let g:bufExplorerSortBy='fullpath' " Sort by file path. "Vim-airline "=========== let g:airline_theme='wombat' let g:airline_powerline_fonts = 0 "branch parts let g:airline#extensions#branch#enabled = 1 "seperators let g:airline_left_sep = '' let g:airline_right_sep = '' "modes let g:airline_section_b="" let g:airline_section_x="" let g:airline_section_y="" "let g:airline_section_gutter="" let g:airline#extensions#whitespace#enabled = 0 " let g:airline#extensions#tabline#enabled = 1 "Gitgutter "========= set signcolumn=yes set updatetime=100 let g:gitgutter_map_keys = 0 let g:gitgutter_realtime = 0 let g:gitgutter_eager = 0 " let g:gitgutter_async = 0 highlight SignColumn guibg=#1c1c1c ctermbg=233 highlight GitGutterAdd guifg=#009900 guibg=#1c1c1c ctermfg=2 ctermbg=233 highlight GitGutterChange guifg=#bbbb00 guibg=#1c1c1c ctermfg=3 ctermbg=233 highlight GitGutterDelete guifg=#ff2222 guibg=#1c1c1c ctermfg=1 ctermbg=233 "UltiSnips "========= let g:UltiSnipsExpandTrigger = "" let g:UltiSnipsJumpForwardTrigger = '' let g:UltiSnipsJumpBackwardTrigger = '' "CtrlP "===== let g:ctrlp_custom_ignore = '\v[\/](coverage|doc|vendor|tmp|.tmp|bower_components|node_modules|dist|spec/fixtures/vcr_cassettes)$' "MatchTagAlways "============== let g:mta_filetypes = { 'html' : 1 } "RuboCop "======= let g:vimrubocop_keymap = 0 let g:vimrubocop_rubocop_cmd = 'bundle exec rubocop ' nmap r :RuboCop nmap R :RuboCop -a "Limelight" "========= nmap f :Limelight!! "Goyo" "========= " nmap g :Goyo "Tagbar "======= nmap :TagbarToggle "Syntastic "========= let g:tsuquyomi_disable_quickfix = 1 let g:syntastic_typescript_checkers = ['tsuquyomi']