.vimrc 3.7 KB

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