local astro = require "astrocore" return { { "AstroNvim/astrocore", ---@type AstroCoreOpts opts = { mappings = { n = { --essentials ["d"] = { "_d" }, [""] = { "" }, [""] = { "" }, ["G"] = { "Gzz" }, [""] = { "ggVG", desc = "select all" }, ["W"] = { "w", desc = "Save" }, [""] = { "ciw", desc = "replace word" }, [""] = { "cc", desc = "replace line" }, [""] = { "viw", desc = "select word" }, [""] = { "viwy", desc = "copy word" }, [""] = { "viwpgvy", desc = "replace word by copied word" }, [""] = { require("dial.map").inc_normal(), desc = "dial increment" }, [""] = { ":m .+1==" }, [""] = { ":m .-2==" }, [""] = { "op" }, [""] = { "0v$y", desc = "copy entire row" }, [""] = { "tabNext", desc = "move to next Tab" }, [""] = { "tabprevious", desc = "move to previous Tab" }, [""] = { "cnext", desc = "next quickfix" }, ["fl"] = { function() require('helpers').oldfiles({}) end, desc = "find oldfiles" }, --git ["gy"] = { "DiffviewFileHistory %", desc = "Git file diff history" }, ["gY"] = { "DiffviewFileHistory", desc = "Git diff history" }, --tabs [""] = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" }, [""] = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" }, ["bt"] = { "tabclose", desc = "Close tab" }, --window moviment [""] = { "h", desc = "Go to left window" }, [""] = { "l", desc = "Go to right window" }, [""] = { "j", desc = "Go to lower window" }, [""] = { "k", desc = "Go to upper window" }, -- split window ["|"] = { "v", desc = "Vertical Split" }, ["\\"] = { "s", desc = "Horizontal Split" }, --terminals get or create -- [""] = { "ToggleTerm" }, [""] = { function() require("helpers").toggle_term() end, desc = "Toggle Terminal" }, [""] = { function() require("helpers").select_terminal() end, desc = "List All opened terminals" }, [""] = { function() require("helpers").term_horizontal() end, desc = "Horizontal Terminal", }, [""] = { function() require("helpers").term_vertical() end, desc = "Vertical Terminal", }, [""] = { function() require("helpers").term_float() end, desc = "Float Terminal", }, --buffers ["b"] = { name = "Buffers" }, ["bn"] = { "tabnew", desc = "New tab" }, -- navigate buffer tabs with `H` and `L` L = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" }, H = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" }, ["bD"] = { function() require("astroui.status.heirline").buffer_picker( function(bufnr) require("astrocore.buffer").close(bufnr) end ) end, desc = "Pick to close", }, --user extra commands ["kd"] = {desc =" Database commands"}, ["kdu"] = {"DBUIToggle",desc ="Toggle ui"}, ["kda"] = {"DBUIAddConnection",desc ="Add connection"}, ["k"] = { desc = " User extra commands" }, ["kr"] = { "lua require('helpers').openMDfile()", desc = "Open md file in glow" }, ["km"] = { "lua require('helpers').openMDfile(\"com.github.marktext.marktext\")", desc = "Open md file in MarkText", }, ["kj"] = { "set ft=htmldjango", desc = "set ft=htmldjango" }, ["kh"] = { "set ft=html", desc = "set ft=html" }, ["kt"] = { "set ft=templ", desc = "set ft=templ" }, ["ke"] = {"redir! > error_messages | silent messages | redir END | edit!", desc = "Create error_messages file with vim messages"}, --terminal compile sass to css ["ts"] = { function() require("helpers").compile_sass() end, desc = "compile sass to css.", }, --python test ["T"] = { desc = "󰌠 Tests" }, ["Tr"] = { "lua require('neotest').run.run()", desc = "Run test" }, ["Tf"] = { "lua require('neotest').run.run(vim.fn.expand('%'))", desc = "Run test expand" }, ["Td"] = { "lua require('neotest').run.run({strategy = 'dap'})", desc = "Run test dap" }, ["Ts"] = { "lua require('neotest').summary.toggle()", desc = "Toggle test summary" }, ["Tp"] = { "lua require('neotest').output_panel.toggle()", desc = "Toggle output panel" }, --trouble ["xx"] = { function() require("trouble").toggle() end, desc = "Trouble toggle" }, ["xw"] = { function() require("trouble").toggle "workspace_diagnostics" end, desc = "Trouble Workspace", }, ["xd"] = { function() require("trouble").toggle "document_diagnostics" end, desc = "Trouble Document", }, ["xq"] = { function() require("trouble").toggle "quickfix" end, desc = "Trouble Quickfix" }, ["xl"] = { function() require("trouble").toggle "loclist" end, desc = "Trouble Location" }, ["gR"] = { function() require("trouble").toggle "lsp_references" end, desc = "Trouble LSP References" }, }, t = { [""] = { "ToggleTerm" }, }, v = { [""] = { "ciw", desc = "select word" }, ["<"] = { ""] = { ">gv" }, ["p"] = { "pgvy" }, ["d"] = { "_d" }, }, x = { [""] = { ":m '>+1gv-gv" }, [""] = { ":m '<-2gv-gv" }, }, }, }, }, }