style: reformat lua

nix run sys#luaformatter -- home/nvim/init.lua -i
This commit is contained in:
Marvin Drescher 2023-12-19 11:29:47 +01:00
parent 8230b440c5
commit ade5e39f48

View File

@ -1,8 +1,6 @@
vim.opt.termguicolors = true vim.opt.termguicolors = true
vim.notify = require("notify") vim.notify = require("notify")
vim.notify.setup({ vim.notify.setup({background_colour = "#000000"})
background_colour = "#000000"
})
local distant = require('distant') local distant = require('distant')
distant:setup() distant:setup()
require("oil").setup() require("oil").setup()
@ -25,11 +23,9 @@ require("telescope").setup({
undo = { undo = {
side_by_side = true, side_by_side = true,
layout_strategy = "vertical", layout_strategy = "vertical",
layout_config = { layout_config = {preview_height = 0.8}
preview_height = 0.8, }
}, }
},
},
}) })
require('telescope').load_extension("undo") require('telescope').load_extension("undo")
local neogit = require('neogit') local neogit = require('neogit')
@ -42,76 +38,69 @@ neogit.setup({
["github.com"] = "https://github.com/${owner}/${repository}/compare/${branch_name}?expand=1", ["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", ["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}", ["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}", ["apps.terminal"] = "http://apps.terminal/${owner}/${repository}/merge_requests/new?merge_request[source_branch]=${branch_name}"
}, }
}) })
local dap, dapui = require("dap"), require("dapui") local dap, dapui = require("dap"), require("dapui")
dap.adapters.lldb = { dap.adapters.lldb = {
type = "executable", type = "executable",
command = lldb_path .. "/bin/lldb-vscode", command = lldb_path .. "/bin/lldb-vscode",
name = "lldb", name = "lldb"
} }
local lldb = { local lldb = {
name = "Launch lldb", name = "Launch lldb",
type = "lldb", -- matches the adapter type = "lldb", -- matches the adapter
request = "launch", -- could also attach to a currently running process request = "launch", -- could also attach to a currently running process
program = function() program = function()
return vim.fn.input( return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/",
"Path to executable: ", "file")
vim.fn.getcwd() .. "/",
"file"
)
end, end,
cwd = "$${workspaceFolder}", cwd = "$${workspaceFolder}",
stopOnEntry = false, stopOnEntry = false,
args = {}, args = {},
console = internalConsole, console = internalConsole,
runInTerminal = true, runInTerminal = true
} }
dap.configurations.rust = { dap.configurations.rust = {
lldb -- different debuggers or more configurations can be used here lldb -- different debuggers or more configurations can be used here
} }
--[[ local opts = { --[[ local opts = {
dap = { dap = {
adapter = require("rust-tools.dap").get_codelldb_adapter("${pkgs.lldb}/bin/lldb-vscode", "${pkgs.lldb.lib}/lib/liblldb.so"), adapter = require("rust-tools.dap").get_codelldb_adapter("${pkgs.lldb}/bin/lldb-vscode", "${pkgs.lldb.lib}/lib/liblldb.so"),
}, },
} }
require("rust-tools").setup { opts } ]] require("rust-tools").setup { opts } ]]
local dap_breakpoint = { local dap_breakpoint = {
error = { error = {
text = "🟥", text = "🟥",
texthl = "LspDiagnosticsSignError", texthl = "LspDiagnosticsSignError",
linehl = "", linehl = "",
numhl = "", numhl = ""
}, },
rejected = { rejected = {
text = "", text = "",
texthl = "LspDiagnosticsSignHint", texthl = "LspDiagnosticsSignHint",
linehl = "", linehl = "",
numhl = "", numhl = ""
}, },
stopped = { stopped = {
text = "⭐️", text = "⭐️",
texthl = "LspDiagnosticsSignInformation", texthl = "LspDiagnosticsSignInformation",
linehl = "DiagnosticUnderlineInfo", linehl = "DiagnosticUnderlineInfo",
numhl = "LspDiagnosticsSignInformation", numhl = "LspDiagnosticsSignInformation"
},
} }
}
vim.fn.sign_define("DapBreakpoint", dap_breakpoint.error) vim.fn.sign_define("DapBreakpoint", dap_breakpoint.error)
vim.fn.sign_define("DapStopped", dap_breakpoint.stopped) vim.fn.sign_define("DapStopped", dap_breakpoint.stopped)
vim.fn.sign_define("DapBreakpointRejected", dap_breakpoint.rejected) vim.fn.sign_define("DapBreakpointRejected", dap_breakpoint.rejected)
dapui.setup() dapui.setup()
-- Auto open and close dapUI -- Auto open and close dapUI
dap.listeners.after.event_initialized["dapui_config"] = function() dap.listeners.after.event_initialized["dapui_config"] =
dapui.open() function() dapui.open() end
end dap.listeners.before.event_terminated["dapui_config"] =
dap.listeners.before.event_terminated["dapui_config"] = function() function() dapui.close() end
dapui.close() dap.listeners.before.event_exited["dapui_config"] = function() dapui.close() end
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close()
end