dotfiles

My dotfiles, nothing really interesting to see ...
git clone https://git.onna.be/dotfiles.git
Log | Files | Refs | README

all.snippets (4274B)


      1 # This file contains snippets that are always defined. I personally
      2 # have snippets for signatures and often needed texts
      3 
      4 # sligthly lower priority than everything else since specialized versions
      5 # should overwrite. The user needs to adjust her priority in her snippets to
      6 # ~-55 so that other filetypes will still overwrite.
      7 priority -60
      8 
      9 ##############
     10 # NICE BOXES #
     11 ##############
     12 global !p
     13 from vimsnippets import foldmarker, make_box, get_comment_format
     14 endglobal
     15 
     16 snippet box "A nice box with the current comment symbol" b
     17 `!p
     18 box = make_box(len(t[1]))
     19 snip.rv = box[0]
     20 snip += box[1]
     21 `${1:${VISUAL:content}}`!p
     22 box = make_box(len(t[1]))
     23 snip.rv = box[2]
     24 snip += box[3]`
     25 $0
     26 endsnippet
     27 
     28 snippet bbox "A nice box over the full width" b
     29 `!p
     30 if not snip.c:
     31 	width = int(vim.eval("&textwidth - (virtcol('.') == 1 ? 0 : virtcol('.'))")) or 71
     32 box = make_box(len(t[1]), width)
     33 snip.rv = box[0]
     34 snip += box[1]
     35 `${1:${VISUAL:content}}`!p
     36 box = make_box(len(t[1]), width)
     37 snip.rv = box[2]
     38 snip += box[3]`
     39 $0
     40 endsnippet
     41 
     42 snippet fold "Insert a vim fold marker" b
     43 `!p snip.rv = get_comment_format()[0]` ${1:Fold description} `!p snip.rv = foldmarker()[0]`${2:1} `!p snip.rv = get_comment_format()[2]`
     44 endsnippet
     45 
     46 snippet foldc "Insert a vim fold close marker" b
     47 `!p snip.rv = get_comment_format()[0]` ${2:1}`!p snip.rv = foldmarker()[1]` `!p snip.rv = get_comment_format()[2]`
     48 endsnippet
     49 
     50 snippet foldp "Insert a vim fold marker pair" b
     51 `!p snip.rv = get_comment_format()[0]` ${1:Fold description} `!p snip.rv = foldmarker()[0]` `!p snip.rv = get_comment_format()[2]`
     52 ${2:${VISUAL:Content}}
     53 `!p snip.rv = get_comment_format()[0]` `!p snip.rv = foldmarker()[1]` $1 `!p snip.rv = get_comment_format()[2]`
     54 endsnippet
     55 
     56 ##########################
     57 # LOREM IPSUM GENERATORS #
     58 ##########################
     59 snippet lorem "Lorem Ipsum - 50 Words" b
     60 Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
     61 tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At
     62 vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
     63 no sea takimata sanctus est Lorem ipsum dolor sit amet.
     64 endsnippet
     65 
     66 ##########################
     67 # VIM MODELINE GENERATOR #
     68 ##########################
     69 # See advice on `:help 'tabstop'` for why these values are set. Uses second
     70 # modeline form ('set') to work in languages with comment terminators
     71 # (/* like C */).
     72 snippet modeline "Vim modeline"
     73 vim`!v ':set '. (&expandtab ? printf('et sw=%i ts=%i', &sw, &ts) : printf('noet sts=%i sw=%i ts=%i', &sts, &sw, &ts)) . (&tw ? ' tw='. &tw : '') . ':'`
     74 endsnippet
     75 
     76 #########
     77 # DATES #
     78 #########
     79 snippet date "YYYY-MM-DD" w
     80 `!v strftime("%F")`
     81 endsnippet
     82 
     83 snippet ddate "Month DD, YYYY" w
     84 `!v strftime("%b %d, %Y")`
     85 endsnippet
     86 
     87 snippet diso "ISO format datetime" w
     88 `!v strftime("%F %H:%M:%S%z")`
     89 endsnippet
     90 
     91 snippet time "hh:mm" w
     92 `!v strftime("%H:%M")`
     93 endsnippet
     94 
     95 snippet datetime "YYYY-MM-DD hh:mm" w
     96 `!v strftime("%Y-%m-%d %H:%M")`
     97 endsnippet
     98 
     99 snippet todo "TODO comment" bw
    100 `!p snip.rv=get_comment_format()[0]` TODO: $1 <`!v strftime('%d-%m-%Y')`, `!v g:snips_author`> `!p snip.rv=get_comment_format()[2]`
    101 $0
    102 endsnippet
    103 
    104 ###########################
    105 #  some personal content  #
    106 ###########################
    107 snippet copy "shot copyright notice" b
    108 `!p snip.rv=get_comment_format()[0]`Copyright © `!v strftime('%Y')` Paco Esteban <paco@onna.be>
    109 `!p snip.rv=get_comment_format()[0]`Distributed under terms of the ISC license.
    110 endsnippet
    111 
    112 snippet license "MIT License" b
    113 Copyright (c) `!v strftime('%Y')` Paco Esteban <paco@onna.be>
    114 
    115 Permission to use, copy, modify, and distribute this software for any
    116 purpose with or without fee is hereby granted, provided that the above
    117 copyright notice and this permission notice appear in all copies.
    118 
    119 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
    120 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
    121 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
    122 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
    123 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
    124 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
    125 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
    126 endsnippet
    127 
    128 # vim:ft=snippets: