New snippets, no ale

This commit is contained in:
Yannick Reiß 2023-08-04 15:24:33 +02:00
parent d30ab401f8
commit 8c8970548b
No known key found for this signature in database
GPG Key ID: 5A3AF456F0A0338C
8 changed files with 140 additions and 17 deletions

View File

@ -40,3 +40,8 @@ $1
\`\`\`
$0
endsnippet
snippet ,m "Math equation" A
\$\$ $1 \$\$ $0
endsnippet

View File

@ -35,3 +35,35 @@ for ${1:i} in ${2:$3..$4} {
}$0
endsnippet
snippet while "while loop"
while $1 {
$2
} $0
endsnippet
global !p
import re
def create_parameter_placeholders(snip):
placeholders_amount = int(snip.buffer[snip.line].strip())
snip.buffer[snip.line] = ''
anon_snippet_body = 'println!("' + '{}'.join(['$' + str(i+1) for i in range(placeholders_amount)]) + f"${placeholders_amount}" + '"'
if placeholders_amount > 0:
anon_snippet_body = anon_snippet_body + ', '
anon_snippet_body = anon_snippet_body + ', '.join(['$' + str(i+1) for i in range(placeholders_amount, 2*placeholders_amount)]) + ");"
snip.expand_anon(anon_snippet_body)
endglobal
post_jump "create_parameter_placeholders(snip)"
snippet "print\d+" "println" rA
`!p snip.rv = match.group(1)`
endsnippet
snippet println "println" A
println!("$1");$0
endsnippet

View File

@ -31,7 +31,7 @@ snippet vec "Vector"
\\vec{$1}$0
endsnippet
snippet env "Environment" bA
snippet #env "Environment" bA
\\begin{$1}
$2
\\end{$1}$0
@ -164,7 +164,7 @@ snippet () "( ... )"
\\left( $1 \\right) $0
endsnippet
snippet menc "Mathmode-text" iA
snippet ,text "Mathmode-text" iA
\\text{ $1 }$0
endsnippet
@ -180,14 +180,6 @@ snippet geq "greater equal"
\\geq
endsnippet
snippet let "lesser than"
<
endsnippet
snippet grt "greater than"
>
endsnippet
snippet case "if else mathstyle"
\\begin{cases}
$1 & \\quad \\text{$2}\\\\ $3 & \\quad \\text{$4}\\\\ \\end{cases}$0
@ -202,11 +194,11 @@ snippet ival "Intervall"
endsnippet
snippet xx "multiplication" i
\\cdot
\\cdot $0
endsnippet
snippet root "nth root"
\\sqrt[$1]{$2}$0
snippet root "nth root" i
\\sqrt[$1]{$2} $0
endsnippet
snippet sdef "Definition"
@ -265,18 +257,22 @@ endsnippet
snippet bit "itemize"
\\begin{itemize}
\\item $1`!p t[1] = t[1].replace("+\n", "\n\t\\item")`
\\item $1`!p t[1] = t[1].replace(" \n", "\n\t\\item")`
\\end{itemize}
$0
endsnippet
snippet ben "enumerate"
\\begin{enumerate}
\\item $1`!p t[1] = t[1].replace("+\n", "\n\t\\item")`
\\item $1`!p t[1] = t[1].replace(" \n", "\n\t\\item")`
\\end{enumerate}
$0
endsnippet
snippet - "new item" b
\\item $0
endsnippet
snippet sch "chapter"
\\chapter{$1}$0
endsnippet
@ -532,3 +528,8 @@ snippet frame "Add a new Frame" b
$2
\\end{frame}$0
endsnippet
snippet != "not equal" iA
\\neq $0
endsnippet

View File

@ -0,0 +1,25 @@
snippet "reg []" "Register of size." A
reg [${1:7}:${2:0}] ${3:register};$0
endsnippet
global !p
def complete(t, opts):
if t:
opts = [ m[len(t):] for m in opts if m.startswith(t) ]
if len(opts) == 1:
return opts[0]
return "(" + "|".join(opts) + ")"
endglobal
snippet always "Do something always @" b
always @($1`!p snip.rv=complete(t[1], ['*', 'posedge clk', 'negedge clk', 'posedge rst_n', 'negedge rst_n'])`) begin
$2
end $0
endsnippet
snippet al "Do something always @" b
always @($1) begin
$2
end $0
endsnippet

View File

@ -102,4 +102,10 @@ wilder.setup({modes = {':', '/', '?'}, next_key= '<Tab>', previous_key= '<S-Tab>
require("code-completion")
-- neovide configuration
if vim.g.neovide then
vim.o.guifont = "DroidSansMono Nerd Font:8"
vim.g.neovide_scale_factor = 1.0
end
vim.cmd('source ~/.config/nvim/viml/legacyconf.vim')

52
lastSession.vi Normal file
View File

@ -0,0 +1,52 @@
let SessionLoad = 1
let s:so_save = &g:so | let s:siso_save = &g:siso | setg so=0 siso=0 | setl so=-1 siso=-1
let v:this_session=expand("<sfile>:p")
silent only
silent tabonly
cd ~/Documents/HSRM/Semester4/EmbSec/Praktikum/it-security
if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == ''
let s:wipebuf = bufnr('%')
endif
let s:shortmess_save = &shortmess
if &shortmess =~ 'A'
set shortmess=aoOA
else
set shortmess=aoO
endif
badd +50 plot_traces.py
argglobal
%argdel
$argadd plot_traces.py
edit plot_traces.py
argglobal
setlocal fdm=expr
setlocal fde=nvim_treesitter#foldexpr()
setlocal fmr={{{,}}}
setlocal fdi=#
setlocal fdl=0
setlocal fml=1
setlocal fdn=20
setlocal nofen
let s:l = 50 - ((46 * winheight(0) + 23) / 47)
if s:l < 1 | let s:l = 1 | endif
keepjumps exe s:l
normal! zt
keepjumps 50
normal! 0
tabnext 1
if exists('s:wipebuf') && len(win_findbuf(s:wipebuf)) == 0 && getbufvar(s:wipebuf, '&buftype') isnot# 'terminal'
silent exe 'bwipe ' . s:wipebuf
endif
unlet! s:wipebuf
set winheight=1 winwidth=20
let &shortmess = s:shortmess_save
let s:sx = expand("<sfile>:p:r")."x.vim"
if filereadable(s:sx)
exe "source " . fnameescape(s:sx)
endif
let &g:so = s:so_save | let &g:siso = s:siso_save
set hlsearch
nohlsearch
doautoall SessionLoadPost
unlet SessionLoad
" vim: set ft=vim :

View File

@ -1,7 +1,7 @@
return require('packer').startup(function(use)
-- Configurations will go here soon
use 'wbthomason/packer.nvim'
use 'dense-analysis/ale'
-- use 'dense-analysis/ale'
use 'preservim/nerdtree'
use 'Xuyuanp/nerdtree-git-plugin'
use 'tpope/vim-surround'

View File

@ -14,8 +14,10 @@ nnoremap <C-t> :call OpenTerm()<CR>
set splitright
set splitbelow
set clipboard+=unnamedplus
" Update Plugins and Treesitter languages
autocmd VimLeave * mksession! ~/.config/nvim/lastSession.vim
autocmd VimLeave * mksession! ~/.config/nvim/lastSession.vi
" autosave for Markdown and Latex
set updatetime=800