Compare commits

...

6 Commits

11 changed files with 265 additions and 56 deletions

15
.gitmodules vendored
View File

@ -99,3 +99,18 @@
[submodule "src/.local/share/nvim/site/pack/3pp/start/colorbuddy.nvim"]
path = src/.local/share/nvim/site/pack/3pp/start/colorbuddy.nvim
url = https://github.com/tjdevries/colorbuddy.nvim.git
# debug adapter protocol
# debugging.lua
[submodule "nvim-dap"]
path = nvim-dap
url = https://github.com/mfussenegger/nvim-dap.git
[submodule "src/.local/share/nvim/site/pack/3pp/start/nvim-dap"]
path = src/.local/share/nvim/site/pack/3pp/start/nvim-dap
url = https://github.com/mfussenegger/nvim-dap.git
[submodule "src/.local/share/nvim/site/pack/3pp/start/nvim-dap-ui"]
path = src/.local/share/nvim/site/pack/3pp/start/nvim-dap-ui
url = https://github.com/rcarriga/nvim-dap-ui.git
[submodule "src/.local/share/nvim/site/pack/3pp/start/nvim-nio"]
path = src/.local/share/nvim/site/pack/3pp/start/nvim-nio
url = https://github.com/nvim-neotest/nvim-nio

View File

@ -7,7 +7,7 @@ set foldexpr=nvim_treesitter#foldexpr()
" unfold by default
set foldlevel=99
source $XDG_CONFIG_HOME/nvim/vimspector.vim
" source $XDG_CONFIG_HOME/nvim/vimspector.vim
" auto-pairs
let g:AutoPairsFlyMode = 0

View File

@ -1,9 +1,32 @@
-- stuff for coding
confutil = require("confutil")
keymap = confutil.keymap
local confutil = require("confutil")
local keymap = confutil.keymap
------
-- python format-on-save
-- https://stackoverflow.com/a/77467553
------
-- to turn this off for a session (permanently), run
-- :autocmd! AutoFormat
-- https://superuser.com/a/1415274
vim.api.nvim_create_augroup("AutoFormat", {})
vim.api.nvim_create_autocmd(
"BufWritePost",
{
pattern = "*.py",
group = "AutoFormat",
callback = function()
vim.cmd("silent !black --quiet %")
vim.cmd("edit")
vim.cmd("norm zz")
end,
}
)
------
-- syntax highlighting

View File

@ -10,7 +10,7 @@ function M.keymap(key, cmd, params)
default_params = {
silent=true,
mode="n",
mode={'n'},
noremap=true,
}
setmetatable(params, {
@ -19,7 +19,7 @@ function M.keymap(key, cmd, params)
end
})
vim.api.nvim_set_keymap(params.mode, key, cmd, { silent=params.silent, noremap=params.noremap })
vim.keymap.set(params.mode, key, cmd, { silent=params.silent, noremap=params.noremap })
end
-- see ~/.config/dot_profile.example for info

View File

@ -0,0 +1,142 @@
-- dap and debugging related configurations
local confutil = require("confutil")
local keymap = confutil.keymap
local dap = require("dap")
local dapui = require("dapui")
--------------------------------
--------------------------------
-- dap-ui configuration
--------------------------------
--------------------------------
----------------
-- key bindings
----------------
keymap("<leader>dd", dapui.setup)
keymap("<leader>rs", dap.continue)
keymap("<leader>rt", dap.restart)
keymap("<leader>rr", dap.terminate)
keymap("<c-p>", dap.step_into)
keymap("<c-n>", dap.step_over)
keymap("<F12>", dap.step_out)
keymap("<leader>dsf", dap.toggle_breakpoint)
keymap("<leader>dsc", dap.clear_breakpoints)
keymap("<leader>dsF", function()
dap.set_breakpoint(vim.fn.input("cond: "))
end)
keymap("K", dapui.eval, {mode = {'n', 'v'}})
----------------
-- ui setup
----------------
-- https://github.com/rcarriga/nvim-dap-ui/blob/master/doc/nvim-dap-ui.txt
dapui.setup({
controls = {
enabled = false,
},
icons = {
collapsed = ">",
current_frame = ">",
expanded = "v",
},
layouts = {
{
elements = {
{
id = "stacks",
size = 0.20
},
{
id = "scopes",
size = 0.40
},
{
id = "watches",
size = 0.40
},
},
position = "left",
size = 40
},
{
elements = {
{
id = "console",
size = 0.8
},
{
id = "repl",
size = 0.2
},
},
position = "right",
size = 50
},
},
})
----------------
-- hooks
----------------
dap.listeners.after.launch.dapui_config = function()
dapui.open()
end
dap.listeners.after.attach.dapui_config = function()
dapui.open()
end
dap.listeners.after.event_terminated.dapui_config = function()
dapui.close()
end
dap.listeners.after.event_exited.dapui_config = function()
dapui.close()
end
----------------
-- signs
----------------
vim.cmd [[ sign define DapBreakpoint text=● ]]
vim.cmd [[ sign define DapBreakpointCondition text=◒ ]]
--------------------------------
--------------------------------
-- debug adapter configs
--------------------------------
--------------------------------
-- https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation#python
dap.adapters.python = function(cb, config)
if config.request == 'attach' then
assert(false, "attach not implemented")
else
cb({
type = 'executable',
command = "python",
args = { "-m", "debugpy.adapter" },
options = {
source_filetype = "python",
}
})
end
end
dap.configurations.python = {
{
-- dap parts
type = "python";
request = "launch";
name = "launch file";
-- debugger parts
program = "${file}";
-- this could be smarter (e.g., try to find a virtual env)
pythonPath = function() return "/usr/bin/python" end;
console = "integratedTerminal";
}
}

View File

@ -41,57 +41,7 @@ keymap("<leader>eh", "<cmd>Telescope help_tags<cr>")
keymap("<leader>es", "<cmd>Telescope lsp_document_symbols<cr>")
keymap("<leader>eb", "<cmd>Telescope keymaps<cr>")
------
-- color theme
-- plug: nvim-noirbuddy, colorbuddy.nvim
------
require("noirbuddy").setup({
colors = {
primary="#99AABB"
},
styles = {
italic = true,
bold = false,
underline = true,
undercurl = true,
},
preset = "slate",
})
-- force transparent bg
local Color, colors, Group, groups, styles = require("colorbuddy").setup {}
Group.new("Normal", colors.noir_4, colors.none, no)
Group.link("StatusLine", groups.normal)
Group.link("Gutter", groups.normal)
Group.new("LineNr", colors.noir_8, colors.none, no)
Group.link("SignColumn", groups.LineNr)
-- other overrides
Group.new("identifier", colors.noir_3, nil, no)
Group.new("function", colors.noir_2, nil)
Group.link("@function", groups["function"])
Group.link("@lsp.type.function", groups["function"])
Group.new("comment", colors.noir_6, nil, styles.italic)
Group.link("@comment", groups.comment)
Group.new("keyword.return", colors.noir_4, nil, styles.bold)
Group.link("@keyword.return", groups["keyword.return"])
Group.link("type.qualifier", groups["keyword.return"])
Group.link("@type.qualifier", groups["keyword.return"])
Group.new("NormalFloat", colors.noir_1, colors.noir_9, no)
-- swap undercurls and underlines
for _, v in ipairs({"Error", "Info", "Hint", "Warn"}) do
col_name = "diagnostic_" .. string.lower(v)
if v == "Warn" then
col_name = "diagnostic_warning"
end
Group.new("Diagnostic" .. v, colors[col_name], nil, styles.underline)
Group.new("DiagnosticUnderline" .. v, colors[col_name], nil, styles.undercurl)
end
require("theme")
--------------------------------
--------------------------------
@ -101,4 +51,5 @@ end
if dotprofile >= profile_table.DEFAULT then
require("coding")
require("debugging")
end

View File

@ -0,0 +1,72 @@
------
-- color theme
-- plug: nvim-noirbuddy, colorbuddy.nvim
------
require("noirbuddy").setup({
colors = {
primary="#99AABB"
},
styles = {
italic = true,
bold = false,
underline = true,
undercurl = true,
},
preset = "slate",
})
-- force transparent bg
local Color, colors, Group, groups, styles = require("colorbuddy").setup {}
Group.new("Normal", colors.noir_4, colors.none, no)
Group.new("StatusLine", colors.noir_4, colors.none, styles.bold)
-- not selected statusline
Group.new("StatusLineNC", colors.noir_7, colors.none)
Group.link("Gutter", groups.normal)
Group.new("LineNr", colors.noir_8, colors.none, no)
Group.link("SignColumn", groups.LineNr)
Group.new("VertSplit", colors.noir_9, colors.none, no)
-- other overrides
Group.new("identifier", colors.noir_3, nil, no)
Group.new("function", colors.noir_2, nil)
Group.link("@function", groups["function"])
Group.link("@lsp.type.function", groups["function"])
Group.new("comment", colors.noir_6, nil, styles.italic)
Group.link("@comment", groups.comment)
Group.new("keyword.return", colors.noir_4, nil, styles.bold)
Group.link("@keyword.return", groups["keyword.return"])
Group.link("type.qualifier", groups["keyword.return"])
Group.link("@type.qualifier", groups["keyword.return"])
Group.new("NormalFloat", colors.noir_1, colors.noir_9, no)
-- swap undercurls and underlines
for _, v in ipairs({"Error", "Info", "Hint", "Warn"}) do
col_name = "diagnostic_" .. string.lower(v)
if v == "Warn" then
col_name = "diagnostic_warning"
end
Group.new("Diagnostic" .. v, colors[col_name], nil, styles.underline)
Group.new("DiagnosticUnderline" .. v, colors[col_name], nil, styles.undercurl)
end
-- DAP-ui colors
Group.new("debugPC", primary, colors.noir_8)
Group.new("DapUIModifiedValue", primary, nil, styles.bold)
Group.new("DapUIWatchesEmpty", colors.noir_8, nil, nil)
Group.new("DapUIWatchesError", colors.diff_delete, nil, nil)
Group.new("DapUISource", colors.primary, nil, nil)
Group.new("DapUILineNumber", colors.noir_5, nil, nil)
Group.new("DapUIScope", colors.noir_5, nil, nil)
Group.new("DapUIDecoration", colors.secondary, nil, nil)
Group.new("DapUIStoppedThread", colors.primary, nil, nil)
Group.new("DapUIBreakpointsCurrentLine", colors.primary, nil, nil)
Group.link("DapUIType", groups["@type.builtin"])
Group.link("DapUIVariable", groups["@variable"])
Group.link("DapUIValue", groups["@number"])
Group.link("DapUIFloatBorder", groups.FloatBorder)

View File

@ -0,0 +1,3 @@
snippet thumb "Thumbnail media link" w
[ ![]($1-thumb.$2) ]($1.$2)
endsnippet

@ -0,0 +1 @@
Subproject commit 405df1dcc2e395ab5173a9c3d00e03942c023074

@ -0,0 +1 @@
Subproject commit edfa93f60b189e5952c016eee262d0685d838450

@ -0,0 +1 @@
Subproject commit 33c62b3eadd8154169e42144de16ba4db6784bec