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:

  1. Clone the repository:

    git clone https://gitlab.com/a4to/snip.git
  2. Change to the snip directory:

    cd snip
  3. Run the install script:

    make install

    The Snip Snippet Editor and its dependencies will be installed.

  4. Add the following code snippet to your Vim configuration file (init.vim or vimrc):

" ---------------------------
"   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