updated github_team.tf
0dbd7d47
Hari Sekhon
committed
1 changed file
github_team.tf
/github_team.tf+30
/github_team.tf
Add comment 274 " for scripts that don't end in .sh like Google Cloud Shell's .customize_environment
Add comment 275 au FileType sh nmap ;l :w<CR>:!clear; cd "%:p:h" && shellcheck -x -Calways "%:t" \| more -R<CR>
Add comment 276
Add comment 277 Plus   au BufNewFile,BufRead .vimrc nmap ;l :w<CR> :!clear<CR> :call LintVimrc() <CR>
Add comment 278 Plus  
Add comment 277 279 " these tools are in the https://github.com/HariSekhon/DevOps-Python-tools & DevOps-Bash-tools repos which should be downloaded, run 'make' and add to $PATH
Add comment 278 280 au BufNew,BufRead *.csv nmap ;l :w<CR>:!clear; validate_csv.py "%"<CR>
Add comment 279 281 au BufNew,BufRead *.cson nmap ;l :w<CR>:!clear; validate_cson.py "%"<CR>
Add comment 387 389 nmap ;L :w<CR> :! lint.sh % <CR>
Add comment 388 390 nmap ;. :w<CR> :call GitPull() <CR>
Add comment 389 391 nmap ;[ :w<CR> :call GitPush() <CR>
Add comment 392 Plus  nmap ;, :w<CR> :s/^/</ <CR> :s/$/>/ <CR>
Add comment 390 393 " write then grep all URLs that are not mine, followed by all URLs that are mine in reverse order to urlview
Add comment 391 394 " this is so that 3rd party URLs followed by my URLs from within the body of files get higher priority than my header links
Add comment 392 395 nmap <silent> ;u :w<CR> :! bash -c 'grep -vi harisekhon "%" ; grep -i harisekhon "%" \| tail -r' \| urlview <CR> :<CR>
Add comment 451 454 :set ts sts sw et filetype
Add comment 452 455 endfunction
Add comment 453 456 endif
Add comment 457 Plus  
Add comment 458 Plus  ":! bash -c 'vim -c "source %" -c "q" && echo "ViM basic lint validation passed" || "ViM basic lint validation failed"'
Add comment 459 Plus  "":! if type -P vint &>/dev/null; then vint "%"; fi
Add comment 460 Plus  function! LintVimrc()
Add comment 461 Plus   let l:vimrc_path = expand('~/.vimrc')
Add comment 462 Plus  
Add comment 463 Plus   echo "Sourcing ~/.vimrc file..."
Add comment 464 Plus   try
Add comment 465 Plus   execute 'source' l:vimrc_path
Add comment 466 Plus   echohl InfoMsg | echo "No syntax errors found in .vimrc." | echohl None
Add comment 467 Plus   catch
Add comment 468 Plus   echohl ErrorMsg | echo "Error found in .vimrc while sourcing." | echohl None
Add comment 469 Plus   return
Add comment 470 Plus   endtry
Add comment 471 Plus  
Add comment 472 Plus   if executable('vint')
Add comment 473 Plus   echo "Running vint..."
Add comment 474 Plus   let l:vint_output = system('vint ' . l:vimrc_path)
Add comment 475 Plus   if v:shell_error
Add comment 476 Plus   echohl ErrorMsg | echo l:vint_output | echohl None
Add comment 477 Plus   else
Add comment 478 Plus   echohl InfoMsg | echo "No linting issues found by vint." | echohl None
Add comment 479 Plus   endif
Add comment 480 Plus   else
Add comment 481 Plus   echohl WarningMsg | echo "vint is not installed or not found in PATH." | echohl None
Add comment 482 Plus   endif
Add comment 483 Plus  endfunction
Add comment 454 484
Add comment 455 485 function! ToggleSyntax()
Add comment 456 486 if exists("g:syntax_on")