diff --git a/lua/user/alpha.lua b/lua/user/alpha.lua index 3fba066..f30e1b7 100644 --- a/lua/user/alpha.lua +++ b/lua/user/alpha.lua @@ -16,13 +16,13 @@ dashboard.section.header.val = { } dashboard.section.buttons.val = { - dashboard.button("f", " " .. " Find file", ":Telescope find_files "), - dashboard.button("e", " " .. " New file", ":ene startinsert "), - dashboard.button("p", " " .. " Find project", ":lua require('telescope').extensions.projects.projects()"), - dashboard.button("r", " " .. " Recent files", ":Telescope oldfiles "), - dashboard.button("t", " " .. " Find text", ":Telescope live_grep "), - dashboard.button("c", " " .. " Config", ":e ~/.config/nvim/init.lua "), - dashboard.button("q", " " .. " Quit", ":qa"), + dashboard.button("f", " " .. " Find file", ":Telescope find_files "), + dashboard.button("e", " " .. " New file", ":ene startinsert "), + dashboard.button("p", " " .. " Find project", ":lua require('telescope').extensions.projects.projects()"), + dashboard.button("r", " " .. " Recent files", ":Telescope oldfiles "), + dashboard.button("t", " " .. " Find text", ":Telescope live_grep "), + dashboard.button("c", " " .. " Config", ":e ~/.config/nvim/init.lua "), + dashboard.button("q", " " .. " Quit", ":qa"), } local function footer() return "kristofers.xyz" diff --git a/lua/user/keymaps.lua b/lua/user/keymaps.lua index c0c4a41..de1a8c9 100644 --- a/lua/user/keymaps.lua +++ b/lua/user/keymaps.lua @@ -1,6 +1,4 @@ --- Shorten function name local keymap = vim.keymap.set --- Silent keymap option local opts = { silent = true } --Remap space as leader key @@ -34,20 +32,14 @@ keymap("n", "", ":resize +2", opts) keymap("n", "", ":vertical resize -2", opts) keymap("n", "", ":vertical resize +2", opts) --- Navigate buffers -keymap("n", "", ":bnext", opts) -keymap("n", "", ":bprevious", opts) - --- Clear highlights -keymap("n", "h", "nohlsearch", opts) - --- Close buffers -keymap("n", "", "Bdelete!", opts) +-- -- Navigate buffers +-- keymap("n", "", ":bnext", opts) +-- keymap("n", "", ":bprevious", opts) -- Better paste keymap("v", "p", '"_dP', opts) --- Move current line / block wiht Alt-j/k ala vscode +-- Move current line / block with Alt-j/k ala vscode keymap("n", "", "m .+1==", opts) keymap("n", "", "m .-2==", opts) @@ -93,31 +85,5 @@ keymap("t", "", "j", opts) keymap("t", "", "k", opts) keymap("t", "", "l", opts) --- Plugins -- - --- NvimTree -keymap("n", "e", ":NvimTreeToggle", opts) - --- Telescope -keymap("n", "ff", ":Telescope find_files", opts) -keymap("n", "ft", ":Telescope live_grep", opts) -keymap("n", "fp", ":Telescope projects", opts) -keymap("n", "fb", ":Telescope buffers", opts) - --- Git -keymap("n", "gg", "lua _LAZYGIT_TOGGLE()", opts) - --- Comment -keymap("n", "/", "lua require('Comment.api').toggle_current_linewise()", opts) -keymap("x", "/", 'lua require("Comment.api").toggle_linewise_op(vim.fn.visualmode())', {}) - --- DAP -keymap("n", "db", "lua require'dap'.toggle_breakpoint()", opts) -keymap("n", "dc", "lua require'dap'.continue()", opts) -keymap("n", "di", "lua require'dap'.step_into()", opts) -keymap("n", "do", "lua require'dap'.step_over()", opts) -keymap("n", "dO", "lua require'dap'.step_out()", opts) -keymap("n", "dr", "lua require'dap'.repl.toggle()", opts) -keymap("n", "dl", "lua require'dap'.run_last()", opts) -keymap("n", "du", "lua require'dapui'.toggle()", opts) -keymap("n", "dt", "lua require'dap'.terminate()", opts) +keymap("n", "", "w!!compiler '%:p'") +keymap("n", "", "w!!opout '%:p'") diff --git a/lua/user/whichkey.lua b/lua/user/whichkey.lua index e4402b7..674e6bc 100644 --- a/lua/user/whichkey.lua +++ b/lua/user/whichkey.lua @@ -94,15 +94,16 @@ local vmappings = { local mappings = { [";"] = { "Alpha", "Dashboard" }, ["/"] = { "(comment_toggle_linewise_current)", "Comment toggle current line" }, - ["c"] = { "Bdelete!", "Close Buffer" }, - ["h"] = { "nohlsearch", "No Highlight" }, - ["f"] = { + c = { "Bdelete!", "Close Buffer" }, + h = { "nohlsearch", "No Highlight" }, + f = { "lua require('telescope.builtin').find_files(require('telescope.themes').get_dropdown{previewer = false})", "Find files", }, - ["e"] = { "NvimTreeToggle", "Explorer" }, - ["F"] = { "Telescope live_grep theme=ivy", "Find Text" }, - ["P"] = { "lua require('telescope').extensions.projects.projects()", "Projects" }, + e = { "NvimTreeToggle", "Explorer" }, + F = { "Telescope live_grep theme=ivy", "Find Text" }, + P = { "lua require('telescope').extensions.projects.projects()", "Projects" }, + b = { "Telescope buffers", "Find Buffers" }, B = { name = "Buffers", j = { "BufferLinePick", "Jump" }, @@ -162,7 +163,6 @@ local mappings = { name = "LSP", a = { "lua vim.lsp.buf.code_action()", "Code Action" }, d = { "Telescope diagnostics bufnr=0 theme=get_ivy", "Buffer Diagnostics" }, - w = { "Telescope diagnostics", "Workspace Diagnostics", @@ -186,14 +186,13 @@ local mappings = { "Workspace Symbols", }, e = { "Telescope quickfix", "Telescope Quickfix" }, - R = { name = "Rust", e = { "RustExpandMacro", "Expand macro" }, c = { "RustOpenCargo", "Open cargo.toml" }, p = { "RustParentModule", "Parent module" }, h = { "RustHoverActions", "Hover actions" }, - g = { "RustViewCrateGraph", "View crate graph" }, + g = { "RustViewCrateGraph", "View create graph" }, d = { "RustOpenExternalDocs", "Open external docs" }, }, }, @@ -253,14 +252,12 @@ local mappings = { d = { "lua require('dap').toggle_breakpoint()", "Set breakpoint" }, t = { "lua require('dapui').toggle()", "Toggle DAP-UI" }, c = { "lua require('dap').continue()", "Launch debug sessions and resume execution" }, - o = { "lua require('dap').step_over()", "Step over code" }, i = { "lua require('dap').step_into()", "Step into code" }, + o = { "lua require('dap').step_over()", "Step over code" }, + O = { "lua require('dap').step_out()", "Step out of code" }, r = { "lua require('dap).repl.open()", "Inspect state" }, - }, - b = { - name = "Build/compile/run", - b = { "w!!compiler '%:p'", "Run/compile file" }, - o = { "!opout '%:p'", "Open file" }, + T = { "lua require('dap').terminate()", "Terminate" }, + l = { "lua require('dap').run_last()", "Run last" }, }, }