Skip to content

Instantly share code, notes, and snippets.

@joebutler2
Created October 25, 2021 21:33
Show Gist options
  • Save joebutler2/2be34d0808e1a607933f445106b8c847 to your computer and use it in GitHub Desktop.
Save joebutler2/2be34d0808e1a607933f445106b8c847 to your computer and use it in GitHub Desktop.
Vim configuration
set nocompatible " be iMproved, required
filetype off " required
set runtimepath^=~/.vim/plugged/vim-misc
" for python to work with autotag
let g:autotagStartMethod='fork'
" Use vim-plug to manage plugins
call plug#begin('~/.vim/plugged')
Plug 'ervandew/supertab'
Plug 'scrooloose/nerdtree'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'xolox/vim-misc' " Required for easytags
Plug 'xolox/vim-easytags' " Auto-generate ctags file
Plug 'craigemery/vim-autotag'
Plug 'zirrostig/vim-jack-syntax'
Plug 'devjoe/vim-codequery'
Plug 'ashfinal/vim-colors-paper'
Plug 'w0rp/ale'
Plug 'airblade/vim-gitgutter'
Plug 'rizzatti/dash.vim'
Plug 'tpope/vim-commentary'
Plug 'neoclide/coc.nvim' " Intellisense completion
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'majutsushi/tagbar'
Plug 'jremmen/vim-ripgrep'
Plug 'tpope/vim-surround'
Plug 'rking/ag.vim'
"
" Language specific
Plug 'sheerun/vim-polyglot'
Plug 'neovimhaskell/haskell-vim', {'for': 'haskell'}
Plug 'ianks/vim-tsx', {'for': 'typescript'}
Plug 'Quramy/tsuquyomi', {'for': 'typescript'}
Plug 'andys8/vim-elm-syntax', {'for': 'elm'}
Plug 'elm-tooling/elm-vim', {'for': 'elm'}
Plug 'thoughtbot/vim-rspec', {'for': 'ruby'}
Plug 'vim-ruby/vim-ruby', {'for': 'ruby'}
" clojure specific
Plug 'tpope/vim-repeat', {'for': 'clojure'}
Plug 'xolox/vim-misc', {'for': 'clojure'}
Plug 'guns/vim-sexp', {'for': 'clojure'}
Plug 'tpope/vim-sexp-mappings-for-regular-people', {'for': 'clojure'}
Plug 'guns/vim-clojure-highlight', {'for': 'clojure'}
Plug 'tpope/vim-fireplace', {'for': 'clojure'}
Plug 'guns/vim-clojure-static', {'for': 'clojure'}
Plug 'clojure-vim/clj-refactor.nvim', {'for': 'clojure'} " NeoVim specific
" Since we are using autocmds this needs to be present for all languages.
Plug 'kien/rainbow_parentheses.vim'
" Initialize plugin system
call plug#end()
" For vim-sexp, i.e. Clojure
nnoremap <Space> <Nop>
let maplocalleader=" "
inoremap jj <ESC>
set tabstop=2 shiftwidth=2 expandtab
set number
let mapleader=","
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
nmap ; :
nmap <silent> <leader>d <Plug>DashSearch
" thoughbot/vim-rspec - make it easy to run specs
map <Leader>t :call RunCurrentSpecFile()<CR>
map <Leader>s :call RunNearestSpec()<CR>
map <Leader>l :call RunLastSpec()<CR>
map <Leader>a :call RunAllSpecs()<CR>
map <Leader>r :Rg
au FileType c setl sw=4 sts=4 et
autocmd FileType make setlocal noexpandtab
set noswapfile
set t_Co=256 " This is may or may not needed.
set background=light
colorscheme paper
syntax on
set rtp+=/usr/local/opt/fzf
let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn|vendor|node_modules)$'
if exists("g:ctrlp_user_command")
unlet g:ctrlp_user_command
endif
set wildignore+=*\\vendor\\**
set backspace=indent,eol,start
" NERDTree by default
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
let NERDTreeShowHidden=1
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/](\.(git|hg|svn)|vendor|tmp|node_modules)$',
\ 'file': '\v\.(exe|so|dll)$',
\ 'link': 'some_bad_symbolic_links',
\ }
" Ctrl-P - ignore files in .gitignore
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard']
" Tagbar is a source tree analyzer
nmap <F8> :TagbarToggle<CR>
let g:tagbar_type_elm = {
\ 'kinds' : [
\ 'f:function:0:0',
\ 'm:modules:0:0',
\ 'i:imports:1:0',
\ 't:types:1:0',
\ 'a:type aliases:0:0',
\ 'c:type constructors:0:0',
\ 'p:ports:0:0',
\ 's:functions:0:0',
\ ]
\}
nmap <silent> t<C-n> :TestNearest<CR>
nmap <silent> t<C-f> :TestFile<CR>
nmap <silent> t<C-s> :TestSuite<CR>
nmap <silent> t<C-l> :TestLast<CR>
nmap <silent> t<C-g> :TestVisit<CR>
autocmd VimEnter * :RainbowParenthesesToggle
autocmd Syntax * :RainbowParenthesesLoadRound
autocmd Syntax * :RainbowParenthesesLoadSquare
autocmd Syntax * :RainbowParenthesesLoadBraces
let g:kite_supported_languages = ['python', 'javascript', 'go', 'typescript', 'java', 'kotlin']
set statusline=%<%f\ %h%m%r%{kite#statusline()}%=%-14.(%l,%c%V%)\ %P
set laststatus=2 " always display the status line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment