Added Markdown and shell scrip templates
and logic to update time stamps n those files for file creation and modification
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
:insert
|
||||
# title
|
||||
|
||||
Updated:
|
||||
- Created :
|
||||
- Updated :
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
:insert
|
||||
#!/usr/bin/env bash
|
||||
#===============================================================================
|
||||
#
|
||||
# FILE:
|
||||
# USAGE:
|
||||
# DESCRIPTION:
|
||||
# REQUIREMENTS:
|
||||
# NOTES:
|
||||
# AUTHOR: C Hawley
|
||||
# CREATED:
|
||||
# UPDATED:
|
||||
#
|
||||
#===============================================================================
|
||||
|
||||
|
||||
24
.vimrc
24
.vimrc
@@ -284,6 +284,28 @@ hi clear SpellRare
|
||||
hi SpellBad cterm=underline ctermbg=black ctermfg=red
|
||||
hi SpellCap cterm=underline ctermbg=black ctermfg=red
|
||||
|
||||
" ---------------------------------------------------------------------------------------------------------------------
|
||||
" ==> Templates: markdown documents (.md)
|
||||
|
||||
autocmd BufNewFile *.md so $HOME/.vim/templates/md
|
||||
autocmd BufNewFile *.md %s/title/\=expand('%:t:r')/g
|
||||
autocmd BufNewFile *.md exe "g/^- Created :.*/s//- Created : " .strftime("%Y-%m-%d")
|
||||
autocmd BufNewFile *.md exe "normal Go"
|
||||
autocmd BufWritePre,filewritepre *.md execute "normal ma"
|
||||
autocmd BufWritePre,filewritepre *.md exe "g/^- Updated :.*/s//- Updated : " .strftime("%Y-%m-%d %H:%M")
|
||||
autocmd bufWritePost,filewritepost *.md execute "normal `a"
|
||||
|
||||
" ---------------------------------------------------------------------------------------------------------------------
|
||||
" ==> Templates: shell scripts (.sh)
|
||||
|
||||
autocmd BufNewFile *.sh so $HOME/.vim/templates/sh
|
||||
autocmd BufNewFile *.sh %s/FILE:.*/\='FILE: '.expand('%:t:r')/e
|
||||
autocmd BufNewFile *.sh exe "g/CREATED:.*/s//CREATED: " .strftime("%c")
|
||||
autocmd BufNewFile *.sh exe "normal Go"
|
||||
autocmd BufWritePre,filewritepre *.sh execute "normal ma"
|
||||
autocmd BufWritePre,filewritepre *.sh exe "g/UPDATED:.*/s//UPDATED: " .strftime("%c")
|
||||
autocmd bufWritePost,filewritepost *.sh execute "normal `a"
|
||||
|
||||
" ---------------------------------------------------------------------------------------------------------------------
|
||||
" ==> Snippets
|
||||
" Pasting pre-made things
|
||||
@@ -295,7 +317,7 @@ nnoremap ,ban :-1read $HOME/.vim/templates/banner<CR>jA
|
||||
nnoremap ,begend :-1read $HOME/.vim/templates/begend<CR>jA
|
||||
|
||||
" section shell script header
|
||||
nnoremap ,sh :-1read $HOME/.vim/templates/sh<CR>jA
|
||||
"nnoremap ,sh :-1read $HOME/.vim/templates/sh<CR>jA
|
||||
|
||||
" section markdown file header
|
||||
nnoremap ,md :-1read $HOME/.vim/templates/md<CR>jA
|
||||
|
||||
Reference in New Issue
Block a user