Compare commits

..

2 Commits

Author SHA1 Message Date
bdf7cbd88c Integrated vim-spellsync
Magically rebuild Vim spell files if word lists are modified outside of
Vim. One use case would be if word lists are stored in a source control
system like Git and shared across multiple computers\. SpellSync also
creates `.gitignore` and `.gitattributes` files in Vim's spell directories
to exclude binary spell files and uses its union merge driver to avoid
conflicts.
[link]](https://github.com/micarmst/vim-spellsync)
2024-02-25 13:26:06 -05:00
d3407f9bab Added Markdown and shell scrip templates
and logic to update time stamps n those files for file creation and modification
2024-02-25 13:24:25 -05:00
7 changed files with 37 additions and 7 deletions

1
.vim/spell/.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
*.add merge=union

2
.vim/spell/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*.spl
*.sug

View File

@@ -11,3 +11,4 @@ TiddlyWiki
Royalton
Pantek
Crissy
Trello

Binary file not shown.

View File

@@ -1,9 +1,7 @@
:insert
# title
Updated:
- Created :
- Updated :
---
## Summary

View File

@@ -1,13 +1,14 @@
:insert
#!/usr/bin/env bash
#===============================================================================
#
# FILE:
# USAGE:
# DESCRIPTION:
# REQUIREMENTS:
# NOTES:
# AUTHOR: C Hawley
# CREATED:
# UPDATED:
#
#===============================================================================

29
.vimrc
View File

@@ -107,6 +107,11 @@ Plug 'dense-analysis/ale'
Plug 'godlygeek/tabular'
Plug 'preservim/vim-markdown'
" Vim Spellsync
" Magically rebuild Vim spell files if word lists are modified outside of Vim
" https://github.com/micarmst/vim-spellsync
Plug 'micarmst/vim-spellsync'
call plug#end()
" ---------------------------------------------------------------------------------------------------------------------
@@ -284,6 +289,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 +322,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