From 7ff5472176333a6bb249ca9b3ac07d3725730878 Mon Sep 17 00:00:00 2001 From: iGor milhit Date: Thu, 2 Mar 2023 09:10:50 +0100 Subject: [PATCH] snippets: implement the use of snippets - Create a new folder for snippets. - Creates an HTML snippet. - Creates a Markdown snippet. - Adds auto commands in the configuration to fill in new buffer with the snippets. - Documents the creation of the symlink in the README in order to get the snippets working. Co-Authored-by: iGor milhit --- init.vim | 12 ++++++++++-- snippets/boilerplate.html | 35 +++++++++++++++++++++++++++++++++++ snippets/template.md | 8 ++++++++ 3 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 snippets/boilerplate.html create mode 100644 snippets/template.md diff --git a/init.vim b/init.vim index ba21a4f..70b8ba7 100644 --- a/init.vim +++ b/init.vim @@ -204,6 +204,9 @@ let g:coc_global_extensions = ['coc-html', 'coc-json', 'coc-css', 'coc-markdownl autocmd FileType scss setl iskeyword+=@-@ " Add @ to iskeyword option let g:coc_filetype_map = { 'pandoc': 'markdown' } " Allow markdownlint to recognized pandoc filetype +" Set the Semantic Menu highlight group +hi CocMenuSel ctermbg=252 + " ######################################### " ######################################### " Python provider in a pyenv @@ -244,14 +247,19 @@ nnoremap ? :Helptags autocmd! User GoyoEnter Limelight autocmd! User GoyoLeave Limelight! +" ######################################### +" ######################################### " Syntax coloration and color theme syntax enable set background=light let g:edge_style = "light" colorscheme edge -" Set the Semantic Menu highlight group -hi CocMenuSel ctermbg=252 +" ######################################### +" ######################################### +" Snippets +autocmd BufNewFile *.html 0r ~/.config/nvim/snippets/boilerplate.html +autocmd BufNewFile *.md 0r ~/.config/nvim/snippets/template.md " ######################################### " ######################################### diff --git a/snippets/boilerplate.html b/snippets/boilerplate.html new file mode 100644 index 0000000..20de9fa --- /dev/null +++ b/snippets/boilerplate.html @@ -0,0 +1,35 @@ + + + + + + + Unique page title - My Site + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/snippets/template.md b/snippets/template.md new file mode 100644 index 0000000..a5b2949 --- /dev/null +++ b/snippets/template.md @@ -0,0 +1,8 @@ +--- +title: +date: +id: +tags: [] +--- + +##