Update keymap settings for neovim 0.7

pull/2/head
Ensar Sarajčić 2022-04-27 11:02:47 +02:00
parent 17a5fa1172
commit 78c30af4f2
2 changed files with 56 additions and 19 deletions

View File

@ -10,16 +10,34 @@ vim.cmd [[ au FileType dap-repl lua require('dap.ext.autocompl').attach() ]]
require("nvim-dap-virtual-text").setup() require("nvim-dap-virtual-text").setup()
-- Keymaps -- Keymaps
local function set_keymap(...) vim.keymap.set(
vim.api.nvim_set_keymap(...) "n",
end "<leader>db",
function()
local default_opts = {noremap = true, silent = true} dap.toggle_breakpoint()
set_keymap("n", "<Leader>db", "<cmd>lua require'dap'.toggle_breakpoint()<CR>", default_opts) end
set_keymap("n", "<Leader>dc", "<cmd>lua require'dap'.continue()<CR>", default_opts) )
set_keymap("n", "<Leader>dso", "<cmd>lua require'dap'.step_over()<CR>", default_opts) vim.keymap.set(
set_keymap("n", "<Leader>dsi", "<cmd>lua require'dap'.step_into()<CR>", default_opts) "n",
set_keymap("n", "<Leader>dro", "<cmd>lua require'dap'.open()<CR>", default_opts) "<leader>dc",
function()
dap.continue()
end
)
vim.keymap.set(
"n",
"<leader>dso",
function()
dap.step_over()
end
)
vim.keymap.set(
"n",
"<leader>dsi",
function()
dap.step_into()
end
)
-- Nvim DAP UI -- Nvim DAP UI
local dapui = require("dapui") local dapui = require("dapui")
@ -38,8 +56,20 @@ dap.listeners.after["event_initialized"]["me"] = function()
end end
end end
end end
api.nvim_set_keymap("n", "K", '<Cmd>lua require("dapui").eval()<CR>', {silent = true}) vim.keymap.set(
api.nvim_set_keymap("v", "K", '<Cmd>lua require("dapui").eval()<CR>', {silent = true}) "n",
"K",
function()
dapui.eval()
end
)
vim.keymap.set(
"v",
"K",
function()
dapui.eval()
end
)
end end
dap.listeners.after["event_terminated"]["me"] = function() dap.listeners.after["event_terminated"]["me"] = function()

View File

@ -22,10 +22,17 @@ require("telescope").setup {
require("telescope").load_extension("dap") require("telescope").load_extension("dap")
default_opts = {noremap = true} vim.keymap.set(
"n",
local function set_keymap(...) "<C-P>",
vim.api.nvim_set_keymap(...) function()
end require("telescope.builtin").find_files()
set_keymap("n", "<C-P>", "<cmd>lua require('telescope.builtin').find_files()<CR>", default_opts) end
set_keymap("n", "<C-M-F>", "<cmd>lua require('telescope.builtin').live_grep()<CR>", default_opts) )
vim.keymap.set(
"n",
"<C-M-F>",
function()
require("telescope.builtin").live_grep()
end
)