tweaked keybinds
This commit is contained in:
parent
d1dc610a6e
commit
81c09df8b7
|
|
@ -18,23 +18,67 @@ dap.adapters.coreclr = {
|
||||||
args = {"--interpreter=vscode"}
|
args = {"--interpreter=vscode"}
|
||||||
}
|
}
|
||||||
|
|
||||||
dap.configurations.cs = {
|
vim.g.dotnet_build_project = function()
|
||||||
|
local default_path = vim.fn.getcwd() .. "/"
|
||||||
|
if vim.g["dotnet_last_proj_path"] ~= nil then
|
||||||
|
default_path = vim.g["dotnet_last_proj_path"]
|
||||||
|
end
|
||||||
|
local cmd = "dotnet build -c Debug > /dev/null"
|
||||||
|
print("")
|
||||||
|
print("Cmd to execute: " .. cmd)
|
||||||
|
local f = os.execute(cmd)
|
||||||
|
if f == 0 then
|
||||||
|
print("\nBuild: ✔️ ")
|
||||||
|
else
|
||||||
|
print("\nBuild: ❌ (code: " .. f .. ")")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.g.dotnet_get_dll_path = function()
|
||||||
|
local cwd = vim.fn.getcwd()
|
||||||
|
local solution = vim.fn.glob(cwd .. "/*.csproj")
|
||||||
|
local projectName = vim.fn.fnamemodify(solution, ":t:r")
|
||||||
|
local dll = cwd .. "/bin/Debug/net6.0/" .. projectName .. ".dll"
|
||||||
|
return dll
|
||||||
|
end
|
||||||
|
|
||||||
|
local config = {
|
||||||
{
|
{
|
||||||
type = "coreclr",
|
type = "coreclr",
|
||||||
name = "launch - netcoredbg",
|
name = "launch - netcoredbg",
|
||||||
request = "launch",
|
request = "launch",
|
||||||
program = function()
|
program = function()
|
||||||
local cwd = vim.fn.getcwd()
|
if vim.fn.confirm("Should I recompile first?", "&yes\n&no", 2) == 1 then
|
||||||
local solution = vim.fn.glob(cwd .. "/*.csproj")
|
vim.g.dotnet_build_project()
|
||||||
local projectName = vim.fn.fnamemodify(solution, ":t:r")
|
end
|
||||||
local proj = cwd .. "/bin/Debug/net6.0/" .. projectName .. ".dll"
|
return vim.g.dotnet_get_dll_path()
|
||||||
print(proj)
|
|
||||||
return proj
|
|
||||||
-- return vim.fn.input("Path to dll", vim.fn.getcwd() .. "/bin/Debug/", "file")
|
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dap.configurations.cs = config
|
||||||
|
|
||||||
-- keybindings
|
-- keybindings
|
||||||
vim.api.nvim_set_keymap("n", "<leader>db", ":lua require'dap'.toggle_breakpoint()<CR>", {noremap = true, silent = true})
|
local api = vim.api
|
||||||
vim.api.nvim_set_keymap("n", "<leader>dc", ":lua require'dap'.continue()<CR>", {noremap = true, silent = true})
|
local keymap_restore = {}
|
||||||
|
dap.listeners.after["event_initialized"]["me"] = function()
|
||||||
|
for _, buf in pairs(api.nvim_list_bufs()) do
|
||||||
|
local keymaps = api.nvim_buf_get_keymap(buf, "n")
|
||||||
|
for _, keymap in pairs(keymaps) do
|
||||||
|
if keymap.lhs == "K" then
|
||||||
|
table.insert(keymap_restore, keymap)
|
||||||
|
api.nvim_buf_del_keymap(buf, "n", "K")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
api.nvim_set_keymap("n", "K", '<Cmd>lua require("dap.ui.widgets").hover()<CR>', {silent = true})
|
||||||
|
end
|
||||||
|
|
||||||
|
dap.listeners.after["event_terminated"]["me"] = function()
|
||||||
|
for _, keymap in pairs(keymap_restore) do
|
||||||
|
api.nvim_buf_set_keymap(keymap.buffer, keymap.mode, keymap.lhs, keymap.rhs, {silent = keymap.silent == 1})
|
||||||
|
end
|
||||||
|
keymap_restore = {}
|
||||||
|
end
|
||||||
|
api.nvim_set_keymap("n", "<leader>B", ":lua require'dap'.toggle_breakpoint()<CR>", {noremap = true, silent = true})
|
||||||
|
api.nvim_set_keymap("n", "<f5>", ":lua require'dap'.continue()<CR>", {noremap = true, silent = true})
|
||||||
|
|
|
||||||
|
|
@ -95,51 +95,35 @@ require("neo-tree").setup(
|
||||||
mappings = {
|
mappings = {
|
||||||
["<space>"] = {
|
["<space>"] = {
|
||||||
"toggle_node",
|
"toggle_node",
|
||||||
nowait = false -- disable `nowait` if you have existing combos starting with this char that you want to use
|
nowait = false
|
||||||
},
|
},
|
||||||
-- ["<2-LeftMouse>"] = "open",
|
|
||||||
-- ["<cr>"] = "open",
|
|
||||||
["<esc>"] = "revert_preview",
|
["<esc>"] = "revert_preview",
|
||||||
["P"] = {"toggle_preview", config = {use_float = true}},
|
["P"] = {"toggle_preview", config = {use_float = true}},
|
||||||
-- ["s"] = "open_split",
|
|
||||||
-- ["v"] = "open_vsplit",
|
|
||||||
["s"] = "split_with_window_picker",
|
["s"] = "split_with_window_picker",
|
||||||
["v"] = "vsplit_with_window_picker",
|
["v"] = "vsplit_with_window_picker",
|
||||||
["t"] = "open_tabnew",
|
["t"] = "open_tabnew",
|
||||||
-- ["<cr>"] = "open_drop",
|
|
||||||
-- ["t"] = "open_tab_drop",
|
|
||||||
["<cr>"] = "open_with_window_picker",
|
["<cr>"] = "open_with_window_picker",
|
||||||
["<2-LeftMouse>"] = "open_with_window_picker",
|
["<2-LeftMouse>"] = "open_with_window_picker",
|
||||||
--["P"] = "toggle_preview", -- enter preview mode, which shows the current node without focusing
|
|
||||||
["C"] = "close_node",
|
["C"] = "close_node",
|
||||||
["z"] = "close_all_nodes",
|
["z"] = "close_all_nodes",
|
||||||
--["Z"] = "expand_all_nodes",
|
|
||||||
["a"] = {
|
["a"] = {
|
||||||
"add",
|
"add",
|
||||||
-- some commands may take optional config options, see `:h neo-tree-mappings` for details
|
|
||||||
config = {
|
config = {
|
||||||
show_path = "absolute" -- "none", "relative", "absolute"
|
show_path = "absolute"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
["A"] = "add_directory", -- also accepts the optional config.show_path option like "add".
|
|
||||||
["d"] = "delete",
|
["d"] = "delete",
|
||||||
["r"] = "rename",
|
["r"] = "rename",
|
||||||
["y"] = "copy_to_clipboard",
|
["y"] = "copy_to_clipboard",
|
||||||
["x"] = "cut_to_clipboard",
|
["x"] = "cut_to_clipboard",
|
||||||
["p"] = "paste_from_clipboard",
|
["p"] = "paste_from_clipboard",
|
||||||
["c"] = "copy", -- takes text input for destination, also accepts the optional config.show_path option like "add":
|
["c"] = "copy",
|
||||||
-- ["c"] = {
|
|
||||||
-- "copy",
|
|
||||||
-- config = {
|
|
||||||
-- show_path = "none" -- "none", "relative", "absolute"
|
|
||||||
-- }
|
|
||||||
--}
|
|
||||||
["m"] = {
|
["m"] = {
|
||||||
"move",
|
"move",
|
||||||
config = {
|
config = {
|
||||||
show_path = "absoulte"
|
show_path = "absoulte"
|
||||||
}
|
}
|
||||||
}, -- takes text input for destination, also accepts the optional config.show_path option like "add".
|
},
|
||||||
["q"] = "close_window",
|
["q"] = "close_window",
|
||||||
["R"] = "refresh",
|
["R"] = "refresh",
|
||||||
["?"] = "show_help",
|
["?"] = "show_help",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue