Skip to content

Commit

Permalink
fix(nvim): fix which-key deprecations
Browse files Browse the repository at this point in the history
Also removes some unused plugins, like haskell-tools.nvim and
Nvim-R (which I only needed for a single stats class).
  • Loading branch information
water-sucks committed Jul 17, 2024
1 parent b498b25 commit b7f4303
Show file tree
Hide file tree
Showing 20 changed files with 318 additions and 673 deletions.
52 changes: 4 additions & 48 deletions home/profiles/base/nvim/_sources/generated.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,28 +65,6 @@
},
"version": "ce0a05ab4e2839e1c48d072c5236cce846a387bc"
},
"plugin-Nvim-R": {
"cargoLocks": null,
"date": "2024-03-23",
"extract": null,
"name": "plugin-Nvim-R",
"passthru": {
"pretty-name": "Nvim-R"
},
"pinned": false,
"src": {
"deepClone": false,
"fetchSubmodules": false,
"leaveDotGit": false,
"name": null,
"owner": "jamespeapen",
"repo": "Nvim-R",
"rev": "378364731b6e7e2189642d27e479d9e1feb15efa",
"sha256": "sha256-qD2fI2yc3PZFyJUTdic/VdOY1fpdVccKRRhC3cyX2iU=",
"type": "github"
},
"version": "378364731b6e7e2189642d27e479d9e1feb15efa"
},
"plugin-auto-save-nvim": {
"cargoLocks": null,
"date": "2022-11-01",
Expand Down Expand Up @@ -527,28 +505,6 @@
},
"version": "6cd61f7a600bb756e558627cd2e740302c58e32d"
},
"plugin-haskell-tools-nvim": {
"cargoLocks": null,
"date": "2024-07-07",
"extract": null,
"name": "plugin-haskell-tools-nvim",
"passthru": {
"pretty-name": "haskell-tools.nvim"
},
"pinned": false,
"src": {
"deepClone": false,
"fetchSubmodules": false,
"leaveDotGit": false,
"name": null,
"owner": "MrcJkb",
"repo": "haskell-tools.nvim",
"rev": "6b6fa211da47582950abfab9e893ab936b6c4298",
"sha256": "sha256-xFJ79nH/2bk+HOSTOk8yWC/dO+K5RcHQ4oOz883SgDE=",
"type": "github"
},
"version": "6b6fa211da47582950abfab9e893ab936b6c4298"
},
"plugin-highlight-current-n-nvim": {
"cargoLocks": null,
"date": "2023-06-26",
Expand Down Expand Up @@ -1739,7 +1695,7 @@
},
"plugin-which-key-nvim": {
"cargoLocks": null,
"date": "2024-07-13",
"date": "2024-07-16",
"extract": null,
"name": "plugin-which-key-nvim",
"passthru": {
Expand All @@ -1753,11 +1709,11 @@
"name": null,
"owner": "folke",
"repo": "which-key.nvim",
"rev": "05bd8701dd5d7e90b2f5c4ae05f9471641400bed",
"sha256": "sha256-Geq3mJsmAZCPyPXfyUE3W3Aim3UTtCsRSdub7QwNOmc=",
"rev": "bb4e82bdaff50a4a93867e4c90938d18e7615af6",
"sha256": "sha256-af893q7+0vJQ78OzVO/jeA2VxqM9v0XGwcvQKrh6GrE=",
"type": "github"
},
"version": "05bd8701dd5d7e90b2f5c4ae05f9471641400bed"
"version": "bb4e82bdaff50a4a93867e4c90938d18e7615af6"
},
"plugin-zen-mode-nvim": {
"cargoLocks": null,
Expand Down
40 changes: 5 additions & 35 deletions home/profiles/base/nvim/_sources/generated.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# This file was generated by nvfetcher, please do not modify it manually.
{ fetchgit, fetchurl, fetchFromGitHub, dockerTools }:
{
fetchgit,
fetchurl,
fetchFromGitHub,
dockerTools,
}: {
plugin-Comment-nvim = {
pname = "plugin-Comment-nvim";
version = "e30b7f2008e52442154b66f7c519bfd2f1e32acb";
Expand Down Expand Up @@ -44,19 +40,6 @@
pretty-name = "LuaSnip";
date = "2024-06-28";
};
plugin-Nvim-R = {
pname = "plugin-Nvim-R";
version = "378364731b6e7e2189642d27e479d9e1feb15efa";
src = fetchFromGitHub {
owner = "jamespeapen";
repo = "Nvim-R";
rev = "378364731b6e7e2189642d27e479d9e1feb15efa";
fetchSubmodules = false;
sha256 = "sha256-qD2fI2yc3PZFyJUTdic/VdOY1fpdVccKRRhC3cyX2iU=";
};
pretty-name = "Nvim-R";
date = "2024-03-23";
};
plugin-auto-save-nvim = {
pname = "plugin-auto-save-nvim";
version = "979b6c82f60cfa80f4cf437d77446d0ded0addf0";
Expand Down Expand Up @@ -317,19 +300,6 @@
pretty-name = "guess-indent.nvim";
date = "2024-07-06";
};
plugin-haskell-tools-nvim = {
pname = "plugin-haskell-tools-nvim";
version = "6b6fa211da47582950abfab9e893ab936b6c4298";
src = fetchFromGitHub {
owner = "MrcJkb";
repo = "haskell-tools.nvim";
rev = "6b6fa211da47582950abfab9e893ab936b6c4298";
fetchSubmodules = false;
sha256 = "sha256-xFJ79nH/2bk+HOSTOk8yWC/dO+K5RcHQ4oOz883SgDE=";
};
pretty-name = "haskell-tools.nvim";
date = "2024-07-07";
};
plugin-highlight-current-n-nvim = {
pname = "plugin-highlight-current-n-nvim";
version = "1225d1ad3fee74c3e6a6d258f25a1952b927cb76";
Expand Down Expand Up @@ -1034,16 +1004,16 @@
};
plugin-which-key-nvim = {
pname = "plugin-which-key-nvim";
version = "05bd8701dd5d7e90b2f5c4ae05f9471641400bed";
version = "bb4e82bdaff50a4a93867e4c90938d18e7615af6";
src = fetchFromGitHub {
owner = "folke";
repo = "which-key.nvim";
rev = "05bd8701dd5d7e90b2f5c4ae05f9471641400bed";
rev = "bb4e82bdaff50a4a93867e4c90938d18e7615af6";
fetchSubmodules = false;
sha256 = "sha256-Geq3mJsmAZCPyPXfyUE3W3Aim3UTtCsRSdub7QwNOmc=";
sha256 = "sha256-af893q7+0vJQ78OzVO/jeA2VxqM9v0XGwcvQKrh6GrE=";
};
pretty-name = "which-key.nvim";
date = "2024-07-13";
date = "2024-07-16";
};
plugin-zen-mode-nvim = {
pname = "plugin-zen-mode-nvim";
Expand Down
2 changes: 0 additions & 2 deletions home/profiles/base/nvim/fetch.nix
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,10 @@ in
(plugin "folke" "lazydev.nvim")
(plugin "akinsho" "flutter-tools.nvim")
(plugin "simrat39" "rust-tools.nvim")
(plugin "MrcJkb" "haskell-tools.nvim")
(plugin "mfussenegger" "nvim-jdtls")
(plugin "lervag" "vimtex")
(plugin "barreiroleo" "ltex_extra.nvim")
(plugin "kaarmu" "typst.vim")
(plugin "jamespeapen" "Nvim-R")

(fetch "nvim-neorg" "tree-sitter-norg" {
branch = "dev";
Expand Down
2 changes: 2 additions & 0 deletions home/profiles/base/nvim/lua/plugins/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ return {
rules = false,
},
})

vim.keymap.set({ "n", "v", "x", "o" }, "s", "<cmd>WhichKey n s<CR>")
end,
}),
}
56 changes: 24 additions & 32 deletions home/profiles/base/nvim/lua/plugins/dap/dap.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
local dap = require("dap")
local wk = require("which-key")

local signs = {
Breakpoint = "",
Expand All @@ -13,36 +14,27 @@ for type, icon in pairs(signs) do
vim.fn.sign_define(hl, { text = icon, texthl = "LspDiagnosticsSignHint" })
end

require("which-key").register({
d = {
name = "Debug",
b = { dap.step_back, "Step back" },
c = { dap.continue, "Continue" },
d = { dap.disconnect, "Disconnect" },
g = { dap.session, "Get session" },
i = { dap.step_into, "Step into" },
o = { dap.step_over, "Step over" },
p = { dap.pause, "Pause" },
q = { dap.close, "Quit" },
r = { dap.repl.toggle, "Toggle REPL" },
s = { dap.continue, "Start" },
t = { dap.toggle_breakpoint, "Toggle breakpoint" },
x = { dap.terminate, "Terminate" },
u = { dap.step_out, "Step out" },
R = { dap.run_to_cursor, "Run to cursor" },
B = {
function()
local condition = ""
vim.ui.select({
prompt = "[Condition] > ",
}, function(input)
condition = input
end)
dap.set_breakpoint(condition)
end,
"Conditional breakpoint",
},
},
}, {
prefix = "<Leader>",
local function conditionalBreakpoint()
vim.ui.input({ prompt = "Condition" }, function(cond)
dap.set_breakpoint(cond)
end)
end

wk.add({
{ "<Leader>d", group = "Debug" },
{ "<Leader>db", dap.step_back, desc = "Step back" },
{ "<Leader>dc", dap.continue, desc = "Continue" },
{ "<Leader>dd", dap.disconnect, desc = "Disconnect" },
{ "<Leader>dg", dap.session, desc = "Get session" },
{ "<Leader>di", dap.step_into, desc = "Step into" },
{ "<Leader>do", dap.step_over, desc = "Step over" },
{ "<Leader>dp", dap.pause, desc = "Pause" },
{ "<Leader>dq", dap.close, desc = "Quit" },
{ "<Leader>dr", dap.repl.toggle, desc = "Toggle REPL" },
{ "<Leader>ds", dap.continue, desc = "Start" },
{ "<Leader>dt", dap.toggle_breakpoint, desc = "Toggle breakpoint" },
{ "<Leader>dx", dap.terminate, desc = "Terminate" },
{ "<Leader>du", dap.step_out, desc = "Step out" },
{ "<Leader>dR", dap.run_to_cursor, desc = "Run to cursor" },
{ "<Leader>dB", conditionalBreakpoint, desc = "Conditional breakpoint" },
})
2 changes: 1 addition & 1 deletion home/profiles/base/nvim/lua/plugins/dap/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ local dapui_spec = use("rcarriga/nvim-dap-ui", {
local dap_virtual_text_spec = use("theHamsta/nvim-dap-virtual-text", {
event = "VeryLazy",
config = function()
require("nvim-dap-virtual-text").setup()
require("nvim-dap-virtual-text").setup({})
end,
})

Expand Down
2 changes: 1 addition & 1 deletion home/profiles/base/nvim/lua/plugins/dap/nlua.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dap.configurations.lua = {
request = "attach",
name = "Attach to running Neovim instance",
host = function()
local value = vim.fn.input({ prompt = "Host [127.0.0.1]: ", default = "127.0.0.1" })
local value = vim.fn.input({ prompt = "Host [127.0.0.1]", default = "127.0.0.1" })
if value ~= "" then
return value
end
Expand Down
44 changes: 17 additions & 27 deletions home/profiles/base/nvim/lua/plugins/dap/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,32 +47,22 @@ 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

wk.register({
d = {
name = "Debug",
E = {
function()
local expression = vim.fn.input({ prompt = "[Expression] > " })
dapui.eval(expression)
end,
"Evaluate input",
},
e = { dapui.eval, "Evaluate" },
U = { dapui.toggle, "Toggle UI" },
W = {
function()
dapui.open({ reset = true })
end,
"Reset UI layout",
},
wk.add({
{
"<Leader>dE",
function()
local expression = vim.fn.input({ prompt = "[Expression] > " })
dapui.eval(expression)
end,
desc = "Evaluate input",
},
}, {
prefix = "<Leader>",
})

wk.register({
e = { dapui.eval, "Evaluate" },
}, {
mode = "v",
prefix = "<Leader>",
{
"<Leader>dW",
function()
dapui.open({ reset = true })
end,
desc = "Reset UI layout",
},
{ "<Leader>de", dapui.eval, desc = "Evaluate", mode = { "n", "v" } },
{ "<Leader>dU", dapui.eval, desc = "Toggle UI" },
})
Loading

0 comments on commit b7f4303

Please sign in to comment.