add the old snippet md files

This commit is contained in:
Travis Shears 2025-06-05 16:20:57 +02:00
parent fc0dd204c7
commit bcf8313a4b
110 changed files with 3048 additions and 0 deletions

View file

@ -0,0 +1,28 @@
---
title: "custom placeholders solution"
date: 2020-01-12T00:59:03+01:00
draft: false
snippet_types: ["vim"]
---
This little bit of magic I believe I picked up from watching a Luke Smith video. The point is to
leave placeholders in the form of the text "\<++>" in your code/writing then quickly snap to and
fill them in later.
```vim script
" placeholder magic
nnoremap <Space><Space> <Esc>/<++<CR>"_c4l
nnoremap <Space>n <Esc>l/<++><CR>h
" always fill p reg with <++>
:autocmd VimEnter * :call setreg('p', '<++>')
```
1. Thanks to the vim enter hook the magic placeholder text is always in my p register so its easy to put with **\<">\<p>**
1. Then to jump to the next placeholder and immediately start editing it with a simple **\<Space>\<Space>**
{{< asciicast-with-caption id="293101" title="placeholders demo" >}}
source:
- [Luke Smith Youtube Channel](https://www.youtube.com/channel/UC2eYFnH61tmytImy1mTYvhA)