From a4bd9d253bec8dd256661106f843c04b7c2f6cf1 Mon Sep 17 00:00:00 2001 From: yannickreiss Date: Tue, 22 Aug 2023 07:46:14 +0200 Subject: [PATCH] update --- UltiSnips/c.snippets | 14 +++----- UltiSnips/cpp.snippets | 23 ++++++++++++-- UltiSnips/tex.snippets | 4 +++ init.lua | 2 +- lastSession.vi | 17 ++++------ legacyconf.log | 72 ++++++++++++++++++++++++++++++++++++++++++ lua/plugins.lua | 2 +- viml/legacyconf.vim | 14 ++------ viml/macros.vim | 7 ---- 9 files changed, 112 insertions(+), 43 deletions(-) create mode 100644 legacyconf.log diff --git a/UltiSnips/c.snippets b/UltiSnips/c.snippets index 4d588c0..f16ee55 100644 --- a/UltiSnips/c.snippets +++ b/UltiSnips/c.snippets @@ -13,7 +13,7 @@ if t[1] != "void": else: snip.rv = ""` $5 - `!p + `!p if t[1] != "void": snip.rv = f"return rv;" else: @@ -60,7 +60,6 @@ snip.rv = rval` ${1:int} ${2:MyFunc} (${3:void}); endsnippet - snippet exfun "New Function with Documentation" /** * $2 -> $1 @@ -82,7 +81,7 @@ if t[1] != "void": else: snip.rv = ""` $5 - `!p + `!p if t[1] != "void": snip.rv = f"return rv;" else: @@ -120,7 +119,7 @@ if (-1 == `!p snip.rv = match.group(1)`) { $0 endsnippet -snippet swapint "Swap two integer or numerical variables" +snippet swap "Swap two integer or numerical variables" /* Swap Variables $1 and $2 */ ${1:Var1} = $1 + ${2:Var2}; $2 = $1 - $2; @@ -141,10 +140,6 @@ def complete(t, opts): return '(' + '|'.join(opts) + ')' endglobal -snippet def "Completer for predefined Values" -$1`!p snip.rv = complete(t[1], ['EXIT_SUCCESS', 'EXIT_FAILURE', 'INT_MAX', 'INT_MIN'])` -endsnippet - snippet printf "Cast printf result to 'void' if heturn value is unneeded" bA (void)printf("$1"`!p if "%" in t[1]: @@ -291,7 +286,7 @@ if (`!p snip.rv = match.group(1)` < 0) { perror("fork error on creating new subprocess '`!p snip.rv = match.group(1)`'."); exit(EXIT_FAILURE); } else if (!`!p snip.rv = match.group(1)`) { - /* fork runs from here */ + /* fork runs from here */ ${1:execve(proc, args, NULL)}; } $0 @@ -360,4 +355,3 @@ if ( fflush(stdout) ) { exit(EXIT_FAILURE); } endsnippet - diff --git a/UltiSnips/cpp.snippets b/UltiSnips/cpp.snippets index 1e65ab2..9b68ba2 100644 --- a/UltiSnips/cpp.snippets +++ b/UltiSnips/cpp.snippets @@ -36,7 +36,7 @@ if t[1] != "void": else: snip.rv = ""` $5 - `!p + `!p if t[1] != "void": snip.rv = f"return rv;" else: @@ -124,7 +124,7 @@ for var in variables: snip.rv = rv` private: - $4 + $4 }; `!p @@ -160,7 +160,7 @@ struct $1{ endsnippet snippet docomment "Meta Comment" A -/* +/* * Filename: `!p snip.rv = fn` * Author: ${1:Yannick Reiss} * Project: ${2:Project Name} @@ -179,3 +179,20 @@ snippet let- "Declare Variable" A ${1:int} ${2:Variable}; /* ${3:Description} */ $0 endsnippet + +snippet pfun "prototype for function" bA +/** + * $2 -> $1 + * @return $1 + * @brief Description: + * ${4: Description} + * @param Parameter:`!p +params = t[3].split(",") +rval = "" +for param in params: + if len(param.split(' ')) >= 2: + rval += f"\n *\t\t{param}:\t{t[2]}_{param.split(' ')[1]}" +snip.rv = rval` + */ +${1:int} ${2:MyFunc} (${3:void}); +endsnippet diff --git a/UltiSnips/tex.snippets b/UltiSnips/tex.snippets index d86783e..1c67ddf 100644 --- a/UltiSnips/tex.snippets +++ b/UltiSnips/tex.snippets @@ -545,3 +545,7 @@ snippet "@(\w)" "insert greek letter" irA \\`!p letters = {'a': 'alpha', 'A': 'Alpha', 'b': 'beta', 'B': 'Beta', 'g': 'gamma', 'G': 'Gamma', 'e': 'epsilon', 'E': 'Epsilon', 'o': 'omega', 'O': 'Omega', 'm': 'mu', 'M': 'Mu'} snip.rv = letters[ match.group(1) ]` endsnippet + +snippet _- "Escape _ easier" iA +\\_ +endsnippet diff --git a/init.lua b/init.lua index 047e0ea..d6edfcc 100644 --- a/init.lua +++ b/init.lua @@ -21,7 +21,7 @@ vim.opt.guifont = "DroidSansMono Nerd Font 11" -- set colorscheme vim.opt.termguicolors = true vim.cmd([[ -colorscheme ron +colorscheme slate ]]) -- vim.cmd('source ~/.config/nvim/viml/plugins.vim') diff --git a/lastSession.vi b/lastSession.vi index d41b72d..f871e59 100644 --- a/lastSession.vi +++ b/lastSession.vi @@ -3,7 +3,7 @@ let s:so_save = &g:so | let s:siso_save = &g:siso | setg so=0 siso=0 | setl so=- let v:this_session=expand(":p") silent only silent tabonly -cd ~/Documents/HSRM/Semester4/EmbSec/Praktikum/it-security/Docs +cd ~/.config/nvim/viml if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == '' let s:wipebuf = bufnr('%') endif @@ -13,15 +13,12 @@ if &shortmess =~ 'A' else set shortmess=aoO endif -badd +132 Documentation.tex -badd +109 ~/.config/nvim/UltiSnips/tex.snippets -badd +7 ~/.config/nvim/UltiSnips/all.snippets +badd +1 legacyconf.vim argglobal %argdel -$argadd Documentation.tex -edit Documentation.tex +$argadd legacyconf.vim +edit legacyconf.vim argglobal -balt ~/.config/nvim/UltiSnips/all.snippets setlocal fdm=expr setlocal fde=nvim_treesitter#foldexpr() setlocal fmr={{{,}}} @@ -30,12 +27,12 @@ setlocal fdl=0 setlocal fml=1 setlocal fdn=20 setlocal nofen -let s:l = 132 - ((27 * winheight(0) + 19) / 38) +let s:l = 1 - ((0 * winheight(0) + 19) / 38) if s:l < 1 | let s:l = 1 | endif keepjumps exe s:l normal! zt -keepjumps 132 -normal! 014| +keepjumps 1 +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 diff --git a/legacyconf.log b/legacyconf.log new file mode 100644 index 0000000..c1f4378 --- /dev/null +++ b/legacyconf.log @@ -0,0 +1,72 @@ +This is LuaHBTeX, Version 1.17.0 (TeX Live 2023/Arch Linux) (format=lualatex 2023.7.21) 16 AUG 2023 18:24 + restricted system commands enabled. +**viml/legacyconf.vim +(./viml/legacyconf.vim +LaTeX2e <2022-11-01> patch level 1 +Lua module: luaotfload 2022-10-03 3.23 Lua based OpenType font support +Lua module: lualibs 2022-10-04 2.75 ConTeXt Lua standard libraries. +Lua module: lualibs-extended 2022-10-04 2.75 ConTeXt Lua libraries -- extended c +ollection. +luaotfload | conf : Root cache directory is "/home/nick/.texlive/texmf-var/luate +x-cache/generic/names". +luaotfload | init : Loading fontloader "fontloader-2022-10-03.lua" from kpse-res +olved path "/usr/share/texmf-dist/tex/luatex/luaotfload/fontloader-2022-10-03.lu +a". +Lua-only attribute luaotfload@noligature = 1 +luaotfload | init : Context OpenType loader version 3.120 +Inserting `luaotfload.node_processor' in `pre_linebreak_filter'. +Inserting `luaotfload.node_processor' in `hpack_filter'. +Inserting `luaotfload.glyph_stream' in `glyph_stream_provider'. +Inserting `luaotfload.define_font' in `define_font'. +Lua-only attribute luaotfload_color_attribute = 2 +luaotfload | conf : Root cache directory is "/home/nick/.texlive/texmf-var/luate +x-cache/generic/names". +Inserting `luaotfload.harf.strip_prefix' in `find_opentype_file'. +Inserting `luaotfload.harf.strip_prefix' in `find_truetype_file'. +Removing `luaotfload.glyph_stream' from `glyph_stream_provider'. +Inserting `luaotfload.harf.glyphstream' in `glyph_stream_provider'. +Inserting `luaotfload.harf.finalize_vlist' in `post_linebreak_filter'. +Inserting `luaotfload.harf.finalize_hlist' in `hpack_filter'. +Inserting `luaotfload.cleanup_files' in `wrapup_run'. +Inserting `luaotfload.harf.finalize_unicode' in `finish_pdffile'. +Inserting `luaotfload.glyphinfo' in `glyph_info'. +Lua-only attribute luaotfload.letterspace_done = 3 +Inserting `luaotfload.aux.set_sscale_dimens' in `luaotfload.patch_font'. +Inserting `luaotfload.aux.set_font_index' in `luaotfload.patch_font'. +Inserting `luaotfload.aux.patch_cambria_domh' in `luaotfload.patch_font'. +Inserting `luaotfload.aux.fixup_fontdata' in `luaotfload.patch_font_unsafe'. +Inserting `luaotfload.aux.set_capheight' in `luaotfload.patch_font'. +Inserting `luaotfload.aux.set_xheight' in `luaotfload.patch_font'. +Inserting `luaotfload.rewrite_fontname' in `luaotfload.patch_font'. L3 programm +ing layer <2023-02-22> +Inserting `tracingstacklevels' in `input_level_string'. + +! LaTeX Error: Missing \begin{document}. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.1 " + NERDTree remap +? +! Emergency stop. + ... + +l.1 " + NERDTree remap +You're in trouble here. Try typing to proceed. +If that doesn't work, type X to quit. + + + +Here is how much of LuaTeX's memory you used: + 21 strings out of 478285 + 100000,1977958 words of node,token memory allocated 333 words of node memory still in use: + 2 hlist, 1 local_par, 1 dir, 1 glue, 3 kern, 1 glyph, 3 attribute, 39 glue_sp +ec, 3 attribute_list, 1 temp nodes + avail lists: 2:5,3:3,4:1,5:1,7:1 + 20343 multiletter control sequences out of 65536+600000 + 14 fonts using 591679 bytes + 13i,0n,12p,58b,15s stack positions out of 10000i,1000n,20000p,200000b,200000s +! ==> Fatal error occurred, no output PDF file produced! diff --git a/lua/plugins.lua b/lua/plugins.lua index 5cbca99..13241bd 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -39,7 +39,7 @@ return require("packer").startup(function(use) use("prabirshrestha/vim-lsp") use("nvim-tree/nvim-web-devicons") use("mg979/vim-visual-multi") - use("Yggdroot/indentline") + -- use("Yggdroot/indentline") use({ "romgrk/barbar.nvim", wants = "nvim-web-devicons" }) use({ "petertriho/cmp-git", requires = "nvim-lua/plenary.nvim" }) use("quangnguyen30192/cmp-nvim-ultisnips") diff --git a/viml/legacyconf.vim b/viml/legacyconf.vim index e75809e..f9aab82 100644 --- a/viml/legacyconf.vim +++ b/viml/legacyconf.vim @@ -22,9 +22,6 @@ augroup FormatAutogroup autocmd BufWritePost * FormatWrite augroup END -" Update Plugins and Treesitter languages -autocmd VimLeave * mksession! ~/.config/nvim/lastSession.vi - " set spellcheck according to Filetype autocmd VimEnter * set spell spelllang=en_us @@ -41,18 +38,11 @@ nnoremap :call Litde() " Theme nnoremap :colo morning -nnoremap :colo ron +nnoremap :colo slate " Fuzzy finder nnoremap :Lines -" Save using strg+s -nnoremap :w - -" autosave for Markdown and Latex -set updatetime=800 -autocmd CursorHold *.md w - function RestoreSession() if @% == "" source ~/.config/nvim/lastSession.vim @@ -84,3 +74,5 @@ function Update_Sys() endfunction nnoremap :call Update_Sys() + +nnoremap :!lualatex % < /dev/null diff --git a/viml/macros.vim b/viml/macros.vim index 9622222..e71a209 100644 --- a/viml/macros.vim +++ b/viml/macros.vim @@ -2,12 +2,5 @@ function Common() endfunction -function Ctypes() - let @c = "\0i/*\A */\0j" -endfunction - " load common macros for all Filetypes autocmd BufEnter * :call Common() - -" load c-type macros - autocmd BufEnter *\.c Ctypes()