aboutsummaryrefslogtreecommitdiffstats
path: root/lua/plugins/image.lua
diff options
context:
space:
mode:
authorAriel D'Alessandro <ariel.dalessandro@auto1.com>2022-09-26 09:17:39 +0200
committerAriel D'Alessandro <ariel.dalessandro@auto1.com>2022-09-26 09:18:14 +0200
commitb2ea5bb4976ad786a104d5539d47645ddef237a9 (patch)
tree63ced30c20f1ca65c23a009d316e5d5cbfdef3c4 /lua/plugins/image.lua
parent4457e657255ba071497b30356676a42f6f184cdf (diff)
downloadnvim-conf-b2ea5bb4976ad786a104d5539d47645ddef237a9.tar.gz
nvim-conf-b2ea5bb4976ad786a104d5539d47645ddef237a9.zip
Add gateway graphql queries search
Diffstat (limited to 'lua/plugins/image.lua')
0 files changed, 0 insertions, 0 deletions
#n107'>107 108
local dap, dapui, hydra = require "dap", require "dapui", require "hydra"

dap.set_log_level('TRACE')

-- Setup Virtual Text
require("nvim-dap-virtual-text").setup {}

for _, ft_path in ipairs(vim.api.nvim_get_runtime_file("lua/pi/dap/configs/*.lua", true)) do
  loadfile(ft_path)()
end

-- Signs
vim.fn.sign_define("DapBreakpoint", { text = " ", texthl = "", linehl = "", numhl = "" })
vim.fn.sign_define("DapStopped", { text = " ", texthl = "", linehl = "", numhl = "" })
vim.fn.sign_define("DapBreakpointRejected", { text = " ", texthl = "", linehl = "", numhl = "" })
vim.fn.sign_define("DapBreakpointCondition", { text = " ", texthl = "", linehl = "", numhl = "" })
vim.fn.sign_define("DapLogPoint", { text = "󰍢 ", texthl = "", linehl = "", numhl = "" })

-- UI structure
dapui.setup  {
  icons = { expanded = "▾", collapsed = "▸" },
  layouts = {
    {
      elements = {
        "scopes",
        "breakpoints",
        "stacks",
        "watches",
      },
      size = 50,
      position = "right",
    },
    {
      elements = {
        "repl",
        "console",
      },
      size = 7,
      position = "bottom",
    },
  },
}

-- Events Listeners
dap.listeners.after.event_initialized["dapui_config"] = function()
  dapui.open {}
end

local hint = [[
 Nvim DAP
 _d_: Start/Continue  _j_: StepOver _k_: StepOut _l_: StepInto ^
 _bp_: Toogle Breakpoint  _bc_: Conditional Breakpoint ^
 _?_: log point ^
 _c_: Run To Cursor ^
 _h_: Show information of the variable under the cursor ^
 _x_: Stop Debbuging ^
 ^^                                                      _<Esc>_
]]

hydra {
  name = "dap",
  hint = hint,
  mode = "n",
  config = {
    color = "blue",
    invoke_on_body = true,
    hint = {
      border = "rounded",
      position = "bottom",
    },
  },
  body = "<leader>d",
  heads = {
    { "d", dap.continue },
    { "bp", dap.toggle_breakpoint },
    { "l", dap.step_into },
    { "j", dap.step_over },
    { "k", dap.step_out },
    { "h", dapui.eval },
    { "c", dap.run_to_cursor },
    {
      "bc",
      function()
        vim.ui.input({ prompt = "Condition: " }, function(condition)
          dap.set_breakpoint(condition)
        end)
      end,
    },
    {
      "?",
      function()
        vim.ui.input({ prompt = "Log: " }, function(log)
          dap.set_breakpoint(nil, nil, log)
        end)
      end,
    },
    {
      "x",
      function()
        dap.terminate()
        dapui.close {}
        dap.clear_breakpoints()
      end,
    },

    { "<Esc>", nil, { exit = true } },
  },
}