Software
Vim Config
~~~ require(“gitsigns”).setup{} require(“undotree”).setup{} require(“nvim-treesitter”).setup{}
vim.lsp.enable(‘clangd’) vim.lsp.enable(‘debputy’) vim.lsp.config(‘efm’, { cmd = {“efm-langserver”, “-q”}, filetypes = {“cmake”, “json”, “markdown”, “rst”, “sh”, “yaml”}, settings = { languages = { cmake = { { formatCommand = “cmake-format -”, formatStdin = true }, { lintCommand = “cmake-lint”, lintFormats = { “%f:%l,%c: %m” } } }, json = { { formatCommand = “python3 -m json.tool”, formatStdin = true }, { lintCommand = “python3 -m json.tool”, lintStdin = true, lintIgnoreExitCode = true, lintFormats = { “%m: line %l column %c (char %r)” } } }, markdown = { { formatCommand = “pandoc -f markdown -t gfm -sp –tab-stop=2”, formatStdin = true } }, rst = { { formatCommand = “pandoc -f rst -t rst -s –columns=79”, formatStdin = true }, { lintCommand = “rstcheck -”, lintStdin = true, lintFormats = { “%f:%l: (%tNFO/1) %m”, “%f:%l: (%tARNING/2) %m”, “%f:%l: (%tRROR/3) %m”, “%f:%l: (%tEVERE/4) %m” } } }, sh = { { formatCommand = “shfmt”, formatStdin = true }, { lintCommand = “shellcheck -f gcc -x -”, lintStdin = true, lintFormats = { “%f:%l:%c: %trror: %m”, “%f:%l:%c: %tarning: %m”, “%f:%l:%c: %tote: %m” } } }, yaml = { { lintCommand = “yamllint -d ‘{extends: default, rules: {line-length: disable}}’ -f parsable -”, lintStdin = true, lintIgnoreExitCode = true } } } } }) vim.lsp.enable(‘efm’) vim.lsp.config(‘pylsp’, { settings = { pylsp = { plugins = { autopep8 = {enabled = false}, pyflakes = {enabled = false}, mccabe = {enabled = false}, pycodestyle = {enabled = false}, ruff = { extendSelect = {“I”}, lineLength = 120, targetVersion=“py313” } } } } }) vim.lsp.enable(‘pylsp’) vim.lsp.enable(‘texlab’)
vim.api.nvim_create_autocmd(‘LspAttach’, { callback = function(args) local client = assert(vim.lsp.get_client_by_id(args.data.client_id)) if client:supports_method(‘textDocument/completion’) then vim.lsp.completion.enable(true, client.id, args.buf, {autotrigger = true}) end end })
vim.o.autoread = false vim.o.autowrite = true vim.o.colorcolumn = “101” vim.o.completeopt = “menuone,noselect,popup” vim.o.foldenable = false vim.o.ignorecase = true vim.o.linebreak = true vim.o.number = true vim.o.path = vim.o.path .. “**” vim.o.scrolloff = 3 vim.o.showmatch = true vim.o.sidescrolloff = 10 vim.o.smartcase = true vim.o.spell = not vim.o.diff vim.o.timeoutlen = 500 vim.o.title = true vim.o.ttimeoutlen = 0 vim.o.updatetime = 250 vim.o.wildmode = “list:longest,full”
vim.g.netrw_chgwin = 2 vim.g.vimtex_view_method = “zathura”
vim.filetype.add({extension = {launch = “xml”}, filename = {[“debputy.manifest”] = “yaml”}})
vim.api.nvim_create_autocmd(“BufRead”, {pattern = “/tmp/mutt”, callback = function() vim.cmd(“normal :g/^> – $/,/^$/-1dM/^$^ML”) end}) vim.api.nvim_create_autocmd(“CursorHold”, {pattern = “”, callback = function() vim.diagnostic.open_float(nil, {focus = false, scope = “cursor”}) end}) vim.api.nvim_create_autocmd(“CursorHoldI”, {pattern = “”, callback = function() vim.diagnostic.open_float(nil, {focus = false, scope = “cursor”}) end}) vim.api.nvim_create_autocmd(“DiagnosticChanged”, {pattern = “”, callback = function() vim.diagnostic.setqflist({open = false}) end}) vim.api.nvim_create_autocmd(“FileType”, {pattern = “qf,git,gitAnnotate,Outline,diff,help”, callback = function() vim.opt_local.spell = false end}) vim.api.nvim_create_autocmd(“FileType”, {pattern = “remind”, callback = function() vim.opt_local.spelllang = “de” end}) vim.api.nvim_create_autocmd(“FileType”, { pattern = “mail”, callback = function() vim.opt_local.expandtab = true vim.opt_local.tabstop = 2 vim.opt_local.shiftwidth = 2 vim.opt_local.colorcolumn = “80” end })
vim.cmd[[command DiffOrig vert new | set buftype=nofile | read ++edit # | 0d_ | diffthis | wincmd p | diffthis]]
– https://wiki.ubuntuusers.de/VIM/Tipps – https://ftp.nluug.nl/pub/vim/runtime/spell/{de,en}.utf-8.{spl,sug} – :mkspell! ~/.local/share/nvim/site/spell/en.utf-8.add function togglespell() if vim.o.spell then if vim.o.spelllang == “de” then vim.o.spelllang = “en” print(“toggle spell ” .. vim.o.spelllang) else vim.o.spell = false print(“toggle spell off”) end else vim.o.spell = true vim.o.spelllang = “de” print(“toggle spell ” .. vim.o.spelllang) end end
vim.keymap.set(“”, “