Add snippets support

This commit is contained in:
Oshgnacknak 2021-11-02 17:59:11 +01:00
parent c2a403a7d5
commit f2b7cf493e
Signed by: Oshgnacknak
GPG key ID: 8CB7375654585956
5 changed files with 37 additions and 0 deletions

View file

@ -0,0 +1,9 @@
snippet main
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
printf("Hello, World!\n");
return 0;
}
endsnippet

View file

@ -0,0 +1,9 @@
snippet latex
TEX := $(wildcard *.tex)
$1.pdf: ${TEX}
pdflatex -jobname=$1 $^
clean:
rm -rf *.aux *.log *.pdf
endsnippet

View file

@ -0,0 +1,16 @@
snippet doc
\documentclass[a4paper]{article}
\begin{document}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
$0
\end{document}
endsnippet
snippet begin
\begin{$1}
$0
\end{$1}
endsnippet

View file

View file

@ -16,6 +16,7 @@ Plug 'terryma/vim-multiple-cursors'
" Plug 'ndmitchell/ghcid', { 'rtp': 'plugins/nvim' } " Plug 'ndmitchell/ghcid', { 'rtp': 'plugins/nvim' }
Plug 'luochen1990/rainbow' Plug 'luochen1990/rainbow'
" Plug 'wlangstroth/vim-racket' " Plug 'wlangstroth/vim-racket'
Plug 'sirver/ultisnips'
call plug#end() call plug#end()
let g:deoplete#enable_at_startup = 1 let g:deoplete#enable_at_startup = 1
@ -45,6 +46,7 @@ endfunction
let g:rainbow_active = 1 let g:rainbow_active = 1
let g:syntastic_enable_racket_racket_checker = 1 let g:syntastic_enable_racket_racket_checker = 1
let g:syntastic_nasm_nasm_args = '-f elf64'
let g:syntastic_python_checkers = ['python'] let g:syntastic_python_checkers = ['python']
let g:lsc_auto_map = { let g:lsc_auto_map = {
\ 'GoToDefinition': '<C-]>', \ 'GoToDefinition': '<C-]>',
@ -82,6 +84,7 @@ autocmd FileType gitcommit setlocal spell spelllang=en
autocmd TermOpen,TermEnter * setlocal nonumber norelativenumber nospell nohlsearch autocmd TermOpen,TermEnter * setlocal nonumber norelativenumber nospell nohlsearch
autocmd Filetype tex,markdown,mail setlocal linebreak spell spelllang=de autocmd Filetype tex,markdown,mail setlocal linebreak spell spelllang=de
autocmd BufNewFile *.{h,hpp} call <SID>insert_gates() autocmd BufNewFile *.{h,hpp} call <SID>insert_gates()
autocmd BufNewFile,BufRead *.asm set filetype=nasm
set spelllang=de,en set spelllang=de,en
set complete+=kspell set complete+=kspell