Compare commits

..

3 Commits

11 changed files with 324 additions and 261 deletions

View File

@ -1,6 +1,6 @@
vim.g.mapleader = ' ' vim.g.mapleader = ' '
vim.g.maplocalleader = ';' vim.g.maplocalleader = ';'
-- vim.g.python3_host_prog = '/usr/bin/python3' vim.g.python3_host_prog = '/usr/bin/python3'
vim.opt.mouse = 'a' -- mouse does annoying things for me if it's not 'a' vim.opt.mouse = 'a' -- mouse does annoying things for me if it's not 'a'
vim.opt.signcolumn = 'yes' vim.opt.signcolumn = 'yes'
@ -177,7 +177,6 @@ require 'custom.maps'
require 'custom.autocmds' require 'custom.autocmds'
require('lazy').setup({ require('lazy').setup({
{ import = 'custom.plugins' }, { import = 'custom.plugins' },
{ import = 'kickstart.plugins.debug' },
}, { }, {
ui = { ui = {
-- If you are using a Nerd Font: set icons to an empty table which will use the -- If you are using a Nerd Font: set icons to an empty table which will use the

View File

@ -15,17 +15,6 @@ vim.api.nvim_create_autocmd('FileType', {
end, end,
}) })
-- use html for htmldjango
vim.api.nvim_create_autocmd('FileType', {
group = augroup,
pattern = {
'html',
},
callback = function()
vim.bo.filetype = 'html'
end,
})
-- always use the tex filetype for latex things, as those are most supported by -- always use the tex filetype for latex things, as those are most supported by
-- latex language servers. -- latex language servers.
vim.api.nvim_create_autocmd('FileType', { vim.api.nvim_create_autocmd('FileType', {

View File

@ -29,11 +29,10 @@ vim.keymap.set({ 'v', 'n' }, 'zk', '<C-e>', { desc = 'move and scroll up' })
vim.keymap.set({ 'v', 'n' }, 'zj', '<C-y>', { desc = 'move and scroll down' }) vim.keymap.set({ 'v', 'n' }, 'zj', '<C-y>', { desc = 'move and scroll down' })
-- go to beginning and end in insert mode -- go to beginning and end in insert mode
vim.keymap.set('i', '<C-S-h>', '<esc>^i', { desc = 'Go to the start of the line' }) vim.keymap.set('i', '<C-s>', '<esc>^i', { desc = 'Go to the start of the line' })
vim.keymap.set('i', '<C-S-l>', '<End>', { desc = 'Go to the end of the line' }) vim.keymap.set('i', '<C-e>', '<End>', { desc = 'Go to the end of the line' })
vim.keymap.set('i', '<C-w>', '<esc>lwi', { desc = 'Go a word further' }) vim.keymap.set('i', '<C-w>', '<esc>lwi', { desc = 'Go a word further' })
vim.keymap.set('i', '<C-b>', '<esc>lbi', { desc = 'Go a word backward' }) vim.keymap.set('i', '<C-b>', '<esc>lbi', { desc = 'Go a word backward' })
vim.keymap.set('i', '<C-e>', '<esc>lea', { desc = 'Go a to next word end' })
-- navigate hjkl in insert mode -- navigate hjkl in insert mode
vim.keymap.set('i', '<C-h>', '<Left>', { desc = 'Move left' }) vim.keymap.set('i', '<C-h>', '<Left>', { desc = 'Move left' })

View File

@ -142,7 +142,6 @@ local servers = {
html = {}, html = {},
cssls = {}, cssls = {},
clangd = {}, clangd = {},
pyright = {},
bashls = {}, bashls = {},
yamlls = {}, yamlls = {},
texlab = {}, texlab = {},
@ -159,7 +158,6 @@ local servers = {
prefix = 'self', prefix = 'self',
}, },
cargo = { cargo = {
features = 'all',
buildScripts = { buildScripts = {
enable = true, enable = true,
}, },
@ -211,11 +209,11 @@ local servers = {
-- load token and additional languagetool items later -- load token and additional languagetool items later
}, },
}, },
languageToolOrg = { -- languageToolOrg = {
apiKey = require 'custom.secret.languagetool', -- apiKey = require 'custom.secret.languagetool',
username = 'accounts@cscherr.de', -- username = 'accounts@cscherr.de',
languageToolHttpServerUrl = 'https://api.languagetoolplus.com/v2/', -- languageToolHttpServerUrl = 'https://api.languagetoolplus.com/v2/',
}, -- },
languageToolHttpServerUrl = 'https://api.languagetoolplus.com/v2/', languageToolHttpServerUrl = 'https://api.languagetoolplus.com/v2/',
}, },
lua_ls = { lua_ls = {

View File

@ -76,11 +76,10 @@ return {
dependencies = { 'hrsh7th/nvim-cmp' }, dependencies = { 'hrsh7th/nvim-cmp' },
config = function() config = function()
require('nvim-autopairs').setup {} require('nvim-autopairs').setup {}
-- WARN: this is kind of anoying with rust, so I have disabeld it -- If you want to automatically add `(` after selecting a function or method
-- -- If you want to automatically add `(` after selecting a function or method local cmp_autopairs = require 'nvim-autopairs.completion.cmp'
-- local cmp_autopairs = require 'nvim-autopairs.completion.cmp' local cmp = require 'cmp'
-- local cmp = require 'cmp' cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done())
-- cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done())
end, end,
}, },
{ {

View File

@ -1,4 +1,6 @@
return { return {
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
-- NOTE: Plugins can specify dependencies. -- NOTE: Plugins can specify dependencies.
-- --
-- The dependencies are proper plugin specifications as well - anything -- The dependencies are proper plugin specifications as well - anything

View File

@ -313,6 +313,177 @@ return {
}, },
}, },
{ 'kosayoda/nvim-lightbulb', event = { 'BufReadPre', 'BufNewFile' } }, { 'kosayoda/nvim-lightbulb', event = { 'BufReadPre', 'BufNewFile' } },
{
'mfussenegger/nvim-dap',
lazy = false,
keys = {
{
'<leader>db',
function()
require('dap').toggle_breakpoint()
end,
desc = 'Set [D]ebug [B]reakpoint',
},
{
'<leader>dc',
function()
require('dap').continue()
end,
desc = '[D]ebug [C]ontinue',
},
{
'<leader>ds',
function()
require('dap').step_over()
end,
desc = 'Set [D]ebug [S]tep over',
},
{
'<leader>di',
function()
require('dap').step_into()
end,
desc = 'Set [D]ebug step [I]nto',
},
},
config = function()
local dap = require 'dap'
local mason_registry = require 'mason-registry'
local codelldb_root = mason_registry.get_package('codelldb'):get_install_path() .. '/extension/'
local codelldb_path = codelldb_root .. 'adapter/codelldb'
local liblldb_path = codelldb_root .. 'lldb/lib/liblldb.so'
dap.defaults.fallback.external_terminal = {
command = '/home/plex/.local/bin/kitty',
args = {},
}
dap.adapters.gdb = {
type = 'executable',
command = 'gdb',
args = { '-i', 'dap' },
}
dap.adapters.codelldb = {
type = 'server',
port = '30333',
executable = {
command = codelldb_path,
args = { '--port', '30333' },
detached = false,
},
}
dap.configurations.cpp = {
{
name = 'Launch file',
type = 'codelldb',
request = 'launch',
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
args = function()
return require('custom.utils').tokenize_args(vim.fn.input 'args: ')
end,
cwd = '${workspaceFolder}',
-- FIXME: perhaps we can put the stdio somewhere more practical
stopOnEntry = false,
},
}
dap.configurations.c = dap.configurations.cpp
dap.configurations.rust = dap.configurations.cpp
end,
},
{
'rcarriga/nvim-dap-ui',
keys = {
{
'<leader>du',
function()
require('dapui').toggle()
end,
desc = 'Open [D]ebug [U]i',
},
{
'<leader>dK',
function()
require('dap.ui.widgets').hover()
end,
desc = 'Open [D]ebug [K] hover',
},
{
'<leader>du',
function()
require('dapui').toggle()
end,
desc = 'Open [D]ebug [U]i',
},
{
'<leader>dws',
function()
local widgets = require 'dap.ui.widgets'
local my_sidebar = widgets.sidebar(widgets.scopes)
my_sidebar.open()
end,
desc = 'Open [D]ebug [W]indow [S]copes',
},
{
'<leader>dwf',
function()
local widgets = require 'dap.ui.widgets'
local my_sidebar = widgets.sidebar(widgets.frames)
my_sidebar.open()
end,
desc = 'Open [D]ebug [W]indow [F]rames',
},
{
'<leader>dwi',
function()
local widgets = require 'dap.ui.widgets'
local my_sidebar = widgets.sidebar(widgets.sessions)
my_sidebar.open()
end,
desc = 'Open [D]ebug [W]indow sess[I]ons',
},
{
'<leader>dwt',
function()
local widgets = require 'dap.ui.widgets'
local my_sidebar = widgets.sidebar(widgets.threads)
my_sidebar.open()
end,
desc = 'Open [D]ebug [W]indow [T]hreads',
},
{
'<leader>dwe',
function()
local widgets = require 'dap.ui.widgets'
local my_sidebar = widgets.sidebar(widgets.expression)
my_sidebar.open()
end,
desc = 'Open [D]ebug [W]indow [E]xpression',
},
},
dependencies = {
'mfussenegger/nvim-dap',
'nvim-neotest/nvim-nio',
},
config = function(_, opts)
local dap = require 'dap'
local dapui = require 'dapui'
dapui.setup(opts)
dap.listeners.after.event_initialized['dapui_config'] = function()
dapui.open {}
end
dap.listeners.before.event_terminated['dapui_config'] = function()
-- dapui.close {}
end
dap.listeners.before.event_exited['dapui_config'] = function()
-- dapui.close {}
end
end,
},
{ {
'folke/lazydev.nvim', 'folke/lazydev.nvim',
ft = 'lua', -- only load on lua files ft = 'lua', -- only load on lua files
@ -325,4 +496,48 @@ return {
}, },
}, },
{ 'Bilal2453/luvit-meta', lazy = true }, -- optional `vim.uv` typings { 'Bilal2453/luvit-meta', lazy = true }, -- optional `vim.uv` typings
{
'mrcjkb/rustaceanvim',
enabled = false,
version = '^4', -- Recommended
ft = { 'rust' },
config = function()
local dap = require 'dap'
vim.g.rustaceanvim = {
enable_clippy = true,
-- Plugin configuration
tools = {
enable_clippy = true,
},
-- LSP configuration
server = {
on_attach = function(client, bufnr)
-- you can also put keymaps in here
end,
settings = {
-- rust-analyzer language server configuration
['rust-analyzer'] = {
cargo = {
features = 'all',
},
},
},
},
-- DAP configuration
dap = {
-- FIXME: the rustaceanvim debug config does not map the stdout/stderr to the
-- opened terminal, effectively rendering debugging with it useless. Luckily,
-- we can use the regular nvim-dap and nvim-dap-ui.
adapter = dap.adapters.codelldb,
},
}
end,
},
{
'theHamsta/nvim-dap-virtual-text',
lazy = false, -- PERF: this can be done more elegant
config = function()
require('nvim-dap-virtual-text').setup()
end,
},
} }

View File

@ -118,8 +118,8 @@ return {
local leap = require 'leap' local leap = require 'leap'
leap.opts.safe_labels = 'asfghjkliztrewb' leap.opts.safe_labels = 'sfnutSFNLHMUGTZ?'
leap.opts.labels = 'sfnjklhodweimbuyvrgtaqpcxz' leap.opts.labels = 'sfnjklhodweimbuyvrgtaqpcxzSFNJKLHODWEIMBUYVRGTAQPCXZ?'
leap.opts.special_keys = { leap.opts.special_keys = {
next_target = '<enter>', next_target = '<enter>',
prev_target = '<tab>', prev_target = '<tab>',
@ -198,24 +198,19 @@ return {
local wk = require 'which-key' local wk = require 'which-key'
local defaults = { local defaults = {
mode = { 'n', 'v' }, mode = { 'n', 'v' },
{ '<leader>c', group = '[C]ode/[C]olor' }, ['<localleader>'] = { name = '+select', f = { name = '[F]ind' } },
{ '<leader>ct', group = '[T]rouble' }, ['g'] = { name = '+goto' },
{ '<leader>d', group = '[D]ebug' }, [']'] = { name = '+next' },
{ '<leader>dc', group = '[C]hange' }, ['['] = { name = '+prev' },
{ '<leader>dw', group = '[W]indow' }, ['<leader>d'] = { name = '+[D]ebug', w = { name = '[W]indow' }, c = { name = '[C]hange' } },
{ '<leader>f', group = '[F]ormatting' }, ['<leader>c'] = { name = '+[C]ode/[C]olor', t = { name = '+[T]rouble' } },
{ '<leader>g', group = '[G]ood tools' }, ['<leader>g'] = { name = '+[G]ood tools' },
{ '<leader>r', group = '[R]ename' }, ['<leader>f'] = { name = '+[F]ormatting' },
{ '<leader>t', group = '[T]oggle' }, ['<leader>r'] = { name = '[R]ename' },
{ '<leader>w', group = '[W]orkspace' }, ['<leader>w'] = { name = '[W]orkspace', b = { name = 'buffer' } },
{ '<leader>wb', group = 'buffer' }, ['<leader>t'] = { name = '[T]oggle', ['🚫'] = 'which_key_ignore' },
{ '<localleader>', group = 'select' },
{ '<localleader>f', group = '[F]ind' },
{ '[', group = 'prev' },
{ ']', group = 'next' },
{ 'g', group = 'goto' },
} }
wk.add(defaults, opts) wk.register(defaults, opts)
end, end,
}, },
{ {
@ -643,7 +638,6 @@ return {
}, },
{ {
'MeanderingProgrammer/dashboard.nvim', 'MeanderingProgrammer/dashboard.nvim',
enable = true,
event = 'VimEnter', event = 'VimEnter',
dependencies = { dependencies = {
'MaximilianLloyd/ascii.nvim', 'MaximilianLloyd/ascii.nvim',

View File

@ -7,12 +7,12 @@
-- kickstart.nvim and not kitchen-sink.nvim ;) -- kickstart.nvim and not kitchen-sink.nvim ;)
return { return {
{
-- NOTE: Yes, you can install new plugins here! -- NOTE: Yes, you can install new plugins here!
'mfussenegger/nvim-dap', 'mfussenegger/nvim-dap',
-- NOTE: And you can specify dependencies as well -- NOTE: And you can specify dependencies as well
dependencies = { dependencies = {
-- Creates a beautiful debugger UI -- Creates a beautiful debugger UI
'rcarriga/nvim-dap-ui',
-- Required dependency for nvim-dap-ui -- Required dependency for nvim-dap-ui
'nvim-neotest/nvim-nio', 'nvim-neotest/nvim-nio',
@ -21,7 +21,8 @@ return {
'williamboman/mason.nvim', 'williamboman/mason.nvim',
'jay-babu/mason-nvim-dap.nvim', 'jay-babu/mason-nvim-dap.nvim',
'theHamsta/nvim-dap-virtual-text', -- Add your own debuggers here
'leoluz/nvim-dap-go',
}, },
config = function() config = function()
local dap = require 'dap' local dap = require 'dap'
@ -40,13 +41,19 @@ return {
-- online, please don't ask me how to install them :) -- online, please don't ask me how to install them :)
ensure_installed = { ensure_installed = {
-- Update this to ensure that you have the debuggers for the langs you want -- Update this to ensure that you have the debuggers for the langs you want
'codelldb', 'delve',
'debugpy',
}, },
} }
-- Basic debugging keymaps, feel free to change to your liking! -- Basic debugging keymaps, feel free to change to your liking!
vim.keymap.set('n', '<leader>dB', function() end, { desc = 'Debug: Set Breakpoint' }) vim.keymap.set('n', '<F5>', dap.continue, { desc = 'Debug: Start/Continue' })
vim.keymap.set('n', '<F1>', dap.step_into, { desc = 'Debug: Step Into' })
vim.keymap.set('n', '<F2>', dap.step_over, { desc = 'Debug: Step Over' })
vim.keymap.set('n', '<F3>', dap.step_out, { desc = 'Debug: Step Out' })
vim.keymap.set('n', '<leader>b', dap.toggle_breakpoint, { desc = 'Debug: Toggle Breakpoint' })
vim.keymap.set('n', '<leader>B', function()
dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ')
end, { desc = 'Debug: Set Breakpoint' })
-- Dap UI setup -- Dap UI setup
-- For more information, see |:help nvim-dap-ui| -- For more information, see |:help nvim-dap-ui|
@ -70,143 +77,20 @@ return {
}, },
} }
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
vim.keymap.set('n', '<F7>', dapui.toggle, { desc = 'Debug: See last session result.' })
dap.listeners.after.event_initialized['dapui_config'] = dapui.open dap.listeners.after.event_initialized['dapui_config'] = dapui.open
dap.listeners.before.event_terminated['dapui_config'] = dapui.close dap.listeners.before.event_terminated['dapui_config'] = dapui.close
dap.listeners.before.event_exited['dapui_config'] = dapui.close dap.listeners.before.event_exited['dapui_config'] = dapui.close
end,
},
{
'rcarriga/nvim-dap-ui',
keys = {
{
'<leader>du',
function()
require('dapui').toggle()
end,
desc = 'Open [D]ebug [U]i', -- Install golang specific config
require('dap-go').setup {
delve = {
-- On Windows delve must be run attached or it crashes.
-- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring
detached = vim.fn.has 'win32' == 0,
}, },
{ }
'<leader>dso',
function()
require('dap').step_over()
end, end,
desc = 'Toggle [D]ebug [S]tep [O]ver',
},
{
'<leader>dsi',
function()
require('dap').step_into()
end,
desc = 'Toggle [D]ebug [S]tep [I]nto',
},
{
'<leader>dc',
function()
require('dap').continue()
end,
desc = 'Toggle [D]ebug [C]ontinue / Start',
},
{
'<leader>db',
function()
require('dap').toggle_breakpoint()
end,
desc = 'Toggle [D]ebug [B]reakpoint',
},
{
'<leader>dB',
function()
require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ')
end,
desc = 'Toggle [D]ebug [B]reakpoint condition',
},
{
'<leader>dK',
function()
require('dap.ui.widgets').hover()
end,
desc = 'Open [D]ebug [K] hover',
},
{
'<leader>dws',
function()
local widgets = require 'dap.ui.widgets'
local my_sidebar = widgets.sidebar(widgets.scopes)
my_sidebar.open()
end,
desc = 'Open [D]ebug [W]indow [S]copes',
},
{
'<leader>dwr',
function()
require('dap').repl.toggle()
end,
desc = 'Open [D]ebug [W]indow [R]epl',
},
{
'<leader>dwf',
function()
local widgets = require 'dap.ui.widgets'
local my_sidebar = widgets.sidebar(widgets.frames)
my_sidebar.open()
end,
desc = 'Open [D]ebug [W]indow [F]rames',
},
{
'<leader>dwi',
function()
local widgets = require 'dap.ui.widgets'
local my_sidebar = widgets.sidebar(widgets.sessions)
my_sidebar.open()
end,
desc = 'Open [D]ebug [W]indow sess[I]ons',
},
{
'<leader>dwt',
function()
local widgets = require 'dap.ui.widgets'
local my_sidebar = widgets.sidebar(widgets.threads)
my_sidebar.open()
end,
desc = 'Open [D]ebug [W]indow [T]hreads',
},
{
'<leader>dwe',
function()
local widgets = require 'dap.ui.widgets'
local my_sidebar = widgets.sidebar(widgets.expression)
my_sidebar.open()
end,
desc = 'Open [D]ebug [W]indow [E]xpression',
},
},
dependencies = {
'mfussenegger/nvim-dap',
'nvim-neotest/nvim-nio',
},
config = function(_, opts)
local dap = require 'dap'
local dapui = require 'dapui'
dapui.setup(opts)
dap.listeners.after.event_initialized['dapui_config'] = function()
dapui.open {}
end
dap.listeners.before.event_terminated['dapui_config'] = function()
-- dapui.close {}
end
dap.listeners.before.event_exited['dapui_config'] = function()
-- dapui.close {}
end
end,
},
} }

View File

@ -418,19 +418,3 @@ i32
C3 C3
TOTP TOTP
Panta/!
Panta
kauma
α
XEX
unintuitively
sea128
u8
Base64
ffield
α's
Vec
u128
number1
number2
i64

Binary file not shown.