Skip to content

Instantly share code, notes, and snippets.

@jchristgit
Created February 14, 2018 22:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jchristgit/a4bd33aee5e0b45f182ac76c7b833b99 to your computer and use it in GitHub Desktop.
Save jchristgit/a4bd33aee5e0b45f182ac76c7b833b99 to your computer and use it in GitHub Desktop.
personal vimrc for use with neovim
" Plugin Installation through Vim-Plug
" https://github.com/junegunn/vim-plug
call plug#begin('~/.vim/plugged')
" - Editing Helpers -
" surround.vim
" quoting / paranthesizing made simple
" https://github.com/tpope/vim-surround
Plug 'tpope/vim-surround'
" vim-lastplace Reopen files at the last edit position.
" https://github.com/farmergreg/vim-lastplace
Plug 'farmergreg/vim-lastplace'
" Auto Pairs
" Automatically close braces.
" https://github.com/jiangmiao/auto-pairs
Plug 'jiangmiao/auto-pairs'
" - Programming -
" ALE
" Asynchronous Lint Engine
" https://github.com/w0rp/ale
Plug 'w0rp/ale'
" sqlint
" SQL Linter for ALE
" https://github.com/purcell/sqlint
Plug 'purcell/sqlint', { 'for': 'sql' }
" dispatch.vim
" Asynchronously run commands.
" https://github.com/tpope/vim-dispatch
Plug 'tpope/vim-dispatch', { 'on': ['Make', 'Dispatch'] }
" - Autocompletion -
" deoplete
" asynchronous keyword completion system
" https://github.com/Shougo/deoplete.nvim
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
" deoplete: Python
" deoplete source for Python
" https://github.com/zchee/deoplete-jedi
Plug 'zchee/deoplete-jedi', { 'for': 'python' }
" deoplete: C++
" deoplete source for C++
" https://github.com/zchee/deoplete-clang
Plug 'zchee/deoplete-clang', { 'for': 'cpp' }
" SuperTab
" Use <Tab> for all insert completions.
" https://github.com/ervandew/supertab
Plug 'ervandew/supertab'
" - Interface -
" Startify
" A fancy start screen.
" https://github.com/mhinz/vim-startify
Plug 'mhinz/vim-startify'
" Airline
" A status / tabline that's light as air.
" https://github.com/vim-airline/vim-airline
Plug 'vim-airline/vim-airline'
" Airline Themes
" Various themes for the Airline plugin.
" https://github.com/vim-airline/vim-airline-themes
Plug 'vim-airline/vim-airline-themes'
" vim-virtualenv
" Python virtualenv Support.
" https://github.com/jmcantrell/vim-virtualenv
Plug 'jmcantrell/vim-virtualenv', { 'on': ['VirtualEnvActivate', 'VirtualEnvDeactivate', 'VirtualEnvList'] }
" vim-cute-python
" Use unicode characters for several built-in functions and operators
" https://github.com/ehamberg/vim-cute-python
Plug 'ehamberg/vim-cute-python', { 'for': 'python' }
" WakaTime
" Track coding time
" https://github.com/wakatime/vim-wakatime
Plug 'wakatime/vim-wakatime'
" - Editor Design -
" NERD Tree
" file system explorer plugin
" https://github.com/scrooloose/nerdtree
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
" NERD Tree: Git Plugin
" Shows Git file status in NERD Tree
" https://github.com/Xuyuanp/nerdtree-git-plugin
Plug 'Xuyuanp/nerdtree-git-plugin', { 'on': 'NERDTreeToggle' }
" Fugitive
" Git Wrapper with various git-related commands.
" https://github.com/tpope/vim-fugitive
Plug 'tpope/vim-fugitive'
" Git Gutter
" Shows Git line status in the sign column (gutter)
" https://github.com/airblade/vim-gitgutter
Plug 'airblade/vim-gitgutter'
" - Colorschemes -
" Gruvbox
" Retro-inspired Color Scheme
" https://github.com/morhetz/gruvbox
Plug 'morhetz/gruvbox'
call plug#end()
" - Plugin Configuration -
" deoplete
" Use deoplete at startup.
let g:deoplete#enable_at_startup = 1
" Show a maximum of 10 autocompletion suggestions.
let g:deoplete#max_list = 10
" deoplete-jedi
" Use Python 3 instead of Python 2.7.
let g:deoplete#sources#jedi#python_path = '/usr/local/bin/python3'
" deoplete-clang
" Set path for libclang and headers.
let g:deoplete#sources#clang#libclang_path='/usr/local/Cellar/llvm/5.0.1/lib/libclang.dylib'
let g:deoplete#sources#clang#clang_header='/usr/local/Cellar/llvm/5.0.1/lib/clang/'
" SuperTab
" Navigate the completion menu from top to bottom.
let g:SuperTabDefaultCompletionType = "<c-n>"
" Airline
" Use Powerline Fonts
let g:airline_powerline_fonts = 1
" Diplay buffers in tabline when there's only one tab open.
let g:airline#extensions#tabline#enabled = 1
" Enable Bufferline integration
let g:airline#extensions#bufferline#enabled = 1
" Enable ALE integration
let g:airline#extensions#ale#enabled = 1
" ALE
" Always show the sign gutter for ALE
let g:ale_sign_column_always = 1
" Run linters one second after text changed
let g:ale_lint_delay = 1000
" Directory names to be used when searching for Virtualenv directories
" let g:ale_virtualenv_dir_names = ['.env', 'env', 've-py3', 've', 'venv', 'virtualenv']
" Use the Python 3 versions of various tools
" instead of the default one that ALE can obtain.
let g:ale_python_pylint_executable = ''
let g:ale_python_pylint_options = '-m pylint --max-line-length 120'
let g:ale_python_autopep8_executable = 'autopep8'
let g:ale_python_autopep8_options = '--in-place --aggressive --aggressive --experimental --ignore-local-config --max-line-length 120 --jobs 4'
let g:ale_python_flake8_executable = 'python3'
let g:ale_python_flake8_options = '-m flake8 --max-line-length=120'
let g:ale_python_mypy_executable = ''
let g:ale_python_yapf_executable = 'yapf'
let g:ale_python_yapf_options = '--parallel --in-place --recursive'
let g:ale_echo_msg_error_str = 'E'
let g:ale_echo_msg_warning_str = 'W'
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
" Configure fixers for :ALEFix
let g:ale_fixers = {
\ 'python': [
\ 'autopep8',
\ 'isort',
\ 'remove_trailing_lines',
\ 'yapf'
\ ]
\}
" - Vim Color Configuration -
" From: https://www.reddit.com/r/unixporn/comments/5vke7s/osx_iterm2_tmux_vim/
" Screenshots: http://imgur.com/a/6OIdz
hi LineNr ctermfg=237
hi StatusLine ctermfg=235 ctermbg=245
hi StatusLineNC ctermfg=235 ctermbg=237
hi Search ctermbg=58 ctermfg=15
hi Default ctermfg=1
hi clear SignColumn
hi SignColumn ctermbg=235
hi GitGutterAdd ctermbg=235 ctermfg=245
hi GitGutterChange ctermbg=235 ctermfg=245
hi GitGutterDelete ctermbg=235 ctermfg=245
hi GitGutterChangeDelete ctermbg=235 ctermfg=245
hi EndOfBuffer ctermfg=237 ctermbg=235
" Colorscheme Configuration
let g:gruvbox_italics = 1
set background=dark
colorscheme gruvbox
" - Keymaps -
" Toggle NERD Tree with CTRL-N
map <C-n> :NERDTreeToggle<CR>
" Toggle Git Status with CTRL-G
map <C-g> :Gstatus<CR>
" - Vim Editing Configuration -
" Copy indent from the current line on inserting an newline
set autoindent
" Make Tab insert spaces
set expandtab
" Insert 4 spaces for a Tab
set tabstop=4
" Use 4 space characters for indentation
set shiftwidth=4
" Overrides 'ignorecase' if the pattern contains uppercase characters.
set smartcase
" Show the line numbers
set number
" Disable swap files
set noswapfile
" Do not show the default mode text (e.g. -- INSERT --)
set noshowmode
" Don't preview documentation for completion
set completeopt-=preview
" Find search matches incrementally
set incsearch
" Do not change the cursor to '|' in insert mode.
set guicursor=
" Make Neovim work nicely in virtual environments
let g:python_host_prog='/usr/local/bin/python'
let g:python3_host_prog='/usr/local/bin/python3'
" Exit Terminal Mode with CTRL-k
tnoremap <C-k> <C-\><C-n>
" Fix weird Shift-Space interaction
imap <S-Space> <Space>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment