dotfiles/.config/nvim/lua/my/coding.lua

105 lines
2.9 KiB
Lua
Raw Normal View History

local map = require('my.functions').map
2022-08-16 02:49:33 +02:00
require('Comment').setup({
toggler = {
line = '<Leader>cc',
block = '<Leader>CC'
},
opleader = {
line = '<Leader>c',
block = '<Leader>C'
},
extra = {
above = '<Leader>cO',
below = '<Leader>co',
eol = '<Leader>cA',
},
pre_hook = require('ts_context_commentstring.integrations.comment_nvim')
.create_pre_hook(),
2022-08-18 01:16:57 +02:00
})
require("nvim-autopairs").setup({})
2022-08-18 01:16:57 +02:00
require('luasnip.loaders.from_lua').load({
paths = vim.fn.stdpath('config') .. '/snippets'
})
2022-08-16 05:00:13 +02:00
2022-08-25 15:41:30 +02:00
-- 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
2022-08-28 20:30:59 +02:00
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({ ['<Leader>d'] = { name = 'DAP' } })
2022-08-28 20:30:59 +02:00
map('n', '<Leader>dc', dap.continue, 'Continue')
map('n', '<F10>', dap.step_over, 'DAP: step over')
map('n', '<F11>', dap.step_into, 'DAP: step into')
map('n', '<F12>', dap.step_out, 'DAP: step out')
map('n', '<Leader>db', dap.toggle_breakpoint, 'Toggle breakpoint')
map('n', '<Leader>dB', function()
dap.set_breakpoint(vim.fn.input('Breakpoint condition: '))
end, 'Set breakpoint')
map('n', '<Leader>dr', dap.repl.open, 'Open REPL')
map('n', '<Leader>dl', dap.run_last, 'Run last')
map('n', '<Leader>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', '<Leader>du', require("dapui").toggle, 'Toggle UI')
require('nvim-dap-virtual-text').setup({})
2022-09-26 19:02:59 +02:00
require('femaco').setup({})
2022-10-01 19:02:40 +02:00
map('n', '<Leader>E', require('femaco.edit').edit_code_block,
2022-09-26 19:02:59 +02:00
'Edit inline code block')
require('projections').setup({
workspaces = { '~/Projekte', '~/Dokumente' },
patterns = require('my.functions').project_root_markers
})
2023-01-09 14:47:54 +01:00
require('neogen').setup({
snippet_engine = 'luasnip',
languages = {
['cpp.doxygen'] = require('neogen.configurations.cpp')
}
})