Skip to content

Instantly share code, notes, and snippets.

@deshion
Last active October 7, 2020 23:11
Show Gist options
  • Save deshion/3c2fecac5b30859e97b0 to your computer and use it in GitHub Desktop.
Save deshion/3c2fecac5b30859e97b0 to your computer and use it in GitHub Desktop.
Vim configuration with plugins using Vundle
"Using Vundle - Full instructions at https://github.com/gmarik/Vundle.vim
"Install Vundle then plugins using Vundle
"git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
":PluginInstall
syntax on " ensures syntax highlighting for gvim on Win
set nocompatible " be iMproved, required
filetype off " required
" 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 'gmarik/Vundle.vim'
Plugin 'bling/vim-airline'
Plugin 'scrooloose/nerdtree'
Plugin 'scrooloose/syntastic'
Plugin 'scrooloose/nerdcommenter'
Plugin 'vim-scripts/matchit.zip'
Plugin 'rodjek/vim-puppet'
Plugin 'xolox/vim-misc'
Plugin 'xolox/vim-session'
Plugin 'godlygeek/tabular'
Plugin 'plasticboy/vim-markdown'
Plugin 'Raimondi/delimitMate'
Plugin 'mtth/scratch.vim'
Plugin 'bitc/vim-bad-whitespace'
"Plugin 'ctrlpvim/ctrlp.vim'
"Plugin 'mileszs/ack.vim'
Plugin 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plugin 'junegunn/fzf.vim'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plugin 'Konfekt/FastFold'
" Add maktaba and codefmt to the runtimepath.
" (The latter must be installed before it can be used.)
Plugin 'google/vim-maktaba'
Plugin 'google/vim-codefmt'
" Also add Glaive, which is used to configure codefmt's maktaba flags. See
" `:help :Glaive` for usage.
Plugin 'google/vim-glaive'
"Enable for vim 8.0 and above
"Plugin 'chrisbra/vim-diff-enhanced'
"Enable to support OMNI complete using vim syntax keywords
"Plugin 'SyntaxComplete'
"Enable faster search with ag installed (Windows/Linux)
"Plugin 'albfan/ag.vim'
"Enable Vagrant support
"Plugin 'hashivim/vim-vagrant'
"Enable Powershell support on Windows
"Plugin 'pprovost/vim-ps1'
"Enable additional JavaScript support
"Plugin 'pangloss/vim-javascript'
"Plugin 'jelera/vim-javascript-syntax'
"Plugin 'elzr/vim-json'
"Plugin 'mxw/vim-jsx'
"Plugin 'othree/javascript-libraries-syntax.vim'
"Plugin 'matthewsimo/angular-vim-snippets'
"Plugin 'claco/jasmine.vim'
"Plugin 'burnettk/vim-angular'
"Plugin 'leafgarland/typescript-vim'
"Plugin 'ianks/vim-tsx'
"Plugin 'Shougo/vimproc.vim'
"Plugin 'Quramy/tsuquyomi'
"Enable Python IDE support
"Plugin 'klen/python-mode'
"Plugin 'tmhedberg/SimpylFold'
"Enable Python PEP8 compliance check
"Plugin 'nvie/vim-flake8'
"Enable Ruby on Rails IDE support
"Plugin 'vim-ruby/vim-ruby'
"Plugin 'tpope/vim-rails'
"Plugin 'tomtom/tcomment_vim'
"Plugin 'thoughtbot/vim-rspec'
"Plugin 'ecomba/vim-ruby-refactoring'
"Nee HAML plugin for latest updates only. Included in vim
"Plugin 'tpope/vim-haml'
"Enable BDD Gherkin support (cucumber/behave)
"Plugin 'tpope/vim-cucumber'
"Enable git support
"Plugin 'tpope/vim-fugitive'
"Enable colorscheme switching and add collection of color schemes
"Plugin 'xolox/vim-colorscheme-switcher'
"Bundle 'flazz/vim-colorschemes'
"Enable buffer explorer if it works with all other plugins
"Plugin 'jlanzarotta/bufexplorer'
"Enable unite as replacement for ctrl-p, bufexplorer etc.
"Plugin 'shougo/unite.vim'
"Install ctags and uncomment to enable tags support
"Plugin 'xolox/vim-easytags'
"Plugin 'majutsushi/tagbar'
"or
"Plugin 'taglist'
"Install snipMate and its dependencies for inserting code snippets
"Plugin 'MarcWeber/vim-addon-mw-utils'
"Plugin 'tomtom/tlib_vim'
"Plugin 'garbas/vim-snipmate'
" Optional:
"Plugin 'honza/vim-snippets'
"Enable Chef support
"Plugin 'vadv/vim-chef'
"Plugin 'dougireton/vim-chef'
"Enable Jenkins DSL (Jenkinsfile) support
"Plugin 'martinda/Jenkinsfile-vim-syntax'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
"Plugin 'kien/ctrlp.vim'
" plugin from http://vim-scripts.org/vim/scripts.html
"Plugin 'L9'
" Git plugin not hosted on GitHub
"Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
"Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
"Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Avoid a name conflict with L9
"Plugin 'user/L9', {'name': 'newL9'}
" 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
"
se nu
se nohls
"Disable switching to Ex mode
nnoremap Q <nop>
"Config ack.vim to use silver searcher
"if executable('ag')
"" let g:ackprg = 'ag --vimgrep'
"endif
"nnoremap <Leader>a :Ack!<Space>
"Config fzf.vim for File, GitFiles and Buffer
" Also add this to .bashrc
" export FZF_DEFAULT_COMMAND='ag -g ""'
nmap <Leader>g :GFiles<CR>
nmap <Leader>f :Files<CR>
nmap <Leader>b :Buffers<CR>
nmap <Leader>a :Ag<CR>
"CtrlP options
"let g:ctrlp_working_path_mode = '0'
"let g:ctrlp_max_files=0
"let g:ctrlp_max_depth=40
"let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard']
"Disable when using bufexplorer
"nnoremap <Leader>be :CtrlPBuffer<CR>
"vim-session - Disable autosave
let g:session_autosave = 'no'
"airline - Always display status line
set laststatus=2
"vim-markdown - Disable autofolding in Markdown files
let g:vim_markdown_folding_disabled=1
"tagbar - Toggle display
"nmap <F8> :TagbarToggle<CR>
"taglist - Toggle display
"nnoremap <silent> <F8> :TlistToggle<CR>
"SyntaxComplete - File type OMNI complete using vim syntax keywords
"if has("autocmd") && exists("+omnifunc")
"autocmd Filetype *
" \ if &omnifunc == "" |
" \ setlocal omnifunc=syntaxcomplete#Complete |
" \ endif
" endif
"use standard for javascript files via syntastic
let g:syntastic_javascript_checkers=['standard', 'jshint']
"javascript-libraries-syntax - Set libraries in use
let g:used_javascript_libs = 'jquery,underscore,backbone'
"vim-jsx : Highlight JSX in .js files
let g:jsx_ext_required = 0
" the glaive#Install() should go after the "call vundle#end()"
call glaive#Install()
" Optional: Enable codefmt's default mappings on the <Leader>= prefix.
Glaive codefmt plugin[mappings]
Glaive codefmt google_java_executable="java -jar ~/.local/bin/google-java-format-1.6-all-deps.jar"
" Let autoformat happen automatically
augroup autoformat_settings
autocmd FileType bzl AutoFormatBuffer buildifier
autocmd FileType c,cpp,proto AutoFormatBuffer clang-format
autocmd FileType dart AutoFormatBuffer dartfmt
autocmd FileType go AutoFormatBuffer gofmt
autocmd FileType gn AutoFormatBuffer gn
autocmd FileType html,css,json AutoFormatBuffer js-beautify
autocmd FileType java AutoFormatBuffer google-java-format
autocmd FileType python AutoFormatBuffer yapf
autocmd FileType javascript,typescript AutoFormatBuffer prettier
" Alternative: autocmd FileType python AutoFormatBuffer autopep8
augroup END
set autoread
"File type adjusments
autocmd FileType ruby,eruby set filetype=ruby.eruby.chef
au FileType pe-puppet,html,javascript,typescript,css setl ts=2 sw=2 sts=2 et ai
au FileType python setl ts=4 sw=4 sts=4 et ai tw=79
au FileType json setl sw=2 sts=2 et
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
"Disable gui decorations and set font
if has('gui_running')
se guioptions-=m "remove menu bar
se guioptions-=T "remove toolbar
se guioptions-=r "remove right-hand scroll bar
se guioptions-=L "remove left-hand scroll bar
se guifont=Source_Code_Pro:h9:cANSI "Set to Source Code Pro font from Adobe
endif
"Switch to Zenburn color scheme
"colors zenburn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment