templates.vim 303 B

123456
  1. " Template for shell scripts.
  2. " Removes comments after line 1, places cursor at end of file.
  3. autocmd BufNewFile *.sh 0r ~/dotfiles/vim/templates/bashscript | 2,$ g/^#/d | normal G
  4. " Make shell scripts executable on save.
  5. autocmd BufWritePost *.sh if getline(1) =~ "^#!/bin/" | silent !chmod +x <afile>