style: reformat lua
nix run sys#luaformatter -- home/nvim/init.lua -i
This commit is contained in:
parent
8230b440c5
commit
ade5e39f48
155
init.lua
155
init.lua
@ -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()
|
||||||
@ -12,24 +10,22 @@ vim.keymap.set('n', '<leader>fg', telescope.live_grep, {})
|
|||||||
vim.keymap.set('n', '<leader>fb', telescope.buffers, {})
|
vim.keymap.set('n', '<leader>fb', telescope.buffers, {})
|
||||||
vim.keymap.set('n', '<leader>fh', telescope.help_tags, {})
|
vim.keymap.set('n', '<leader>fh', telescope.help_tags, {})
|
||||||
require("telescope").setup({
|
require("telescope").setup({
|
||||||
defaults = {
|
defaults = {
|
||||||
mappings = {
|
mappings = {
|
||||||
i = {
|
i = {
|
||||||
["<cr>"] = function(bufnr)
|
["<cr>"] = function(bufnr)
|
||||||
require("telescope.actions.set").edit(bufnr, "tab drop")
|
require("telescope.actions.set").edit(bufnr, "tab drop")
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
extensions = {
|
|
||||||
undo = {
|
|
||||||
side_by_side = true,
|
|
||||||
layout_strategy = "vertical",
|
|
||||||
layout_config = {
|
|
||||||
preview_height = 0.8,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
extensions = {
|
||||||
|
undo = {
|
||||||
|
side_by_side = true,
|
||||||
|
layout_strategy = "vertical",
|
||||||
|
layout_config = {preview_height = 0.8}
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
require('telescope').load_extension("undo")
|
require('telescope').load_extension("undo")
|
||||||
local neogit = require('neogit')
|
local neogit = require('neogit')
|
||||||
@ -38,80 +34,73 @@ local neogit = require('neogit')
|
|||||||
-- git neo -> Neogit
|
-- git neo -> Neogit
|
||||||
vim.keymap.set('n', '<leader>gN', neogit.open, {})
|
vim.keymap.set('n', '<leader>gN', neogit.open, {})
|
||||||
neogit.setup({
|
neogit.setup({
|
||||||
git_services = {
|
git_services = {
|
||||||
["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() .. "/",
|
end,
|
||||||
"file"
|
cwd = "$${workspaceFolder}",
|
||||||
)
|
stopOnEntry = false,
|
||||||
end,
|
args = {},
|
||||||
cwd = "$${workspaceFolder}",
|
console = internalConsole,
|
||||||
stopOnEntry = false,
|
runInTerminal = true
|
||||||
args = {},
|
}
|
||||||
console = internalConsole,
|
|
||||||
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
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user