dotfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 54aed1dec7b3073d9de95552d6c3b222ddac8d07
parent f3578d94e876f353f6d98d6217b8eb237ca3c98a
Author: Janis Pagel <janis.pagel@ims.uni-stuttgart.de>
Date:   Tue, 21 Apr 2020 19:42:05 +0200

Add custom snippets to vim

Also disable autoremoval of empty space at line endings

Diffstat:
Avim/snippets/latex/skel_enumerate.tex | 3+++
Avim/snippets/latex/skel_figure.tex | 5+++++
Avim/snippets/latex/skel_itemize.tex | 3+++
Avim/snippets/latex/skel_outline.tex | 3+++
Avim/snippets/markdown/skel_codeblock.md | 3+++
Avim/snippets/markdown/skel_image.md | 1+
Avim/snippets/markdown/skel_link.md | 1+
Avim/snippets/markdown/skel_meta.md | 6++++++
Avim/snippets/markdown/skel_table.md | 3+++
Avim/snippets/python/skel_class.py | 2++
Avim/snippets/python/skel_func.py | 1+
Mvim/vimrc | 19++++++++++++++++++-
12 files changed, 49 insertions(+), 1 deletion(-)

diff --git a/vim/snippets/latex/skel_enumerate.tex b/vim/snippets/latex/skel_enumerate.tex @@ -0,0 +1,3 @@ +\begin{enumerate} + \item +\end{enumerate} diff --git a/vim/snippets/latex/skel_figure.tex b/vim/snippets/latex/skel_figure.tex @@ -0,0 +1,5 @@ +\begin{figure}[htbp] + +\caption{} +\label{fig:} +\end{figure} diff --git a/vim/snippets/latex/skel_itemize.tex b/vim/snippets/latex/skel_itemize.tex @@ -0,0 +1,3 @@ +\begin{itemize} + \item +\end{itemize} diff --git a/vim/snippets/latex/skel_outline.tex b/vim/snippets/latex/skel_outline.tex @@ -0,0 +1,3 @@ +\begin{outline} + \1 +\end{outline} diff --git a/vim/snippets/markdown/skel_codeblock.md b/vim/snippets/markdown/skel_codeblock.md @@ -0,0 +1,3 @@ +``` + +``` diff --git a/vim/snippets/markdown/skel_image.md b/vim/snippets/markdown/skel_image.md @@ -0,0 +1 @@ +![]() diff --git a/vim/snippets/markdown/skel_link.md b/vim/snippets/markdown/skel_link.md @@ -0,0 +1 @@ +[]() diff --git a/vim/snippets/markdown/skel_meta.md b/vim/snippets/markdown/skel_meta.md @@ -0,0 +1,6 @@ +--- +Title: +Author: +Date: +Lang: +--- diff --git a/vim/snippets/markdown/skel_table.md b/vim/snippets/markdown/skel_table.md @@ -0,0 +1,3 @@ +| | | +| --- | --- | +| | | diff --git a/vim/snippets/python/skel_class.py b/vim/snippets/python/skel_class.py @@ -0,0 +1,2 @@ +class: + def __init__(self): diff --git a/vim/snippets/python/skel_func.py b/vim/snippets/python/skel_func.py @@ -0,0 +1 @@ +def function(): diff --git a/vim/vimrc b/vim/vimrc @@ -73,6 +73,23 @@ set statusline+=%4*\ %{&ff}\ "FileFormat (dos/unix. set statusline+=%5*\ %{&spelllang}\ "Spellanguage set statusline+=%8*\ %=\ %l:%v\ "Rownr:Colnr set statusline+=%0*\ \ %m%r%w\ %P\ \ "Modified? Readonly? Top/bot. + " }}} + +" Snippets {{{ +" Python +nnoremap <Leader>pydef :-1read $HOME/.vim/snippets/python/skel_func.py<CR>wf(a +nnoremap <Leader>pyclass :-1read $HOME/.vim/snippets/python/skel_class.py<CR>wi +" LaTeX +nnoremap <Leader>item :-1read $HOME/.vim/snippets/latex/skel_itemize.tex<CR>1j$i +nnoremap <Leader>enum :-1read $HOME/.vim/snippets/latex/skel_enumerate.tex<CR>1j$i +nnoremap <Leader>fig :-1read $HOME/.vim/snippets/latex/skel_figure.tex<CR>1j$i +nnoremap <Leader>outline :-1read $HOME/.vim/snippets/latex/skel_outline.tex<CR>1j$i +" Markdown +nnoremap <Leader>mdtab :-1read $HOME/.vim/snippets/markdown/skel_table.md<CR>2li +nnoremap <Leader>mdimg :-1read $HOME/.vim/snippets/markdown/skel_image.md<CR>f[a +nnoremap <Leader>mdlink :-1read $HOME/.vim/snippets/markdown/skel_link.md<CR>f[a +nnoremap <Leader>mdblock :-1read $HOME/.vim/snippets/markdown/skel_codeblock.md<CR>$i +nnoremap <Leader>mdmeta :-1read $HOME/.vim/snippets/markdown/skel_meta.md<CR>3j$"=strftime("%Y-%m-%d")<CR>Pgg01j$i " }}} " run programs silently {{{ @@ -114,7 +131,7 @@ if has("autocmd") au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif autocmd BufRead,BufNewFile ~/.mutt/temp/mutt* :Goyo 80 | set linebreak | set spell " automatically deletes all trailing whitespace on save - autocmd BufWritePre * %s/\s\+$//e + " autocmd BufWritePre * %s/\s\+$//e endif " Use specific colorscheme for buffer if b:colors_name is set