.vimrc 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. " All of your Plugins must be added before the following line
  66. call vundle#end() " required
  67. filetype plugin indent on " required
  68. " To ignore plugin indent changes, instead use:
  69. "filetype plugin on
  70. "
  71. " Brief help
  72. " :PluginList - lists configured plugins
  73. " :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
  74. " :PluginSearch foo - searches for foo; append `!` to refresh local cache
  75. " :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
  76. "
  77. " see :h vundle for more details or wiki for FAQ
  78. " Put your non-Plugin stuff after this line
  79. set tabstop=2
  80. set shiftwidth=2
  81. set expandtab
  82. " Python PEP-8
  83. au BufNewFile,BufRead *.py
  84. \ set tabstop=4 |
  85. \ set softtabstop=4 |
  86. \ set shiftwidth=4 |
  87. \ set textwidth=79 |
  88. \ set expandtab |
  89. \ set autoindent |
  90. \ set fileformat=unix
  91. " But not for most files
  92. au BufNewFile,BufRead *.js, *.html, *.css
  93. \ set tabstop=2 |
  94. \ set softtabstop=2 |
  95. \ set shiftwidth=2
  96. " Flag bad whitespace
  97. " I hate this because it highlights while i'm writing
  98. "highlight BadWhitespace ctermfg=16 ctermbg=253 guifg=#000000 guibg=#F8F8F0
  99. "au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /[^\s]\s\+$/
  100. let g:terraform_fold_sections=1
  101. let g:terraform_align=1