diff --git a/roles/dotfiles/files/vimrc b/roles/dotfiles/files/vimrc index 810673f..da37387 100644 --- a/roles/dotfiles/files/vimrc +++ b/roles/dotfiles/files/vimrc @@ -7,6 +7,8 @@ syntax on au BufNewFile,BufRead *.go set tabstop=4 softtabstop=4 shiftwidth=4 \ expandtab autoindent fileformat=unix +au BufNewFile,BufRead *.js set tabstop=4 softtabstop=4 shiftwidth=4 + \ expandtab autoindent fileformat=unix au BufNewFile,BufRead *.toml set tabstop=4 softtabstop=4 shiftwidth=4 \ expandtab autoindent fileformat=unix au BufNewFile,BufRead *.json set tabstop=2 softtabstop=2 shiftwidth=2 @@ -40,7 +42,12 @@ autocmd FileType bzl :set tabstop=4 softtabstop=4 shiftwidth=4 expandtab autoind autocmd FileType nginx :set tabstop=2 softtabstop=2 shiftwidth=2 expandtab autoindent fileformat=unix autocmd FileType gitcommit :set spell autocmd FileType markdown :set spell -" vim-plug +" vim-plug automatic install for the first time +let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim' +if empty(glob(data_dir . '/autoload/plug.vim')) + silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' + autocmd VimEnter * PlugInstall --sync | source $MYVIMRC +endif " :PlugInstall to install new one call plug#begin('~/.vim/plugged') Plug 'dense-analysis/ale' @@ -56,6 +63,7 @@ Plug 'psf/black', {'branch': 'main'} Plug 'fisadev/vim-isort' Plug 'jvirtanen/vim-hcl' " HCL files used by terraform Plug 'hashivim/vim-terraform' +Plug 'Yggdroot/indentLine' " show git diff in sign column Plug 'airblade/vim-gitgutter' " Themes @@ -65,7 +73,6 @@ Plug 'vim-python/python-syntax' Plug 'wgwoods/vim-systemd-syntax' Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' } Plug 'cespare/vim-toml',{ 'branch': 'main' } -Plug 'Yggdroot/indentLine' call plug#end() " Theme