"====== 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' Plug 'tpope/vim-endwise' Plug 'sheerun/vim-polyglot' Plug 'junegunn/gv.vim' Plug 'junegunn/limelight.vim' Plug 'junegunn/goyo.vim' Plug 'vim-scripts/bufexplorer.zip' " Plug 'vim-scripts/indentpython.vim' Plug 'ycm-core/YouCompleteMe', { \ 'do': 'python3 ./install.py --clangd-completer --ts-completer --go-completer' } Plug 'Valloric/MatchTagAlways' 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' Plug 'honza/vim-snippets' Plug 'majutsushi/tagbar' " Plug 'kkoomen/vim-doge' Plug 'nvie/vim-flake8' Plug 'leafgarland/typescript-vim' Plug 'Quramy/tsuquyomi' Plug 'hashivim/vim-terraform' Plug 'juliosueiras/vim-terraform-completion' " Plug 'sainnhe/everforest' " Plug 'NLKNguyen/papercolor-theme' Plug 'w0ng/vim-hybrid' " Plug 'prettier/vim-prettier', { 'do': 'yarn install' } call plug#end() syntax on filetype plugin indent on "====== End of Plug Required Block and plugins let mapleader = ';' " define map leader set background=dark colorscheme hybrid """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => 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=longest:full,full set wildignore=*.o,*~,*.pyc " Ignore compiled files set wildoptions+=fuzzy " Allow fuzzy completion 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 linebreak " 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 BufNewFile,BufRead *.yaml.gotmpl set filetype=yaml " for highlighting YAML go templates as yaml files " autocmd FileType markdown setlocal spell " spell check markdown files autocmd FileType gitcommit setlocal spell " spell check commits autocmd FileType gitcommit set complete+=spell " spell complete with CTRL+N/CTRL+P autocmd FileType ruby setlocal nospell " disable spell checking for ruby documentation """""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => MISC """""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "Highlight the 80, 120 columns "============================= highlight ColorColumn ctermbg=235 guibg=#2c2d27 let &colorcolumn="80,".join(range(121,130),",") " let &colorcolumn="80" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Plugin maps """""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "YouCompleteMe & vim-flake8 "========================== let g:ycm_auto_hover='' let g:ycm_enable_diagnostic_signs = 1 let g:ycm_autoclose_preview_window_after_completion = 1 let g:ycm_autoclose_preview_window_after_insertion = 1 nnoremap :YcmCompleter GoTo nmap (YCMFindSymbolInWorkspace) nnoremap r :YcmCompleter Format nnoremap d :YcmCompleter GetDoc " Python pipenv auto complete let pipenv_venv_path = system('pipenv --venv') if shell_error == 0 let venv_path = substitute(pipenv_venv_path, '\n', '', '') let g:ycm_python_binary_path = venv_path . '/bin/python' let g:flake8_cmd = venv_path . '/bin/flake8' else let g:ycm_python_binary_path = '/usr/local/bin/python3' endif "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 let g:airline_symbols_ascii = 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="" "extensions let g:airline#extensions#branch#enabled = 1 let g:airline#extensions#whitespace#enabled = 0 let g:airline#extensions#tabline#enabled = 0 "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 ' "Limelight "========= nmap f :Limelight!! "Goyo "==== " nmap g :Goyo "Tagbar "====== nmap :TagbarToggle