local map = require('my.functions').map require('Comment').setup({ toggler = { line = 'cc', block = 'CC' }, opleader = { line = 'c', block = 'C' }, extra = { above = 'cO', below = 'co', eol = 'cA', }, pre_hook = require('ts_context_commentstring.integrations.comment_nvim').create_pre_hook(), }) require("nvim-autopairs").setup({}) require('luasnip.loaders.from_lua').load({ paths = vim.fn.stdpath('config') .. '/snippets' }) -- icons for diagnostics in the symbol column local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } for type, icon in pairs(signs) do local hl = "DiagnosticSign" .. type vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) end local dap = require('dap') if vim.fn.executable('lldb-vscode') > 0 then dap.adapters.lldb = { type = 'executable', command = 'lldb-vscode', name = 'lldb' } dap.configurations.cpp = { { name = 'Launch', type = 'lldb', request = 'launch', program = function() return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') end, cwd = '${workspaceFolder}', stopOnEntry = false, args = {}, }, { name = "Attach to process", type = 'lldb', request = 'attach', pid = require('dap.utils').pick_process, args = {}, } } dap.configurations.c = dap.configurations.cpp end require('which-key').register({ ['d'] = { name = 'DAP' } }) map('n', 'dc', dap.continue, 'Continue') map('n', '', dap.step_over, 'DAP: step over') map('n', '', dap.step_into, 'DAP: step into') map('n', '', dap.step_out, 'DAP: step out') map('n', 'db', dap.toggle_breakpoint, 'Toggle breakpoint') map('n', 'dB', function() dap.set_breakpoint(vim.fn.input('Breakpoint condition: ')) end, 'Set breakpoint') map('n', 'dr', dap.repl.open, 'Open REPL') map('n', 'dl', dap.run_last, 'Run last') map('n', 'dj', function() require('dap.ext.vscode').load_launchjs( vim.fn.input('Path to launch.json: ', vim.fn.getcwd() .. '/launch.json', 'file')) end, 'Load launch.json') require('dapui').setup({}) map('n', 'du', require("dapui").toggle, 'Toggle UI') require('nvim-dap-virtual-text').setup({}) require('femaco').setup({}) map('n', 'E', require('femaco.edit').edit_code_block, 'Edit inline code block') require('projections').setup({ workspaces = { '~/Projekte', '~/Dokumente' }, patterns = require('my.functions').project_root_markers })