Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " don't worry about trying to stick to vi/ex conventions
- set nocompatible
- " vim-plug config
- call plug#begin('~/.config/nvim/bundle')
- " Plug 'ctrlpvim/ctrlp.vim'
- Plug 'hashivim/vim-terraform'
- " Plug 'hashivim/vim-hashicorp-tools'
- " Plug 'vim-syntastic/syntastic'
- Plug 'w0rp/ale'
- Plug 'juliosueiras/vim-terraform-completion'
- " Plug 'hashivim/vim-vagrant'
- Plug 'justinmk/vim-sneak'
- Plug 'rizzatti/dash.vim'
- Plug 'mileszs/ack.vim'
- Plug 'sbdchd/neoformat'
- " comment plugins
- " Plug 'scrooloose/nerdcommenter'
- Plug 'tpope/vim-commentary'
- " Plug 'scrooloose/nerdtree'
- " buffer
- Plug 'jlanzarotta/bufexplorer'
- Plug 'Yggdroot/indentLine'
- Plug 'sheerun/vim-polyglot'
- Plug 'tpope/vim-endwise'
- Plug 'tpope/vim-fugitive'
- Plug 'tpope/vim-sensible'
- Plug 'tpope/vim-surround'
- Plug 'tpope/vim-unimpaired'
- Plug 'vim-airline/vim-airline'
- Plug 'vim-airline/vim-airline-themes'
- Plug 'vim-scripts/Align'
- Plug '/usr/local/opt/fzf'
- Plug 'ncm2/ncm2'
- Plug 'roxma/nvim-cm-tern', {'do': 'npm install'}
- Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
- Plug 'ekalinin/Dockerfile.vim'
- " text formatting
- Plug 'Chiel92/vim-autoformat'
- " colorschemes
- Plug 'mhartington/oceanic-next'
- Plug 'whatyouhide/vim-gotham'
- Plug 'joshdick/onedark.vim'
- Plug 'jacoborus/tender.vim'
- Plug 'ajh17/Spacegray.vim'
- Plug 'dylanaraps/wal.vim'
- Plug 'flazz/vim-colorschemes'
- Plug 'felixhummel/setcolors.vim'
- Plug 'nightsense/cosmic_latte'
- " ncm
- " Plug 'ncm2/ncm2-match-highlight'
- call plug#end()
- " ncm config
- " let g:ncm2#match_highlight = 'sans-serif-bold'
- " let g:ncm2#match_highlight = 'sans-serif'
- " let g:ncm2#match_highlight = 'sans-serif-bold'
- " let g:ncm2#match_highlight = 'mono-space'
- " default
- " let g:ncm2#match_highlight = 'double-struck'
- " deoplete
- "call deoplete#enable()
- "let g:deoplete#enable_at_startup = 1
- "let g:python3_host_prog = '/usr/local/bin/python3'
- "filetype off
- let g:deoplete#omni_patterns = {}
- let g:deoplete#omni_patterns.terraform = '[^ *\t"{=$]\w*'
- let g:deoplete#enable_at_startup = 1
- call deoplete#initialize()
- " no banner for netrw
- let g:netrw_banner = 0
- " Jason's personal additions
- autocmd BufReadPost *
- \ if line("'\"") > 0 && line("'\"") <= line("$") |
- \ exe "normal g`\"" |
- \ endif
- " augroup END
- " set mapleader to comma for sanity
- :let mapleader = ","
- " map <Leader>n <plug>NERDTreeTabsToggle<CR>
- " This is for the Syntastic plugin, we need to set it before it loads
- let g:syntastic_enable_signs = 1
- let g:syntastic_echo_current_error = 1
- let g:syntastic_enable_highlighting = 1
- set statusline+=%#warningmsg#
- set statusline+=%{SyntasticStatuslineFlag()}
- set statusline+=%*
- let g:syntastic_always_populate_loc_list = 1
- let g:syntastic_auto_loc_list = 1
- let g:syntastic_check_on_open = 0
- let g:syntastic_check_on_wq = 0
- let g:syntastic_mode = "passive"
- " (Optional) Enable terraform plan to be include in filter
- let g:syntastic_terraform_tffilter_plan = 0
- " configure CtrlP
- let g:ctrlp_map = '<c-p>'
- " let g:ctrlp_map = '<Space>'
- let g:ctrlp_max_height = 45
- let g:ctrlp_match_window_reversed = 0
- let g:ctrlp_match_window_bottom = 1
- let g:ctrlp_switch_buffer = 2
- let g:ctrlp_working_path_mode = 'c'
- let g:ctrlp_mruf_include = '\.py$\|\.rb$|\.coffee|\.haml'
- let g:ctrlp_custom_ignore = '\.git$\|\.hg$\|\.svn$'
- let g:ctrlp_follow_symlinks = 1
- let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'dir', 'rtscript']
- let g:ctrlp_user_command = {
- \ 'types': {
- \ 1: ['.git/', 'cd %s && git ls-files'],
- \ 2: ['.hg/', 'hg --cwd %s locate -I .'],
- \ },
- \ 'fallback': 'find %s -type f'
- \ }
- " slow vim exit?
- let g:ctrlp_clear_cache_on_exit = 0
- " Configure vim-javascript
- let g:javascript_plugin_flow = 1
- " Configure Vimwiki
- " let g:vimwiki_hl_headers = 1
- " let g:vimwiki_hl_cb_checked = 1
- " let g:vimwiki_user_mouse = 1
- " let g:vimwiki_folding = 1
- " let g:vimwiki_fold_lists = 1
- " let g:vimwiki_list_ignore_newline = 0
- " let wiki_1 = {}
- " let wiki_1.nested_syntaxes = {'python': 'python', 'ruby': 'ruby', 'rails': 'rails', 'yaml': 'yml'}
- " configure IndentGuides plugin
- " let g:indent_guides_auto_colors = 0
- " let g:indent_guides_start_level = 3
- " let g:indent_guides_guide_size = 1
- " autocmd! VimEnter,Colorscheme * hi IndentGuidesOdd ctermbg=236 guibg=#303030 | hi IndentGuidesEven ctermbg=239 guibg=#505050
- " autocmd BufRead * IndentGuidesEnable
- "autocmd! VimEnter,Colorscheme * hi IndentGuidesEven ctermbg=123 guibg=#880055
- " initialize pathogen and load all the plugins in .vim/bundle
- " runtime bundle/vim-pathogen/autoload/pathogen.vim
- " execute pathogen#infect('bundle/{}')
- " airline settings
- let g:airline_powerline_fonts = 0
- let g:airline_solarized_bg='dark'
- if !exists('g:airline_symbols')
- let g:airline_symbols = {}
- endif
- let g:airline_symbols.space = "\ua0"
- let g:airline#extensions#whitespace#checks = [ 'indent' ]
- let g:airline_left_sep=''
- let g:airline_right_sep=''
- let g:airline_section_x=''
- let g:airline_section_y=''
- let g:airline#extensions#tabline#enabled = 1
- let g:airline#extensions#tabline#fnamemod = ':t'
- let g:airline_theme='powerlineish'
- " let g:airline_theme='base16_greenscreen'
- " let g:airline#extensions#tabline#left_sep = ' '
- " let g:airline#extensions#tabline#left_alt_sep = '|'
- colorscheme jkg2
- if has('gui_running')
- " for Gui versions of vim. see :help guioptions for more info
- "set guioptions=aAce
- set guioptions=egmrt
- " colorscheme ir_black
- " colorscheme flattened_dark
- " set guifont=Sauce\ Code\ Powerline\ Light:h13
- set guifont=Monaco:h14
- " for MacVim
- "if has("macunix")
- "set transparency=0
- "end
- set transparency=0
- elseif version >= 700 && &term != 'cygwin'
- " configure 256 color schemes for terminal using CSApprox or guicolorscheme
- set t_Co=256
- if has('gui')
- let g:CSApprox_attr_map = { 'bold' : 'bold', 'italic' : '', 'sp' : '' }
- " colorscheme pablo
- " colorscheme jkg1
- " colorscheme wal
- else
- " colorscheme pablo
- " colorscheme jkg1
- " colorscheme wal
- endif
- endif
- " Disable balloon popup since theres a plugin that makes it really annoying
- " set noballooneval
- " Syntax hilight based on filetype, which is autmatically determined.
- " The filetype plugin needs to be reinitialized
- syntax on
- "filetype off
- filetype on
- filetype plugin on
- filetype indent on
- " Enable syntax folding for blocks and comments.
- set foldmethod=syntax
- set foldminlines=3
- set foldlevel=100
- " indentation configuration
- "set cindent
- "set smartindent
- set autoindent
- " Convert tabs to spaces, use 2 spaces in place of tabs.
- set expandtab
- set tabstop=2
- set shiftwidth=2
- " text search options
- set hlsearch
- set incsearch
- set ignorecase
- set smartcase
- " hide buffers instead of closing them when you :q, keeping their undo history
- set hidden
- " Open new windows on the bottom and right instead of the top and left.
- set splitbelow
- set splitright
- " increase the default command line history
- set history=1000
- " File name tab completion functions like bash, it gives you a list of
- " options instead of automatically filling in the first possible match.
- set wildmenu
- " It will however, with this option, complete up to the first character of
- " ambiguity.
- " set wildmode=list:longest
- set wildmode=longest:full,full
- " Show line numbers
- set number
- " Make clipbord work on OS X. This makes copy/paste operations trivial between
- " vim and other applications since they all use the same clipboard now.
- " set clipboard=unnamed
- " visual select automatically copies to X11's selection ("middle click") buffer
- " set go+=a
- " scrolls the buffer before you reach the last line of the window
- set scrolloff=3
- " Always show status line
- set ls=2
- " default encoding
- set encoding=utf-8
- " sets backspace key functions, allows it to backspace over end of line
- " characters, start of line, and indentation
- set backspace=indent,eol,start
- " movement keys will take you to the next or previous line
- " set whichwrap+=<,>,h,l
- " enable mouse in console
- " set mousemodel=extend
- " set mouse=a
- " disable mouse in console
- set mouse-=a
- " improve autocomplete menu color
- highlight Pmenu ctermbg=238 gui=bold
- " set the spellcheck language
- setlocal spell spelllang=en_us
- " disable spellcheck by default
- set nospell
- " for exuberant CTags support
- set tags=./tags;/
- " use a user-local vim-specific directory for backups rather than the global
- " tmp directory by default
- set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
- set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
- " no backups for crontab
- autocmd filetype crontab setlocal nobackup nowritebackup
- " treat question marks as part of a word in ruby
- autocmd BufRead *.rb,*.rake,*.rhtml,<ruby> set isk=?,@,48-57,_,192-255
- " disable wordwrap when looking at CSVs
- autocmd BufRead *.csv,*.csv*,<csv> set nowrap
- " setting active warehouse dsl files to ruby type
- autocmd BufRead,BufNewFile *.ebf,*.ctl set filetype=ruby
- " setting rabl template files to ruby type
- autocmd BufRead,BufNewFile *.rabl set filetype=ruby
- " setting erb to ruby
- autocmd BufRead,BufNewFile *.erb set filetype=ruby
- " setting for groovy
- au BufNewFile,BufRead *.groovy setf groovy
- au BufNewFile,BufRead Jenkinsfile setf groovy
- " turn off auto comments for newlines
- autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
- " nowrap for json files
- autocmd FileType json set nowrap
- " chef plugin
- " au BufNewFile,BufRead */*cookbooks/* call s:SetupChef()
- autocmd FileType ruby,eruby set filetype=ruby.eruby.chef
- " remove whistespace at end of line before write
- func! StripTrailingWhitespace()
- normal mZ
- %s/\s\+$//e
- normal `Z
- endfunc
- " au BufWrite * if ! &bin | call StripTrailingWhitespace() | endif
- " display the file name of the current file in the Terminal (xterm/item/&c) title
- if has('title')
- set title
- autocmd BufEnter * let &titlestring = "vim: " . expand("%:p:~")
- endif
- " JSON formatting
- func! FormatJSON()
- :%!python -c "import json, sys, collections; print json.dumps(json.load(sys.stdin, object_pairs_hook=collections.OrderedDict), indent=2)"
- endfunc
- let g:vim_json_syntax_conceal = 0
- " shortcuts
- " for rails.vim alternate between test and tested
- map <leader>t :A<CR>
- map <leader>ts :AS<CR>
- map <leader>tv :AV<CR>
- " for rails.vim swap to model/control/etc from associated file
- map <leader>rm :Rmodel<CR>
- map <leader>rc :Rcontroller<CR>
- map <leader>rh :Rhelper<CR>
- map <leader>ru :Runittest<CR>
- map <leader>rf :Rfunctionaltest<CR>
- map <leader>ro :Robserver<CR>
- map <leader>rv :Rview<CR>
- map <leader>rl :Rlocale<CR>
- " for CtrlP
- map <leader>ff :CtrlP<CR>
- map <leader>fb :CtrlPBuffer<CR>
- map <leader>ft :CtrlPTag<CR>
- map <leader>fq :CtrlPQuickfix<CR>
- map <leader>fd :CtrlPDir<CR>
- map <leader>fr :CtrlPRTS<CR>
- map <leader>fm :CtrlPMRU<CR>
- " for gundo
- map <leader>g :GundoToggle<CR>
- " runs diff against the current buffer and the file on disk
- map <leader>d :w !diff % -<CR>
- " When pressing <leader>cd switch to the directory of the open buffer
- map <leader>cd :cd %:p:h<CR>
- " search hilighting control, enables and disable intelligently and toggles
- nnoremap / :set hlsearch<CR>/
- nnoremap ? :set hlsearch<CR>?
- nnoremap n :set hlsearch<CR>n
- nnoremap N :set hlsearch<CR>N
- nnoremap <CR> :noh<CR><CR>
- nnoremap <leader>/ :set hlsearch!<CR>
- " buffer maps
- map gn :bn<cr>
- map gp :bp<cr>
- map gd :bd<cr>
- " tab navigation like firefox
- nmap <C-S-tab> :tabprevious<CR>
- nmap <C-tab> :tabnext<CR>
- map <C-S-tab> :tabprevious<CR>
- map <C-tab> :tabnext<CR>
- imap <C-S-tab> <ESC>:tabprevious<CR>i
- imap <C-tab> <ESC>:tabnext<CR>i
- nmap <C-t> :tabnew<CR>
- imap <C-t> <ESC>:tabnew<CR>
- " Bash like keys for the command line
- cnoremap <C-A> <Home>
- cnoremap <C-E> <End>
- cnoremap <C-K> <C-U>
- " cnoremap <C-P> <Up>
- " cnoremap <C-N> <Down>
- " Easy way to move between windows
- map <C-j> <C-W>j
- map <C-k> <C-W>k
- map <C-h> <C-W>h
- map <C-l> <C-W>l
- " make mouse scrolling work in vim!!!
- " map <M-Esc>[62~ <ScrollWheelUp>
- " map <M-Esc>[63~ <ScrollWheelDown>
- " map <M-Esc>[64~ <S-ScrollWheelUp>
- " map <M-Esc>[65~ <S-ScrollWheelDown>
- " map! <M-Esc>[62~ <ScrollWheelUp>
- " map! <M-Esc>[63~ <ScrollWheelDown>
- " map! <M-Esc>[64~ <S-ScrollWheelUp>
- " map! <M-Esc>[65~ <S-ScrollWheelDown>
- " make keypad work in vim with iTerm on OS X!
- " map <Esc>Oq 1
- " map <Esc>Or 2
- " map <Esc>Os 3
- " map <Esc>Ot 4
- " map <Esc>Ou 5
- " map <Esc>Ov 6
- " map <Esc>Ow 7
- " map <Esc>Ox 8
- " map <Esc>Oy 9
- " map <Esc>Op 0
- " map <Esc>On .
- " map <Esc>OQ /
- " map <Esc>OR *
- " map <kPlus> +
- " map <Esc>OS -
- " map! <Esc>Oq 1
- " map! <Esc>Or 2
- " map! <Esc>Os 3
- " map! <Esc>Ot 4
- " map! <Esc>Ou 5
- " map! <Esc>Ov 6
- " map! <Esc>Ow 7
- " map! <Esc>Ox 8
- " map! <Esc>Oy 9
- " map! <Esc>Op 0
- " map! <Esc>On .
- " map! <Esc>OQ /
- " map! <Esc>OR *
- " map! <kPlus> +
- " map! <Esc>OS -
- let g:nerdtree_tabs_open_on_console_startup=0
- " tagbar
- nmap <F8> :TagbarToggle<CR>
- " groovy for tagbar
- let g:tagbar_type_groovy = {
- \ 'ctagstype' : 'groovy',
- \ 'kinds' : [
- \ 'p:package:1',
- \ 'c:classes',
- \ 'i:interfaces',
- \ 't:traits',
- \ 'e:enums',
- \ 'm:methods',
- \ 'f:fields:1'
- \ ]
- \ }
- " (Optional)Remove Info(Preview) window
- " set completeopt-=preview
- " (Optional)Hide Info(Preview) window after completions
- autocmd CursorMovedI * if pumvisible() == 0|pclose|endif
- autocmd InsertLeave * if pumvisible() == 0|pclose|endif
- " vim-commentary
- " autocmd FileType terraform setlocal commentstring=#\ %s
- " Clear last search highlighting
- " map <Space> :noh<cr>
- " nnoremap <cr> :noh<CR><CR>:<backspace>
- nnoremap <esc><esc> :noh<return>
- " show ALE in vim-airline statusline
- let g:airline#extensions#ale#enabled = 1
- " format JSON shortcut
- com! FormatJSON %!python -m json.tool
- " disable ALE on startup
- let g:ale_enabled = 0
- " indentline
- let g:indentLine_char = ' '
- let g:indentLine_bgcolor_term = 235
- " unicode symbols
- " terraform
- let g:terraform_align=1
- let g:terraform_fold_sections=1
- au FileType terraform setlocal foldlevel=0
- let g:terraform_remap_spacebar=1
- autocmd FileType terraform setlocal commentstring=#%s
- " Dash
- :nmap <silent> <leader>d <Plug>DashSearch
- " Neoformat
- let g:neoformat_terraform = {
- \ 'exe': 'terraform',
- \ 'args': ['fmt'],
- \ 'replace': 0,
- \ 'stdin': 0,
- \ 'valid_exit_codes': [0, 23],
- \ 'no_append': 1,
- \ }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement