Snip Snippet Editor
Snip is a command-line utility that allows users to create and edit snippets for various programming languages and file types. It provides a convenient interface for managing snippets and organizing them by category and priority.
Installation
To install the Snip Snippet Editor, follow these steps:
-
Clone the repository:
git clone https://gitlab.com/a4to/snip.git
-
Change to the snip directory:
cd snip
-
Run the install script:
make install
The Snip Snippet Editor and its dependencies will be installed.
-
Add the following code snippet to your Vim configuration file (
init.vim
orvimrc
):
" ---------------------------
" AutoComplete Snippets:
" ---------------------------
" This code snippet ensures that all AutoFill (auto-completion) snippets,
" are automatically expanded when the snippet is triggered.
function! AutoCompleteSnippets()
let l:line_number = 1
while l:line_number <= line('$')
let l:line = getline(l:line_number)
if l:line =~ '^snippet'
let l:autocompletion_line = l:line
if l:autocompletion_line =~ ' "$'
let l:autocompletion_line = l:autocompletion_line . ' '
call setline(l:line_number, l:autocompletion_line)
endif
if l:autocompletion_line !~ 'A$' && l:autocompletion_line !~# '" .*\C\ca.*'
if l:autocompletion_line !~ '"$'
let l:autocompletion_line = l:autocompletion_line . ' "" A'
else