lots of snippets
authorDaniel Liu <mr.picklepinosaur@gmail.com>
Fri, 12 Mar 2021 16:21:21 +0000 (11:21 -0500)
committerDaniel Liu <mr.picklepinosaur@gmail.com>
Fri, 12 Mar 2021 16:21:21 +0000 (11:21 -0500)
.vim/mysnippets/all.snippets
.vim/mysnippets/scheme.snippets
.vim/mysnippets/tex.snippets
.vim/templates/skeleton.xml [new file with mode: 0644]
.vimrc

index 3929897..6a9059a 100644 (file)
@@ -1,3 +1,12 @@
 snippet today "Today" w
 `date +"%A, %B %d"`
 endsnippet
+
+snippet '([0-9]+)->([0-9]+)' "enumerate list" rw
+`!p 
+start = int(match.group(1))
+end = int(match.group(2))
+for i in range(start, end+1):
+       snip.rv += str(i)+"\n"
+`
+endsnippet
index fa2a1ef..3e9678d 100644 (file)
@@ -1,3 +1,3 @@
-snippet ~ "lambda" iA
+snippet \ "lambda" w
 λ
 endsnippet
index 9ee0f20..33cef93 100644 (file)
@@ -1,5 +1,5 @@
 # Enviros
-snippet \begin "enviroment" bA
+snippet beg "enviroment" w
 \begin{$1}
        $0
 \end{$1}
@@ -29,6 +29,18 @@ snippet proof "proof" w
 \end{proof}
 endsnippet
 
+snippet ibeg "inline enviroment" w
+\begin{$1} $2 \end{$1} $0
+endsnippet
+
+snippet ibmat "inline bmatrix" w
+\begin{bmatrix} $1 \end{bmatrix} $0
+endsnippet
+
+snippet ibsmat "inline small bmatrix" w
+\begin{bsmallmatrix} $1 \end{bsmallmatrix} $0
+endsnippet
+
 # FRACTIONS
 snippet // "frac" iA
 \\frac{$1}{$2}$0
diff --git a/.vim/templates/skeleton.xml b/.vim/templates/skeleton.xml
new file mode 100644 (file)
index 0000000..a40a1a8
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<rss version="2.0">
+
+<channel>
+<title></title>
+<link></link>
+<description></description>
+
+
+
+</channel>
+</rss>
+
diff --git a/.vimrc b/.vimrc
index a0842f5..df16a5d 100644 (file)
--- a/.vimrc
+++ b/.vimrc
@@ -15,6 +15,7 @@ set encoding=utf-8
 set tabstop=4
 set shiftwidth=4
 set expandtab
+set hidden
 
 " spell check
 setlocal spell
@@ -100,6 +101,7 @@ augroup templates
     autocmd BufNewFile *.tex 0r ~/.vim/templates/skeleton.tex
     autocmd BufNewFile *.html 0r ~/.vim/templates/skeleton.html
     autocmd BufNewFile *.rkt 0r ~/.vim/templates/skeleton.rkt
+    autocmd BufNewFile *.xml 0r ~/.vim/templates/skeleton.xml
 augroup END
 
 " vim plug
@@ -123,12 +125,17 @@ Plug 'tpope/vim-commentary'
 
 call plug#end()
 
+" leader for plugins
+let maplocalleader = "\\"
+
 " Ultisnips
 let g:UltiSnipsExpandTrigger = '<tab>'
 let g:UltiSnipsJumpForwardTrigger = '<tab>'
 let g:UltiSnipsJumpBackwardTrigger = '<s-tab>'
 let g:UltiSnipsSnippetDirectories=["UltiSnips", "mysnippets"]
 
+map <localleader>sr :call UltiSnips#RefreshSnippets()<cr>
+
 " Vimtex
 let g:tex_flavor='latex'
 let g:vimtex_view_method='zathura'