Compare commits

...

11 Commits

11 changed files with 251 additions and 331 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,6 +177,7 @@ 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,6 +15,17 @@ 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,10 +29,11 @@ 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>', '<esc>^i', { desc = 'Go to the start of the line' }) vim.keymap.set('i', '<C-S-h>', '<esc>^i', { desc = 'Go to the start of the line' })
vim.keymap.set('i', '<C-e>', '<End>', { desc = 'Go to the end of the line' }) vim.keymap.set('i', '<C-S-l>', '<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

@ -141,27 +141,11 @@ local servers = {
tinymist = {}, tinymist = {},
html = {}, html = {},
cssls = {}, cssls = {},
tsserver = {},
clangd = {}, clangd = {},
pyright = {},
bashls = {}, bashls = {},
cmake = {},
yamlls = {}, yamlls = {},
texlab = {}, texlab = {},
basedpyright = {
root_dir = vim.loop.cwd,
flags = { debounce_text_changes = 300 },
single_file_support = true,
settings = {
python = {
analysis = {
autoSearchPaths = true,
diagnosticMode = 'openFilesOnly',
useLibraryCodeForTypes = true,
typeCheckingMode = 'basic',
},
},
},
},
rust_analyzer = { rust_analyzer = {
settings = { settings = {
['rust-analyzer'] = { ['rust-analyzer'] = {
@ -175,6 +159,7 @@ local servers = {
prefix = 'self', prefix = 'self',
}, },
cargo = { cargo = {
features = 'all',
buildScripts = { buildScripts = {
enable = true, enable = true,
}, },

View File

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

View File

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

View File

@ -7,90 +7,206 @@
-- kickstart.nvim and not kitchen-sink.nvim ;) -- kickstart.nvim and not kitchen-sink.nvim ;)
return { return {
-- NOTE: Yes, you can install new plugins here! {
'mfussenegger/nvim-dap', -- NOTE: Yes, you can install new plugins here!
-- NOTE: And you can specify dependencies as well 'mfussenegger/nvim-dap',
dependencies = { -- NOTE: And you can specify dependencies as well
-- Creates a beautiful debugger UI dependencies = {
'rcarriga/nvim-dap-ui', -- Creates a beautiful debugger UI
-- Required dependency for nvim-dap-ui -- Required dependency for nvim-dap-ui
'nvim-neotest/nvim-nio', 'nvim-neotest/nvim-nio',
-- Installs the debug adapters for you -- Installs the debug adapters for you
'williamboman/mason.nvim', 'williamboman/mason.nvim',
'jay-babu/mason-nvim-dap.nvim', 'jay-babu/mason-nvim-dap.nvim',
-- Add your own debuggers here 'theHamsta/nvim-dap-virtual-text',
'leoluz/nvim-dap-go', },
}, config = function()
config = function() local dap = require 'dap'
local dap = require 'dap' local dapui = require 'dapui'
local dapui = require 'dapui'
require('mason-nvim-dap').setup { require('mason-nvim-dap').setup {
-- Makes a best effort to setup the various debuggers with -- Makes a best effort to setup the various debuggers with
-- reasonable debug configurations -- reasonable debug configurations
automatic_installation = true, automatic_installation = true,
-- You can provide additional configuration to the handlers, -- You can provide additional configuration to the handlers,
-- see mason-nvim-dap README for more information -- see mason-nvim-dap README for more information
handlers = {}, handlers = {},
-- You'll need to check that you have the required things installed -- You'll need to check that you have the required things installed
-- 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
'delve', 'codelldb',
}, 'debugpy',
}
-- Basic debugging keymaps, feel free to change to your liking!
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
-- For more information, see |:help nvim-dap-ui|
dapui.setup {
-- Set icons to characters that are more likely to work in every terminal.
-- Feel free to remove or use ones that you like more! :)
-- Don't feel like these are good choices.
icons = { expanded = '', collapsed = '', current_frame = '*' },
controls = {
icons = {
pause = '',
play = '',
step_into = '',
step_over = '',
step_out = '',
step_back = 'b',
run_last = '▶▶',
terminate = '',
disconnect = '',
}, },
}
-- Basic debugging keymaps, feel free to change to your liking!
vim.keymap.set('n', '<leader>dB', function() end, { desc = 'Debug: Set Breakpoint' })
-- Dap UI setup
-- For more information, see |:help nvim-dap-ui|
dapui.setup {
-- Set icons to characters that are more likely to work in every terminal.
-- Feel free to remove or use ones that you like more! :)
-- Don't feel like these are good choices.
icons = { expanded = '', collapsed = '', current_frame = '*' },
controls = {
icons = {
pause = '',
play = '',
step_into = '',
step_over = '',
step_out = '',
step_back = 'b',
run_last = '▶▶',
terminate = '',
disconnect = '',
},
},
}
dap.listeners.after.event_initialized['dapui_config'] = dapui.open
dap.listeners.before.event_terminated['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',
}, },
} {
'<leader>dso',
function()
require('dap').step_over()
end,
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. desc = 'Toggle [D]ebug [S]tep [O]ver',
vim.keymap.set('n', '<F7>', dapui.toggle, { desc = 'Debug: See last session result.' })
dap.listeners.after.event_initialized['dapui_config'] = dapui.open
dap.listeners.before.event_terminated['dapui_config'] = dapui.close
dap.listeners.before.event_exited['dapui_config'] = dapui.close
-- 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,
}, },
} {
end, '<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,3 +418,19 @@ i32
C3 C3
TOTP TOTP
Panta/!
Panta
kauma
α
XEX
unintuitively
sea128
u8
Base64
ffield
α's
Vec
u128
number1
number2
i64

Binary file not shown.