]> git.rmz.io Git - dotfiles.git/blobdiff - vim/ultisnips/all.snippets
nvim: add FPP copyright snippet
[dotfiles.git] / vim / ultisnips / all.snippets
index 0a637f6caefffa910243753b0e8f474788c7bf7b..1d306ad46d8428051d27d0f6988f1c00f6a40935 100644 (file)
@@ -12,7 +12,7 @@ def _parse_comments(s):
                        flags, text = next(i).split(':', 1)
 
                        if len(flags) == 0:
-                               rv.append((text, text, text, ""))
+                               rv.append((text, text, text, text, ""))
                        # parse 3-part comment, but ignore those with O flag
                        elif 's' in flags and 'O' not in flags:
                                ctriple = []
@@ -29,12 +29,16 @@ def _parse_comments(s):
                                flags,text = next(i).split(':', 1)
                                assert(flags[0] == 'e')
                                ctriple.append(text)
-                               ctriple.append(indent)
 
-                               rv.append(ctriple)
-                       elif 'b' in flags:
+                               flags,text = next(i).split(':', 1)
+                               assert(len(flags) == 0)
+                               ctriple.append(text)
+
+                               ctriple.append(indent)
+                               rv.insert(0, ctriple)
+                       elif 'b' in flags and 'f' not in flags:
                                if len(text) == 1:
-                                       rv.insert(0, (text,text,text, ""))
+                                       rv.insert(0, (text,text,text, text, ""))
        except StopIteration:
                return rv
 
@@ -43,7 +47,8 @@ def _get_comment_format():
        the current file. """
        return _parse_comments(vim.eval("&comments"))[0]
 
-b, m, e, i = _get_comment_format()
+b, m, e, c, i = _get_comment_format()
+
 def _git_user_name():
        try:
                snip.rv = subprocess.check_output(["git", "config", "user.name"]).strip()
@@ -58,6 +63,14 @@ def _git_user_email():
 endglobal
 
 
+snippet fix "FIXME" w
+`!p snip.rv = c`FIXME ${0}
+endsnippet
+
+snippet todo "TODO" w
+`!p snip.rv = c`TODO ${0}
+endsnippet
+
 snippet GPL2 "GPL2 License" b
 `!p snip.rv = b`
 `!p snip.rv = i + m` ${1:One line to give the program's name and a brief description.}
@@ -168,7 +181,7 @@ snippet AGPL3 "AGPL3 License" b
 ${0}
 endsnippet
 
-snippet GMGPL linking exception "GMGPL linking exception License" b
+snippet GMGPL "GMGPL linking exception License" b
 `!p snip.rv = b`
 `!p snip.rv = i + m` As a special exception, if other files instantiate generics from
 `!p snip.rv = i + m` this unit, or you link this unit with other files to produce an
@@ -392,3 +405,13 @@ snippet AGPL "AGPL License" b
 `!p snip.rv = i + m` along with this program. If not, see <http://www.gnu.org/licenses/>.
 `!p snip.rv = i + e`
 endsnippet
+
+snippet FPP "FPP Copyright" b
+`!p snip.rv = b`
+`!p snip.rv = i + m` Copyright © Focal Point Positioning Limited `!v strftime("%Y")`. All Rights Reserved.
+`!p snip.rv = i + m` This code is the copyright of Focal Point Positioning Limited and
+`!p snip.rv = i + m` cannot be used, copied or distributed without the express written
+`!p snip.rv = i + m` permission of Focal Point Positioning Limited.
+`!p snip.rv = i + e`
+${0}
+endsnippet