diff --git a/init.lua b/init.lua index 897c460..4fbafb0 100644 --- a/init.lua +++ b/init.lua @@ -1,8 +1,6 @@ vim.opt.termguicolors = true vim.notify = require("notify") -vim.notify.setup({ - background_colour = "#000000" -}) +vim.notify.setup({background_colour = "#000000"}) local distant = require('distant') distant:setup() require("oil").setup() @@ -12,24 +10,22 @@ vim.keymap.set('n', 'fg', telescope.live_grep, {}) vim.keymap.set('n', 'fb', telescope.buffers, {}) vim.keymap.set('n', 'fh', telescope.help_tags, {}) require("telescope").setup({ - defaults = { - mappings = { - i = { - [""] = function(bufnr) - require("telescope.actions.set").edit(bufnr, "tab drop") - end - } - } - }, - extensions = { - undo = { - side_by_side = true, - layout_strategy = "vertical", - layout_config = { - preview_height = 0.8, - }, - }, + defaults = { + mappings = { + i = { + [""] = function(bufnr) + require("telescope.actions.set").edit(bufnr, "tab drop") + end + } + } }, + extensions = { + undo = { + side_by_side = true, + layout_strategy = "vertical", + layout_config = {preview_height = 0.8} + } + } }) require('telescope').load_extension("undo") local neogit = require('neogit') @@ -38,80 +34,73 @@ local neogit = require('neogit') -- git neo -> Neogit vim.keymap.set('n', 'gN', neogit.open, {}) neogit.setup({ - git_services = { - ["github.com"] = "https://github.com/${owner}/${repository}/compare/${branch_name}?expand=1", - ["bitbucket.org"] = "https://bitbucket.org/${owner}/${repository}/pull-requests/new?source=${branch_name}&t=1", - ["gitlab.com"] = "https://gitlab.com/${owner}/${repository}/merge_requests/new?merge_request[source_branch]=${branch_name}", - ["apps.terminal"] = "http://apps.terminal/${owner}/${repository}/merge_requests/new?merge_request[source_branch]=${branch_name}", - }, + git_services = { + ["github.com"] = "https://github.com/${owner}/${repository}/compare/${branch_name}?expand=1", + ["bitbucket.org"] = "https://bitbucket.org/${owner}/${repository}/pull-requests/new?source=${branch_name}&t=1", + ["gitlab.com"] = "https://gitlab.com/${owner}/${repository}/merge_requests/new?merge_request[source_branch]=${branch_name}", + ["apps.terminal"] = "http://apps.terminal/${owner}/${repository}/merge_requests/new?merge_request[source_branch]=${branch_name}" + } }) local dap, dapui = require("dap"), require("dapui") dap.adapters.lldb = { - type = "executable", - command = lldb_path .. "/bin/lldb-vscode", - name = "lldb", + type = "executable", + command = lldb_path .. "/bin/lldb-vscode", + name = "lldb" } local lldb = { - name = "Launch lldb", - type = "lldb", -- matches the adapter - request = "launch", -- could also attach to a currently running process - program = function() - return vim.fn.input( - "Path to executable: ", - vim.fn.getcwd() .. "/", - "file" - ) - end, - cwd = "$${workspaceFolder}", - stopOnEntry = false, - args = {}, - console = internalConsole, - runInTerminal = true, - } + name = "Launch lldb", + type = "lldb", -- matches the adapter + request = "launch", -- could also attach to a currently running process + program = function() + return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", + "file") + end, + cwd = "$${workspaceFolder}", + stopOnEntry = false, + args = {}, + console = internalConsole, + runInTerminal = true +} - dap.configurations.rust = { - lldb -- different debuggers or more configurations can be used here - } - --[[ local opts = { +dap.configurations.rust = { + lldb -- different debuggers or more configurations can be used here +} +--[[ local opts = { dap = { adapter = require("rust-tools.dap").get_codelldb_adapter("${pkgs.lldb}/bin/lldb-vscode", "${pkgs.lldb.lib}/lib/liblldb.so"), }, } require("rust-tools").setup { opts } ]] - local dap_breakpoint = { - error = { - text = "🟥", - texthl = "LspDiagnosticsSignError", - linehl = "", - numhl = "", - }, - rejected = { - text = "", - texthl = "LspDiagnosticsSignHint", - linehl = "", - numhl = "", - }, - stopped = { - text = "⭐️", - texthl = "LspDiagnosticsSignInformation", - linehl = "DiagnosticUnderlineInfo", - numhl = "LspDiagnosticsSignInformation", - }, - } +local dap_breakpoint = { + error = { + text = "🟥", + texthl = "LspDiagnosticsSignError", + linehl = "", + numhl = "" + }, + rejected = { + text = "", + texthl = "LspDiagnosticsSignHint", + linehl = "", + numhl = "" + }, + stopped = { + text = "⭐️", + texthl = "LspDiagnosticsSignInformation", + linehl = "DiagnosticUnderlineInfo", + numhl = "LspDiagnosticsSignInformation" + } +} - vim.fn.sign_define("DapBreakpoint", dap_breakpoint.error) - vim.fn.sign_define("DapStopped", dap_breakpoint.stopped) - vim.fn.sign_define("DapBreakpointRejected", dap_breakpoint.rejected) +vim.fn.sign_define("DapBreakpoint", dap_breakpoint.error) +vim.fn.sign_define("DapStopped", dap_breakpoint.stopped) +vim.fn.sign_define("DapBreakpointRejected", dap_breakpoint.rejected) - dapui.setup() +dapui.setup() - -- Auto open and close dapUI - dap.listeners.after.event_initialized["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 +-- Auto open and close dapUI +dap.listeners.after.event_initialized["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