snip


Logs | Files | README | LICENSE | GitLab


1
commit 503fdb799a12ce31b34f985af5402a9c5611c773
2
Author: Connor Etherington <[email protected]>
3
Date:   Sat Jul 8 06:01:44 2023 +0200
4
5
    Auto-Commit Update - 20230708
6
---
7
 PKGBUILD                     |  14 ++++---
8
 README.md                    |  92 +++++++++++++++++++++++++++++++++++++++++++
9
 usr/share/doc/snip/README.md |  92 +++++++++++++++++++++++++++++++++++++++++++
10
 usr/share/man/man1/snip.1.gz | Bin 0 -> 544 bytes
11
 4 files changed, 192 insertions(+), 6 deletions(-)
12
13
diff --git a/PKGBUILD b/PKGBUILD
14
index 599a6c7..68d626a 100644
15
--- a/PKGBUILD
16
+++ b/PKGBUILD
17
@@ -1,7 +1,7 @@
18
 # Maintainer: Connor Etherington <[email protected]>
19
 # ---
20
 pkgname=snip
21
-pkgver=1.1.4
22
+pkgver=1.1.5
23
 pkgrel=1
24
 pkgdesc="A simple snippet manager for your predefined Ultisnips Snippet Directory"
25
 arch=(any)
26
@@ -12,14 +12,14 @@ source=(
27
   "https://concise.cc/pkg/${pkgname}-${pkgver}-${pkgrel}-$arch.pkg.tar.xz"
28
 )
29
 sha512sums=(
30
-  '302e1175e1171caa30ea8cede49da99acb4a6e84e5a6a7ad2f6de3ecfcecf9c52bfd0b84819243920716ffc9f4e659dbd624ef6b6cffd883a351e29f63b48794'
31
-  )
32
+  '032648a4e9b400716b497c471b3d41ad968568bdd9c15bfa1308c23d00c1ff116e9ada809dc7258745dc9171a056277af0d7bf48949c6b438b54f38bf6c32e18'
33
+)
34
 md5sums=(
35
-  'f7ed0ba0d8a3ff79e34476d92fc7532f'
36
-  )
37
+  'd3edd7cbb7de82cce403f663abc72b0a'
38
+)
39
 validpgpkeys=(
40
   '81BACEEBC3EA26E127166E4A819BB92A9A48160E'
41
-  )
42
+)
43
 
44
 package() {
45
 
46
@@ -28,5 +28,7 @@ package() {
47
 
48
   install -Dm644 usr/share/licenses/${pkgname}/LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
49
   install -Dm755 usr/bin/${pkgname} "${pkgdir}/usr/bin/${pkgname}"
50
+  install -Dm755 usr/share/doc/${pkgname}/README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md"
51
+  install -Dm755 usr/share/man/man1/${pkgname}.1.gz "${pkgdir}usr/share/man/man1/${pkgname}.1.gz"
52
 
53
 }
54
diff --git a/README.md b/README.md
55
new file mode 100644
56
index 0000000..83bc435
57
--- /dev/null
58
+++ b/README.md
59
@@ -0,0 +1,92 @@
60
+# Snip Snippet Editor
61
+
62
+The Snip Snippet Editor is a command-line utility that allows users to create and edit snippets for various programming
63
+languages and file types. It provides a convenient interface for managing snippets and organizing them by category and
64
+priority.
65
+
66
+## Installation
67
+
68
+To install the Snip Snippet Editor, follow these steps:
69
+
70
+1. Clone the repository:
71
+
72
+   ```shell
73
+   $ git clone https://gitlab.com/a4to/snip.git
74
+   ```
75
+
76
+2. Change to the snip directory:
77
+
78
+   ```shell
79
+   $ cd snip
80
+   ```
81
+
82
+3. Run the install script:
83
+
84
+   ```shell
85
+   $ make install
86
+   ```
87
+
88
+   The Snip Snippet Editor and its dependencies will be installed.
89
+
90
+4. Add the following code snippet to your Vim configuration file (`init.vim` or `vimrc`):
91
+
92
+   ```vim
93
+   function! AutoCompleteSnippets()
94
+       let l:line_number = 1
95
+       while l:line_number <= line('$')
96
+           let l:line = getline(l:line_number)
97
+           if l:line =~ '^snippet'
98
+               let l:autocompletion_line = l:line
99
+
100
+               if l:autocompletion_line =~ ' "$'
101
+                   let l:autocompletion_line = l:autocompletion_line . ' '
102
+                   call setline(l:line_number, l:autocompletion_line)
103
+               endif
104
+
105
+               if l:autocompletion_line !~ ' A$' && l:autocompletion_line !~# '".*\\C\\ca.*'
106
+                   let l:autocompletion_line = l:autocompletion_line . 'A'
107
+                   call setline(l:line_number, l:autocompletion_line)
108
+               endif
109
+
110
+               if l:autocompletion_line =~ '"A'
111
+                   let l:autocompletion_line = substitute(l:autocompletion_line, '"A', '" A', 'g')
112
+                   call setline(l:line_number, l:autocompletion_line)
113
+               endif
114
+           endif
115
+           let l:line_number += 1
116
+       endwhile
117
+   endfunction
118
+
119
+   augroup AutoCompleteSnippetsOnSave
120
+       autocmd!
121
+       autocmd BufWritePost AutoFill-p1.snippets call AutoCompleteSnippets()
122
+   augroup END
123
+   ```
124
+
125
+   This code snippet should be placed in your Vim configuration file (e.g., `init.vim` or `vimrc`). It defines a function
126
+   `AutoCompleteSnippets()` that is triggered when saving a file named `AutoFill-p1.snippets`. It adds automatic
127
+   autocompletion for snippets by modifying the snippet lines that start with `snippet` and appending `A` after the
128
+   snippet trigger. This enables faster and more convenient snippet expansion in Vim.
129
+
130
+5. Save and reload your Vim configuration file.
131
+
132
+## Usage
133
+
134
+To launch the Snip Snippet Editor, simply run the following command:
135
+
136
+```shell
137
+$ snip
138
+```
139
+
140
+This will open the graphical interface using `dialog` where you can perform various operations, such as creating new
141
+snippet categories and editing existing snippets.
142
+
143
+## Contributing
144
+
145
+Contributions are welcome! If you encounter any issues or have suggestions for improvements, please submit a bug report
146
+or open a pull request on the [snip repository](https://gitlab.com/a4to/snip).
147
+
148
+## License
149
+
150
+The Snip Snippet Editor is open-source software licensed under the [MIT license](https://opensource.org/licenses/MIT)
151
+
152
diff --git a/usr/share/doc/snip/README.md b/usr/share/doc/snip/README.md
153
new file mode 100644
154
index 0000000..83bc435
155
--- /dev/null
156
+++ b/usr/share/doc/snip/README.md
157
@@ -0,0 +1,92 @@
158
+# Snip Snippet Editor
159
+
160
+The Snip Snippet Editor is a command-line utility that allows users to create and edit snippets for various programming
161
+languages and file types. It provides a convenient interface for managing snippets and organizing them by category and
162
+priority.
163
+
164
+## Installation
165
+
166
+To install the Snip Snippet Editor, follow these steps:
167
+
168
+1. Clone the repository:
169
+
170
+   ```shell
171
+   $ git clone https://gitlab.com/a4to/snip.git
172
+   ```
173
+
174
+2. Change to the snip directory:
175
+
176
+   ```shell
177
+   $ cd snip
178
+   ```
179
+
180
+3. Run the install script:
181
+
182
+   ```shell
183
+   $ make install
184
+   ```
185
+
186
+   The Snip Snippet Editor and its dependencies will be installed.
187
+
188
+4. Add the following code snippet to your Vim configuration file (`init.vim` or `vimrc`):
189
+
190
+   ```vim
191
+   function! AutoCompleteSnippets()
192
+       let l:line_number = 1
193
+       while l:line_number <= line('$')
194
+           let l:line = getline(l:line_number)
195
+           if l:line =~ '^snippet'
196
+               let l:autocompletion_line = l:line
197
+
198
+               if l:autocompletion_line =~ ' "$'
199
+                   let l:autocompletion_line = l:autocompletion_line . ' '
200
+                   call setline(l:line_number, l:autocompletion_line)
201
+               endif
202
+
203
+               if l:autocompletion_line !~ ' A$' && l:autocompletion_line !~# '".*\\C\\ca.*'
204
+                   let l:autocompletion_line = l:autocompletion_line . 'A'
205
+                   call setline(l:line_number, l:autocompletion_line)
206
+               endif
207
+
208
+               if l:autocompletion_line =~ '"A'
209
+                   let l:autocompletion_line = substitute(l:autocompletion_line, '"A', '" A', 'g')
210
+                   call setline(l:line_number, l:autocompletion_line)
211
+               endif
212
+           endif
213
+           let l:line_number += 1
214
+       endwhile
215
+   endfunction
216
+
217
+   augroup AutoCompleteSnippetsOnSave
218
+       autocmd!
219
+       autocmd BufWritePost AutoFill-p1.snippets call AutoCompleteSnippets()
220
+   augroup END
221
+   ```
222
+
223
+   This code snippet should be placed in your Vim configuration file (e.g., `init.vim` or `vimrc`). It defines a function
224
+   `AutoCompleteSnippets()` that is triggered when saving a file named `AutoFill-p1.snippets`. It adds automatic
225
+   autocompletion for snippets by modifying the snippet lines that start with `snippet` and appending `A` after the
226
+   snippet trigger. This enables faster and more convenient snippet expansion in Vim.
227
+
228
+5. Save and reload your Vim configuration file.
229
+
230
+## Usage
231
+
232
+To launch the Snip Snippet Editor, simply run the following command:
233
+
234
+```shell
235
+$ snip
236
+```
237
+
238
+This will open the graphical interface using `dialog` where you can perform various operations, such as creating new
239
+snippet categories and editing existing snippets.
240
+
241
+## Contributing
242
+
243
+Contributions are welcome! If you encounter any issues or have suggestions for improvements, please submit a bug report
244
+or open a pull request on the [snip repository](https://gitlab.com/a4to/snip).
245
+
246
+## License
247
+
248
+The Snip Snippet Editor is open-source software licensed under the [MIT license](https://opensource.org/licenses/MIT)
249
+
250
diff --git a/usr/share/man/man1/snip.1.gz b/usr/share/man/man1/snip.1.gz
251
new file mode 100644
252
index 0000000..f8b1cde
253
Binary files /dev/null and b/usr/share/man/man1/snip.1.gz differ