.vimrc 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. set nocompatible " be iMproved, required
  2. filetype off " required
  3. syntax on
  4. set encoding=utf-8
  5. set ruler " Show us our row and column
  6. " Accomodate a dark background
  7. set background=dark
  8. if empty(glob('~/.vim/autoload/plug.vim'))
  9. silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
  10. \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  11. autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
  12. endif
  13. call plug#begin('~/.vim/plugged')
  14. " (Optinal) for Tag Sidebar
  15. " Plug 'majutsushi/tagbar'
  16. "Plug 'hashivim/vim-terraform'
  17. "Plug 'vim-syntastic/syntastic'
  18. "Plug 'juliosueiras/vim-terraform-completion'
  19. call plug#end()
  20. " Syntastic Config
  21. set statusline+=%#warningmsg#
  22. set statusline+=%{SyntasticStatuslineFlag()}
  23. set statusline+=%*
  24. let g:syntastic_always_populate_loc_list = 1
  25. let g:syntastic_auto_loc_list = 1
  26. let g:syntastic_check_on_open = 1
  27. let g:syntastic_check_on_wq = 0
  28. " (Optional)Remove Info(Preview) window
  29. set completeopt-=preview
  30. " (Optional)Hide Info(Preview) window after completions
  31. autocmd CursorMovedI * if pumvisible() == 0|pclose|endif
  32. autocmd InsertLeave * if pumvisible() == 0|pclose|endif
  33. " (Optional) Enable terraform plan to be include in filter
  34. let g:syntastic_terraform_tffilter_plan = 1
  35. " (Optional) Default: 0, enable(1)/disable(0) plugin's keymapping
  36. let g:terraform_completion_keys = 1
  37. " (Optional) Default: 1, enable(1)/disable(0) terraform module registry completion
  38. let g:terraform_registry_module_completion = 0
  39. let g:pymode_python = 'python3'
  40. " set the runtime path to include Vundle and initialize
  41. set rtp+=~/.vim/bundle/Vundle.vim
  42. call vundle#begin()
  43. " alternatively, pass a path where Vundle should install plugins
  44. "call vundle#begin('~/some/path/here')
  45. " let Vundle manage Vundle, required
  46. Plugin 'gmarik/Vundle.vim'
  47. " The following are examples of different formats supported.
  48. " Keep Plugin commands between vundle#begin/end.
  49. " plugin on GitHub repo
  50. "Plugin 'tpope/vim-fugitive'
  51. " plugin from http://vim-scripts.org/vim/scripts.html
  52. "Plugin 'L9'
  53. " Git plugin not hosted on GitHub
  54. "Plugin 'git://git.wincent.com/command-t.git'
  55. " git repos on your local machine (i.e. when working on your own plugin)
  56. "Plugin 'file:///home/gmarik/path/to/plugin'
  57. " The sparkup vim script is in a subdirectory of this repo called vim.
  58. " Pass the path to set the runtimepath properly.
  59. "Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
  60. " Avoid a name conflict with L9
  61. "n 'fatih/vim-go'Plugin 'user/L9', {'name': 'newL9'}
  62. " Go Plugin:
  63. "Plugin 'fatih/vim-go'
  64. Plugin 'vim-scripts/indentpython.vim'
  65. Plugin 'hashivim/vim-terraform'
  66. Plugin 'vim-syntastic/syntastic'
  67. "Plugin 'juliosueiras/vim-terraform-completion'
  68. Plugin 'saltstack/salt-vim'
  69. " All of your Plugins must be added before the following line
  70. call vundle#end() " required
  71. filetype plugin indent on " required
  72. " To ignore plugin indent changes, instead use:
  73. "filetype plugin on
  74. "
  75. " Brief help
  76. " :PluginList - lists configured plugins
  77. " :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
  78. " :PluginSearch foo - searches for foo; append `!` to refresh local cache
  79. " :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
  80. "
  81. " see :h vundle for more details or wiki for FAQ
  82. " Put your non-Plugin stuff after this line
  83. set tabstop=2
  84. set shiftwidth=2
  85. set expandtab
  86. " Python PEP-8
  87. au BufNewFile,BufRead *.py
  88. \ set tabstop=4 |
  89. \ set softtabstop=4 |
  90. \ set shiftwidth=4 |
  91. \ set expandtab |
  92. \ set autoindent |
  93. \ set foldmethod=syntax |
  94. \ set fileformat=unix
  95. au BufNewFile,BufRead *.json
  96. \ set filetype=json |
  97. \ set foldmethod=syntax
  98. " But not for most files
  99. au BufNewFile,BufRead *.js, *.html, *.css
  100. \ set tabstop=2 |
  101. \ set softtabstop=2 |
  102. \ set shiftwidth=2
  103. au BufNewFile,BufRead *.sls
  104. \ set filetype=sls
  105. au FileType gitcommit setlocal nowrap
  106. au FileType go set expandtab!
  107. "au BufNewFile,BufRead *.hcl, *.tf
  108. " \ set filetype=terraform
  109. "au BufNewFile,BufRead *.md, *.MD
  110. " \ set filetype=markdown
  111. " Flag bad whitespace
  112. " I hate this because it highlights while i'm writing
  113. "highlight BadWhitespace ctermfg=16 ctermbg=253 guifg=#000000 guibg=#F8F8F0
  114. "au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /[^\s]\s\+$/
  115. let g:terraform_fold_sections=1
  116. let g:terraform_align=1
  117. let g:terraform_fmt_on_save=1
  118. let g:syntastic_python_python_exec = 'python3'
  119. let g:syntastic_python_checkers = ['python']
  120. au BufRead * normal zR