all repos — dotfiles @ 92186c684acc2e7a4b783dbbb6ce0b684822a60c

my *nix dotfiles

nvim: improved dap; file tree
Anirudh Oppiliappan x@icyphox.sh
Mon, 22 Jan 2024 09:23:52 +0200
commit

92186c684acc2e7a4b783dbbb6ce0b684822a60c

parent

1af1f6acd2ce167d5d5358f5a36c58b368965496

5 files changed, 70 insertions(+), 10 deletions(-)

jump to
M nvim/_init.luanvim/_init.lua

@@ -8,6 +8,7 @@ require 'completion'

require 'maps' require 'statusline.line' require 'treesitter' +require 'tree' require 'fzy/fzy' -- lsp setup
M nvim/lua/dapx.luanvim/lua/dapx.lua

@@ -1,4 +1,5 @@

local dap = require 'dap' +local dapui = require 'dapui' dap.set_log_level('INFO')

@@ -31,7 +32,7 @@ },

}, } -require 'dapui'.setup({ +dapui.setup { controls = { element = "repl", enabled = true,

@@ -47,6 +48,7 @@ step_over = "→",

terminate = "✗" } }, + expand_lines = false, icons = { expanded = "▾", collapsed = "▸" }, mappings = { open = "o",

@@ -59,17 +61,17 @@ layouts = {

{ elements = { "scopes", + "repl", }, - size = 0.2, - position = "left" + size = 0.3, + position = "bottom" }, { elements = { - "repl", "breakpoints" }, - size = 0.3, - position = "bottom", + size = 0.1, + position = "left", }, }, floating = {

@@ -84,7 +86,20 @@ windows = { indent = 1 },

render = { max_type_length = nil, }, -}) +} + +dap.listeners.before.attach.dapui_config = function() + dapui.open() +end +dap.listeners.before.launch.dapui_config = function() + dapui.open() +end +--dap.listeners.before.event_terminated.dapui_config = function() +-- dapui.close() +--end +dap.listeners.before.event_exited.dapui_config = function() + dapui.close() +end vim.fn.sign_define('DapBreakpoint', {text = '•'})
M nvim/lua/maps.luanvim/lua/maps.lua

@@ -1,6 +1,7 @@

local cmd = vim.cmd local map = vim.keymap.set local dap = require 'dap' +local treeapi = require 'nvim-tree.api' local u = require 'utils' local M = {}

@@ -114,7 +115,7 @@ -- dap

-- Start debugging session map("n", "<leader>ds", function() dap.continue() - require 'dapui'.toggle() + require 'dapui'.open() vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<C-w>=", false, true, true), "n", false) -- Spaces buffers evenly end)

@@ -130,10 +131,18 @@

-- Close debugger and clear breakpoints map("n", "<leader>de", function() dap.clear_breakpoints() - require 'dapui'.toggle() + require 'dapui'.close() dap.terminate() vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<C-w>=", false, true, true), "n", false) end) + +local function toggle_tree() + treeapi.tree.toggle({ find_file = true }) +end + +-- nvim-tree +map('n', '<leader>tt', toggle_tree) +map('n', '<leader>tf', treeapi.tree.focus) return M
A nvim/lua/tree.lua

@@ -0,0 +1,35 @@

+-- disable netrw at the very start of your init.lua +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 + +-- empty setup using defaults +require('nvim-tree').setup{ + sort = { + sorter = 'case_sensitive', + }, + renderer = { + icons = { + show = { + file = false, + folder = false, + folder_arrow = false, + git = true, + modified = true, + diagnostics = true, + bookmarks = false, + }, + glyphs = { + symlink = "L", + git = { + unstaged = "M", + staged = "A", + unmerged = "", + renamed = "→", + untracked = "?", + deleted = "D", + ignored = "", + }, + }, + }, + }, +}
M programs/neovim.nixprograms/neovim.nix

@@ -53,8 +53,8 @@ vim-gitgutter

vim-rsi nvim-treesitter-textobjects conflict-marker-vim - vim-jsonnet vim-pencil + nvim-tree-lua nvim-dap nvim-dap-ui