diff --git a/UltiSnips/ada.snippets b/UltiSnips/ada.snippets index 62ab1bb..f5350b3 100644 --- a/UltiSnips/ada.snippets +++ b/UltiSnips/ada.snippets @@ -117,6 +117,7 @@ snippet docstring "Document String with most important infor" b -- Created on: `date` -- Author(s): ${1:Yannick Reiß} -- Content: ${2: Function `!p snip.rv = fn.split('.')[0]`} +$0 endsnippet snippet project "Project" b diff --git a/UltiSnips/markdown.snippets b/UltiSnips/markdown.snippets index 9fd243f..e63ddea 100644 --- a/UltiSnips/markdown.snippets +++ b/UltiSnips/markdown.snippets @@ -92,3 +92,8 @@ snippet cite "Cite from a paper" b Tags: $2 $0 endsnippet + +snippet immernoch "ARGH, lern schreiben!" A +noch immer +endsnippet + diff --git a/UltiSnips/tex.snippets b/UltiSnips/tex.snippets index fc0ad6c..1c7a513 100644 --- a/UltiSnips/tex.snippets +++ b/UltiSnips/tex.snippets @@ -266,27 +266,27 @@ endsnippet snippet sch "chapter" \\chapter{$1} -\\label{chapter:`!p snip.rv = t[1].lower().replace(" ", "_")`}$0 +\\label{chapter:`!p snip.rv = get_label(t[1])`}$0 endsnippet snippet sse "Section" \\section{$1} -\\label{section:`!p snip.rv = t[1].lower().replace(" ", "_")`}$0 +\\label{section:`!p snip.rv = get_label(t[1])`}$0 endsnippet snippet sss "Subsection" \\subsection{$1} -\\label{subsection:`!p snip.rv = t[1].lower().replace(" ", "_")`}$0 +\\label{subsection:`!p snip.rv = get_label(t[1])`}$0 endsnippet snippet ssn "Subsubsection" \\subsubsection{$1} -\\label{subsubsection:`!p snip.rv = t[1].lower().replace(" ", "_")`}$0 +\\label{subsubsection:`!p snip.rv = get_label(t[1])`}$0 endsnippet snippet par "Paragraph" \\paragraph{$1} -\\label{paragraph:`!p snip.rv = t[1].lower().replace(" ", "_")`}$0 +\\label{paragraph:`!p snip.rv = get_label(t[1])`}$0 endsnippet snippet mquote "max quote" @@ -379,6 +379,16 @@ def create_table(cols, rows, sep, start, end, head="##"): placeholder += 1 res += end return res[:-1] + +def get_label(title): + return_label = title.lower() + return_label = return_label.replace(" ", "_") + return_label = return_label.replace("ä", "ae") + return_label = return_label.replace("ö", "oe") + return_label = return_label.replace("ü", "ue") + return_label = return_label.replace("-", "__") + + return return_label endglobal post_jump "create_table_tabs(snip)" @@ -469,11 +479,11 @@ snippet bsp "Beispielsweise" A beispielsweise endsnippet -snippet ß "Backslash" iA +snippet ß "Backslash" A \\ endsnippet -snippet \´ "Add another Backslash" iA +snippet \0 "Add another Backslash" iA \\\\ endsnippet diff --git a/lua/plugconfig.lua b/lua/plugconfig.lua index 6ee92ed..03be397 100644 --- a/lua/plugconfig.lua +++ b/lua/plugconfig.lua @@ -61,6 +61,7 @@ require("mason").setup(require("mason").setup({ require("mason-lspconfig").setup({ -- ensure_installed = { "clangd", "cmake", "jdtls", "texlab", "pylsp" }, + ensure_installed = { "clangd" }, }) require("mason-lspconfig").setup_handlers({ diff --git a/lua/plugins.lua b/lua/plugins.lua index 44d3f13..225502d 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -65,4 +65,19 @@ return { { "tzachar/cmp-fuzzy-buffer", requires = { "hrsh7th/nvim-cmp", "tzachar/fuzzy.nvim" } }, "jaredgorski/spacecamp", "voldikss/vim-floaterm", + -- { + -- "lervag/vimtex", + -- lazy = false, -- we don't want to lazy load VimTeX + -- -- tag = "v2.15", -- uncomment to pin to a specific release + -- init = function() + -- -- VimTeX configuration goes here, e.g. + -- vim.o.foldmethod = "expr" + -- vim.o.foldexpr = "vimtex#fold#level(v:lnum)" + -- vim.o.foldtext = "vimtex#fold#text()" + -- vim.o.foldlevel = 1 + -- vim.g.vimtex_view_general_viewer = "okular" + -- vim.g.vimtex_view_general_options = "--unique file:@pdf#src:@line@tex" + -- vim.g.vimtex_fold_enabled = 1 + -- end, + --}, } diff --git a/lua/vanilla.lua b/lua/vanilla.lua index 69a7534..ec8e366 100644 --- a/lua/vanilla.lua +++ b/lua/vanilla.lua @@ -27,6 +27,7 @@ vim.opt.encoding = "UTF-8" vim.g.tex_flavor = "latex" vim.opt.conceallevel = 2 vim.opt.showmatch = true +vim.o.guifont = "Source Code Pro:h13" -- set color scheme vim.opt.termguicolors = true @@ -39,4 +40,3 @@ vim.opt.mouse = "" -- set copy mode vim.keymap.set("n", "ll", ":set nonumber") vim.keymap.set("n", "lm", ":set number") - diff --git a/viml/automacro.vim b/viml/automacro.vim index 35de3b6..41a2251 100644 --- a/viml/automacro.vim +++ b/viml/automacro.vim @@ -1,3 +1,10 @@ +" various tools inside vim +function! GetCharUnderCursor() + let line = getline('.') + let col = col('.') + return line[col - 1] +endfunction + " predefined macros in functions function SpacedLine() normal o @@ -11,7 +18,15 @@ function SwapWords() normal e exec 'normal! a ' normal p + normal l + let char = GetCharUnderCursor() + if char == ' ' + normal x + endif + normal h + normal b + normal b endfunction -nnoremap o :call SpacedLine() -nnoremap ls :call SwapWords() +let @o = ':call SpacedLine() ' +let @s = ':call SwapWords() '