mirror of
https://git.aramjonghu.dev/AramJonghu/nvim.git
synced 2026-09-05 17:23:29 +02:00
Compare commits
24
Commits
0dc34abcc0
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c8c3c148b0
|
||
|
|
9afc95e2bb
|
||
|
|
64c18ec04a
|
||
|
|
bf54fa8fc6 | ||
|
|
0df1c17c1f | ||
|
|
4f3a605b77 | ||
|
|
3645312fb3 | ||
|
|
4d507d2106 | ||
|
|
2c7d6acc04 | ||
|
|
3b4a464a94 | ||
|
|
ef9bd00a8b | ||
|
|
5fa8bfe7af | ||
|
|
00fc6d9176 | ||
|
|
c3d31c1562 | ||
|
|
2501b3de67 | ||
|
|
567d5a36e4 | ||
|
|
45b768ae61 | ||
|
|
10135350a0 | ||
|
|
c4d7538d12 | ||
|
|
6fb33b02cd | ||
|
|
907b234eb7 | ||
|
|
cc9bea0a0d | ||
|
|
e9ef282297 | ||
|
|
c3a45bee52 |
+2
-1
@@ -1,6 +1,7 @@
|
||||
column_width = 120
|
||||
column_width = 80
|
||||
line_endings = "Unix"
|
||||
indent_type = "Spaces"
|
||||
indent_width = 4
|
||||
quote_style = "AutoPreferDouble"
|
||||
call_parentheses = "None"
|
||||
collapse_simple_statement = "Always"
|
||||
|
||||
@@ -6,4 +6,4 @@ require "autocmd"
|
||||
vim.cmd "source ~/.config/nvim/suda.vim"
|
||||
-- local time = tonumber(os.date "%H")
|
||||
|
||||
vim.cmd [[colorscheme catppuccin-mocha]]
|
||||
vim.cmd [[colorscheme catppuccin-nvim]]
|
||||
|
||||
+6
-4
@@ -6,12 +6,14 @@ local neoformat_group = augroup("NeoformatOnSave", { clear = true })
|
||||
autocmd("BufWritePost", {
|
||||
group = neoformat_group,
|
||||
callback = function()
|
||||
if vim.bo.buftype ~= "" or vim.bo.modifiable == false or vim.bo.readonly then
|
||||
return
|
||||
end
|
||||
if vim.fn.exists ":Neoformat" ~= 2 then
|
||||
if
|
||||
vim.bo.buftype ~= ""
|
||||
or vim.bo.modifiable == false
|
||||
or vim.bo.readonly
|
||||
then
|
||||
return
|
||||
end
|
||||
if vim.fn.exists ":Neoformat" ~= 2 then return end
|
||||
vim.cmd "silent! Neoformat"
|
||||
end,
|
||||
})
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
require("bufferline").setup {
|
||||
options = {
|
||||
diagnostics = "coc",
|
||||
diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
||||
diagnostics_indicator = function(
|
||||
count,
|
||||
level,
|
||||
diagnostics_dict,
|
||||
context
|
||||
)
|
||||
local s = " "
|
||||
for e, n in pairs(diagnostics_dict) do
|
||||
local sym = e == "error" and " " or (e == "warning" and " " or " ")
|
||||
local sym = e == "error" and " "
|
||||
or (e == "warning" and " " or " ")
|
||||
s = s .. n .. sym
|
||||
end
|
||||
return s
|
||||
@@ -16,9 +22,7 @@ require("bufferline").setup {
|
||||
},
|
||||
vim.api.nvim_create_autocmd({ "BufAdd", "BufDelete" }, {
|
||||
callback = function()
|
||||
vim.schedule(function()
|
||||
pcall(nvim_bufferline)
|
||||
end)
|
||||
vim.schedule(function() pcall(nvim_bufferline) end)
|
||||
end,
|
||||
}),
|
||||
},
|
||||
|
||||
+7
-5
@@ -3,8 +3,12 @@ local cmp_lsp = require "cmp_nvim_lsp"
|
||||
|
||||
local M = {}
|
||||
|
||||
M.capabilities =
|
||||
vim.tbl_deep_extend("force", {}, vim.lsp.protocol.make_client_capabilities(), cmp_lsp.default_capabilities())
|
||||
M.capabilities = vim.tbl_deep_extend(
|
||||
"force",
|
||||
{},
|
||||
vim.lsp.protocol.make_client_capabilities(),
|
||||
cmp_lsp.default_capabilities()
|
||||
)
|
||||
|
||||
local cmp_kinds = {
|
||||
Text = " ",
|
||||
@@ -47,9 +51,7 @@ cmp.setup {
|
||||
},
|
||||
completion = { completeopt = "menu,menuone" },
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end,
|
||||
expand = function(args) require("luasnip").lsp_expand(args.body) end,
|
||||
},
|
||||
mapping = { -- change later zach is ????
|
||||
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
||||
|
||||
+114
-109
@@ -1,109 +1,114 @@
|
||||
local dap = require "dap"
|
||||
dap.adapters.python = function(cb, config)
|
||||
if config.request == "attach" then
|
||||
---@diagnostic disable-next-line: undefined-field
|
||||
local port = (config.connect or config).port
|
||||
---@diagnostic disable-next-line: undefined-field
|
||||
local host = (config.connect or config).host or "127.0.0.1"
|
||||
cb {
|
||||
type = "server",
|
||||
port = assert(port, "`connect.port` is required for a python `attach` configuration"),
|
||||
host = host,
|
||||
options = { source_filetype = "python" },
|
||||
}
|
||||
else
|
||||
cb {
|
||||
type = "executable",
|
||||
command = "path/to/virtualenvs/debugpy/bin/python",
|
||||
args = { "-m", "debugpy.adapter" },
|
||||
options = { source_filetype = "python" },
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
dap.configurations.python = {
|
||||
{
|
||||
-- The first three options are required by nvim-dap
|
||||
type = "python", -- the type here established the link to the adapter definition: `dap.adapters.python`
|
||||
request = "launch",
|
||||
name = "Launch file",
|
||||
|
||||
-- Options below are for debugpy, see https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings for supported options
|
||||
|
||||
program = "${file}", -- This configuration will launch the current file if used.
|
||||
pythonPath = function()
|
||||
-- debugpy supports launching an application with a different interpreter then the one used to launch debugpy itself.
|
||||
-- The code below looks for a `venv` or `.venv` folder in the current directly and uses the python within.
|
||||
-- You could adapt this - to for example use the `VIRTUAL_ENV` environment variable.
|
||||
local cwd = vim.fn.getcwd()
|
||||
if vim.fn.executable(cwd .. "/venv/bin/python") == 1 then
|
||||
return cwd .. "/venv/bin/python"
|
||||
elseif vim.fn.executable(cwd .. "/.venv/bin/python") == 1 then
|
||||
return cwd .. "/.venv/bin/python"
|
||||
else
|
||||
return "/home/zach/miniconda3/bin/python"
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
dap.adapters.lldb = {
|
||||
type = "executable",
|
||||
command = "/usr/bin/lldb-vscode", -- adjust as needed, must be absolute path
|
||||
name = "lldb",
|
||||
}
|
||||
|
||||
dap.configurations.cpp = {
|
||||
{
|
||||
name = "Launch",
|
||||
type = "lldb",
|
||||
request = "launch",
|
||||
program = function()
|
||||
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
|
||||
end,
|
||||
cwd = "${workspaceFolder}",
|
||||
stopOnEntry = false,
|
||||
args = {},
|
||||
|
||||
-- 💀
|
||||
-- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting:
|
||||
--
|
||||
-- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
|
||||
--
|
||||
-- Otherwise you might get the following error:
|
||||
--
|
||||
-- Error on launch: Failed to attach to the target process
|
||||
--
|
||||
-- But you should be aware of the implications:
|
||||
-- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html
|
||||
-- runInTerminal = false,
|
||||
},
|
||||
}
|
||||
|
||||
dap.adapters["pwa-node"] = {
|
||||
type = "server",
|
||||
host = "localhost",
|
||||
port = "${port}",
|
||||
executable = {
|
||||
command = "node",
|
||||
-- 💀 Make sure to update this path to point to your installation
|
||||
args = {
|
||||
"%HOME/.config/nvim/java-dap/js-debug/src/dapDebugServer.js",
|
||||
"${port}",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
dap.configurations.javascript = {
|
||||
{
|
||||
type = "pwa-node",
|
||||
request = "launch",
|
||||
name = "Launch file",
|
||||
program = "${file}",
|
||||
cwd = "${workspaceFolder}",
|
||||
},
|
||||
}
|
||||
|
||||
dap.configurations.java = {
|
||||
{ type = "java", name = "Debug", request = "launch", program = "${file}" },
|
||||
}
|
||||
-- local dap = require "dap"
|
||||
-- dap.adapters.python = function(cb, config)
|
||||
-- if config.request == "attach" then
|
||||
-- local port = (config.connect or config).port
|
||||
-- local host = (config.connect or config).host or "127.0.0.1"
|
||||
-- cb {
|
||||
-- type = "server",
|
||||
-- port = assert(
|
||||
-- port,
|
||||
-- "`connect.port` is required for a python `attach` configuration"
|
||||
-- ),
|
||||
-- host = host,
|
||||
-- options = { source_filetype = "python" },
|
||||
-- }
|
||||
-- else
|
||||
-- cb {
|
||||
-- type = "executable",
|
||||
-- command = "path/to/virtualenvs/debugpy/bin/python",
|
||||
-- args = { "-m", "debugpy.adapter" },
|
||||
-- options = { source_filetype = "python" },
|
||||
-- }
|
||||
-- end
|
||||
-- end
|
||||
--
|
||||
-- dap.configurations.python = {
|
||||
-- {
|
||||
-- -- The first three options are required by nvim-dap
|
||||
-- type = "python", -- the type here established the link to the adapter definition: `dap.adapters.python`
|
||||
-- request = "launch",
|
||||
-- name = "Launch file",
|
||||
--
|
||||
-- -- Options below are for debugpy, see https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings for supported options
|
||||
--
|
||||
-- program = "${file}", -- This configuration will launch the current file if used.
|
||||
-- pythonPath = function()
|
||||
-- -- debugpy supports launching an application with a different interpreter then the one used to launch debugpy itself.
|
||||
-- -- The code below looks for a `venv` or `.venv` folder in the current directly and uses the python within.
|
||||
-- -- You could adapt this - to for example use the `VIRTUAL_ENV` environment variable.
|
||||
-- local cwd = vim.fn.getcwd()
|
||||
-- if vim.fn.executable(cwd .. "/venv/bin/python") == 1 then
|
||||
-- return cwd .. "/venv/bin/python"
|
||||
-- elseif vim.fn.executable(cwd .. "/.venv/bin/python") == 1 then
|
||||
-- return cwd .. "/.venv/bin/python"
|
||||
-- else
|
||||
-- return "/home/zach/miniconda3/bin/python"
|
||||
-- end
|
||||
-- end,
|
||||
-- },
|
||||
-- }
|
||||
--
|
||||
-- dap.adapters.lldb = {
|
||||
-- type = "executable",
|
||||
-- command = "/usr/bin/lldb-vscode", -- adjust as needed, must be absolute path
|
||||
-- name = "lldb",
|
||||
-- }
|
||||
--
|
||||
-- dap.configurations.cpp = {
|
||||
-- {
|
||||
-- name = "Launch",
|
||||
-- type = "lldb",
|
||||
-- request = "launch",
|
||||
-- program = function()
|
||||
-- return vim.fn.input(
|
||||
-- "Path to executable: ",
|
||||
-- vim.fn.getcwd() .. "/",
|
||||
-- "file"
|
||||
-- )
|
||||
-- end,
|
||||
-- cwd = "${workspaceFolder}",
|
||||
-- stopOnEntry = false,
|
||||
-- args = {},
|
||||
--
|
||||
-- -- 💀
|
||||
-- -- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting:
|
||||
-- --
|
||||
-- -- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
|
||||
-- --
|
||||
-- -- Otherwise you might get the following error:
|
||||
-- --
|
||||
-- -- Error on launch: Failed to attach to the target process
|
||||
-- --
|
||||
-- -- But you should be aware of the implications:
|
||||
-- -- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html
|
||||
-- -- runInTerminal = false,
|
||||
-- },
|
||||
-- }
|
||||
--
|
||||
-- dap.adapters["pwa-node"] = {
|
||||
-- type = "server",
|
||||
-- host = "localhost",
|
||||
-- port = "${port}",
|
||||
-- executable = {
|
||||
-- command = "node",
|
||||
-- -- 💀 Make sure to update this path to point to your installation
|
||||
-- args = {
|
||||
-- "%HOME/.config/nvim/java-dap/js-debug/src/dapDebugServer.js",
|
||||
-- "${port}",
|
||||
-- },
|
||||
-- },
|
||||
-- }
|
||||
--
|
||||
-- dap.configurations.javascript = {
|
||||
-- {
|
||||
-- type = "pwa-node",
|
||||
-- request = "launch",
|
||||
-- name = "Launch file",
|
||||
-- program = "${file}",
|
||||
-- cwd = "${workspaceFolder}",
|
||||
-- },
|
||||
-- }
|
||||
--
|
||||
-- dap.configurations.java = {
|
||||
-- { type = "java", name = "Debug", request = "launch", program = "${file}" },
|
||||
-- }
|
||||
|
||||
@@ -0,0 +1,230 @@
|
||||
-- Lua
|
||||
local actions = require("diffview.actions")
|
||||
|
||||
require("diffview").setup({
|
||||
diff_binaries = false, -- Show diffs for binaries
|
||||
enhanced_diff_hl = false, -- See |diffview-config-enhanced_diff_hl|
|
||||
git_cmd = { "git" }, -- The git executable followed by default args.
|
||||
hg_cmd = { "hg" }, -- The hg executable followed by default args.
|
||||
use_icons = true, -- Requires nvim-web-devicons
|
||||
show_help_hints = true, -- Show hints for how to open the help panel
|
||||
watch_index = true, -- Update views and index buffers when the git index changes.
|
||||
icons = { -- Only applies when use_icons is true.
|
||||
folder_closed = "",
|
||||
folder_open = "",
|
||||
},
|
||||
signs = {
|
||||
fold_closed = "",
|
||||
fold_open = "",
|
||||
done = "✓",
|
||||
},
|
||||
view = {
|
||||
-- Configure the layout and behavior of different types of views.
|
||||
-- Available layouts:
|
||||
-- 'diff1_plain'
|
||||
-- |'diff2_horizontal'
|
||||
-- |'diff2_vertical'
|
||||
-- |'diff3_horizontal'
|
||||
-- |'diff3_vertical'
|
||||
-- |'diff3_mixed'
|
||||
-- |'diff4_mixed'
|
||||
-- For more info, see |diffview-config-view.x.layout|.
|
||||
default = {
|
||||
-- Config for changed files, and staged files in diff views.
|
||||
layout = "diff2_horizontal",
|
||||
disable_diagnostics = false, -- Temporarily disable diagnostics for diff buffers while in the view.
|
||||
winbar_info = false, -- See |diffview-config-view.x.winbar_info|
|
||||
},
|
||||
merge_tool = {
|
||||
-- Config for conflicted files in diff views during a merge or rebase.
|
||||
layout = "diff3_horizontal",
|
||||
disable_diagnostics = true, -- Temporarily disable diagnostics for diff buffers while in the view.
|
||||
winbar_info = true, -- See |diffview-config-view.x.winbar_info|
|
||||
},
|
||||
file_history = {
|
||||
-- Config for changed files in file history views.
|
||||
layout = "diff2_horizontal",
|
||||
disable_diagnostics = false, -- Temporarily disable diagnostics for diff buffers while in the view.
|
||||
winbar_info = false, -- See |diffview-config-view.x.winbar_info|
|
||||
},
|
||||
},
|
||||
file_panel = {
|
||||
listing_style = "tree", -- One of 'list' or 'tree'
|
||||
tree_options = { -- Only applies when listing_style is 'tree'
|
||||
flatten_dirs = true, -- Flatten dirs that only contain one single dir
|
||||
folder_statuses = "only_folded", -- One of 'never', 'only_folded' or 'always'.
|
||||
},
|
||||
win_config = { -- See |diffview-config-win_config|
|
||||
position = "left",
|
||||
width = 35,
|
||||
win_opts = {},
|
||||
},
|
||||
},
|
||||
file_history_panel = {
|
||||
log_options = { -- See |diffview-config-log_options|
|
||||
git = {
|
||||
single_file = {
|
||||
diff_merges = "combined",
|
||||
},
|
||||
multi_file = {
|
||||
diff_merges = "first-parent",
|
||||
},
|
||||
},
|
||||
hg = {
|
||||
single_file = {},
|
||||
multi_file = {},
|
||||
},
|
||||
},
|
||||
win_config = { -- See |diffview-config-win_config|
|
||||
position = "bottom",
|
||||
height = 16,
|
||||
win_opts = {},
|
||||
},
|
||||
},
|
||||
commit_log_panel = {
|
||||
win_config = {}, -- See |diffview-config-win_config|
|
||||
},
|
||||
default_args = { -- Default args prepended to the arg-list for the listed commands
|
||||
DiffviewOpen = {},
|
||||
DiffviewFileHistory = {},
|
||||
},
|
||||
hooks = {}, -- See |diffview-config-hooks|
|
||||
keymaps = {
|
||||
disable_defaults = false, -- Disable the default keymaps
|
||||
view = {
|
||||
-- The `view` bindings are active in the diff buffers, only when the current
|
||||
-- tabpage is a Diffview.
|
||||
{ "n", "<tab>", actions.select_next_entry, { desc = "Open the diff for the next file" } },
|
||||
{ "n", "<s-tab>", actions.select_prev_entry, { desc = "Open the diff for the previous file" } },
|
||||
{ "n", "[F", actions.select_first_entry, { desc = "Open the diff for the first file" } },
|
||||
{ "n", "]F", actions.select_last_entry, { desc = "Open the diff for the last file" } },
|
||||
{ "n", "gf", actions.goto_file_edit, { desc = "Open the file in the previous tabpage" } },
|
||||
{ "n", "<C-w><C-f>", actions.goto_file_split, { desc = "Open the file in a new split" } },
|
||||
{ "n", "<C-w>gf", actions.goto_file_tab, { desc = "Open the file in a new tabpage" } },
|
||||
{ "n", "<leader>e", actions.focus_files, { desc = "Bring focus to the file panel" } },
|
||||
{ "n", "<leader>b", actions.toggle_files, { desc = "Toggle the file panel." } },
|
||||
{ "n", "g<C-x>", actions.cycle_layout, { desc = "Cycle through available layouts." } },
|
||||
{ "n", "[x", actions.prev_conflict, { desc = "In the merge-tool: jump to the previous conflict" } },
|
||||
{ "n", "]x", actions.next_conflict, { desc = "In the merge-tool: jump to the next conflict" } },
|
||||
{ "n", "<leader>co", actions.conflict_choose("ours"), { desc = "Choose the OURS version of a conflict" } },
|
||||
{ "n", "<leader>ct", actions.conflict_choose("theirs"), { desc = "Choose the THEIRS version of a conflict" } },
|
||||
{ "n", "<leader>cb", actions.conflict_choose("base"), { desc = "Choose the BASE version of a conflict" } },
|
||||
{ "n", "<leader>ca", actions.conflict_choose("all"), { desc = "Choose all the versions of a conflict" } },
|
||||
{ "n", "dx", actions.conflict_choose("none"), { desc = "Delete the conflict region" } },
|
||||
{ "n", "<leader>cO", actions.conflict_choose_all("ours"), { desc = "Choose the OURS version of a conflict for the whole file" } },
|
||||
{ "n", "<leader>cT", actions.conflict_choose_all("theirs"), { desc = "Choose the THEIRS version of a conflict for the whole file" } },
|
||||
{ "n", "<leader>cB", actions.conflict_choose_all("base"), { desc = "Choose the BASE version of a conflict for the whole file" } },
|
||||
{ "n", "<leader>cA", actions.conflict_choose_all("all"), { desc = "Choose all the versions of a conflict for the whole file" } },
|
||||
{ "n", "dX", actions.conflict_choose_all("none"), { desc = "Delete the conflict region for the whole file" } },
|
||||
},
|
||||
diff1 = {
|
||||
-- Mappings in single window diff layouts
|
||||
{ "n", "g?", actions.help({ "view", "diff1" }), { desc = "Open the help panel" } },
|
||||
},
|
||||
diff2 = {
|
||||
-- Mappings in 2-way diff layouts
|
||||
{ "n", "g?", actions.help({ "view", "diff2" }), { desc = "Open the help panel" } },
|
||||
},
|
||||
diff3 = {
|
||||
-- Mappings in 3-way diff layouts
|
||||
{ { "n", "x" }, "2do", actions.diffget("ours"), { desc = "Obtain the diff hunk from the OURS version of the file" } },
|
||||
{ { "n", "x" }, "3do", actions.diffget("theirs"), { desc = "Obtain the diff hunk from the THEIRS version of the file" } },
|
||||
{ "n", "g?", actions.help({ "view", "diff3" }), { desc = "Open the help panel" } },
|
||||
},
|
||||
diff4 = {
|
||||
-- Mappings in 4-way diff layouts
|
||||
{ { "n", "x" }, "1do", actions.diffget("base"), { desc = "Obtain the diff hunk from the BASE version of the file" } },
|
||||
{ { "n", "x" }, "2do", actions.diffget("ours"), { desc = "Obtain the diff hunk from the OURS version of the file" } },
|
||||
{ { "n", "x" }, "3do", actions.diffget("theirs"), { desc = "Obtain the diff hunk from the THEIRS version of the file" } },
|
||||
{ "n", "g?", actions.help({ "view", "diff4" }), { desc = "Open the help panel" } },
|
||||
},
|
||||
file_panel = {
|
||||
{ "n", "j", actions.next_entry, { desc = "Bring the cursor to the next file entry" } },
|
||||
{ "n", "<down>", actions.next_entry, { desc = "Bring the cursor to the next file entry" } },
|
||||
{ "n", "k", actions.prev_entry, { desc = "Bring the cursor to the previous file entry" } },
|
||||
{ "n", "<up>", actions.prev_entry, { desc = "Bring the cursor to the previous file entry" } },
|
||||
{ "n", "<cr>", actions.select_entry, { desc = "Open the diff for the selected entry" } },
|
||||
{ "n", "o", actions.select_entry, { desc = "Open the diff for the selected entry" } },
|
||||
{ "n", "l", actions.select_entry, { desc = "Open the diff for the selected entry" } },
|
||||
{ "n", "<2-LeftMouse>", actions.select_entry, { desc = "Open the diff for the selected entry" } },
|
||||
{ "n", "-", actions.toggle_stage_entry, { desc = "Stage / unstage the selected entry" } },
|
||||
{ "n", "s", actions.toggle_stage_entry, { desc = "Stage / unstage the selected entry" } },
|
||||
{ "n", "S", actions.stage_all, { desc = "Stage all entries" } },
|
||||
{ "n", "U", actions.unstage_all, { desc = "Unstage all entries" } },
|
||||
{ "n", "X", actions.restore_entry, { desc = "Restore entry to the state on the left side" } },
|
||||
{ "n", "L", actions.open_commit_log, { desc = "Open the commit log panel" } },
|
||||
{ "n", "zo", actions.open_fold, { desc = "Expand fold" } },
|
||||
{ "n", "h", actions.close_fold, { desc = "Collapse fold" } },
|
||||
{ "n", "zc", actions.close_fold, { desc = "Collapse fold" } },
|
||||
{ "n", "za", actions.toggle_fold, { desc = "Toggle fold" } },
|
||||
{ "n", "zR", actions.open_all_folds, { desc = "Expand all folds" } },
|
||||
{ "n", "zM", actions.close_all_folds, { desc = "Collapse all folds" } },
|
||||
{ "n", "<c-b>", actions.scroll_view(-0.25), { desc = "Scroll the view up" } },
|
||||
{ "n", "<c-f>", actions.scroll_view(0.25), { desc = "Scroll the view down" } },
|
||||
{ "n", "<tab>", actions.select_next_entry, { desc = "Open the diff for the next file" } },
|
||||
{ "n", "<s-tab>", actions.select_prev_entry, { desc = "Open the diff for the previous file" } },
|
||||
{ "n", "[F", actions.select_first_entry, { desc = "Open the diff for the first file" } },
|
||||
{ "n", "]F", actions.select_last_entry, { desc = "Open the diff for the last file" } },
|
||||
{ "n", "gf", actions.goto_file_edit, { desc = "Open the file in the previous tabpage" } },
|
||||
{ "n", "<C-w><C-f>", actions.goto_file_split, { desc = "Open the file in a new split" } },
|
||||
{ "n", "<C-w>gf", actions.goto_file_tab, { desc = "Open the file in a new tabpage" } },
|
||||
{ "n", "i", actions.listing_style, { desc = "Toggle between 'list' and 'tree' views" } },
|
||||
{ "n", "f", actions.toggle_flatten_dirs, { desc = "Flatten empty subdirectories in tree listing style" } },
|
||||
{ "n", "R", actions.refresh_files, { desc = "Update stats and entries in the file list" } },
|
||||
{ "n", "<leader>e", actions.focus_files, { desc = "Bring focus to the file panel" } },
|
||||
{ "n", "<leader>b", actions.toggle_files, { desc = "Toggle the file panel" } },
|
||||
{ "n", "g<C-x>", actions.cycle_layout, { desc = "Cycle available layouts" } },
|
||||
{ "n", "[x", actions.prev_conflict, { desc = "Go to the previous conflict" } },
|
||||
{ "n", "]x", actions.next_conflict, { desc = "Go to the next conflict" } },
|
||||
{ "n", "g?", actions.help("file_panel"), { desc = "Open the help panel" } },
|
||||
{ "n", "<leader>cO", actions.conflict_choose_all("ours"), { desc = "Choose the OURS version of a conflict for the whole file" } },
|
||||
{ "n", "<leader>cT", actions.conflict_choose_all("theirs"), { desc = "Choose the THEIRS version of a conflict for the whole file" } },
|
||||
{ "n", "<leader>cB", actions.conflict_choose_all("base"), { desc = "Choose the BASE version of a conflict for the whole file" } },
|
||||
{ "n", "<leader>cA", actions.conflict_choose_all("all"), { desc = "Choose all the versions of a conflict for the whole file" } },
|
||||
{ "n", "dX", actions.conflict_choose_all("none"), { desc = "Delete the conflict region for the whole file" } },
|
||||
},
|
||||
file_history_panel = {
|
||||
{ "n", "g!", actions.options, { desc = "Open the option panel" } },
|
||||
{ "n", "<C-A-d>", actions.open_in_diffview, { desc = "Open the entry under the cursor in a diffview" } },
|
||||
{ "n", "y", actions.copy_hash, { desc = "Copy the commit hash of the entry under the cursor" } },
|
||||
{ "n", "L", actions.open_commit_log, { desc = "Show commit details" } },
|
||||
{ "n", "X", actions.restore_entry, { desc = "Restore file to the state from the selected entry" } },
|
||||
{ "n", "zo", actions.open_fold, { desc = "Expand fold" } },
|
||||
{ "n", "zc", actions.close_fold, { desc = "Collapse fold" } },
|
||||
{ "n", "h", actions.close_fold, { desc = "Collapse fold" } },
|
||||
{ "n", "za", actions.toggle_fold, { desc = "Toggle fold" } },
|
||||
{ "n", "zR", actions.open_all_folds, { desc = "Expand all folds" } },
|
||||
{ "n", "zM", actions.close_all_folds, { desc = "Collapse all folds" } },
|
||||
{ "n", "j", actions.next_entry, { desc = "Bring the cursor to the next file entry" } },
|
||||
{ "n", "<down>", actions.next_entry, { desc = "Bring the cursor to the next file entry" } },
|
||||
{ "n", "k", actions.prev_entry, { desc = "Bring the cursor to the previous file entry" } },
|
||||
{ "n", "<up>", actions.prev_entry, { desc = "Bring the cursor to the previous file entry" } },
|
||||
{ "n", "<cr>", actions.select_entry, { desc = "Open the diff for the selected entry" } },
|
||||
{ "n", "o", actions.select_entry, { desc = "Open the diff for the selected entry" } },
|
||||
{ "n", "l", actions.select_entry, { desc = "Open the diff for the selected entry" } },
|
||||
{ "n", "<2-LeftMouse>", actions.select_entry, { desc = "Open the diff for the selected entry" } },
|
||||
{ "n", "<c-b>", actions.scroll_view(-0.25), { desc = "Scroll the view up" } },
|
||||
{ "n", "<c-f>", actions.scroll_view(0.25), { desc = "Scroll the view down" } },
|
||||
{ "n", "<tab>", actions.select_next_entry, { desc = "Open the diff for the next file" } },
|
||||
{ "n", "<s-tab>", actions.select_prev_entry, { desc = "Open the diff for the previous file" } },
|
||||
{ "n", "[F", actions.select_first_entry, { desc = "Open the diff for the first file" } },
|
||||
{ "n", "]F", actions.select_last_entry, { desc = "Open the diff for the last file" } },
|
||||
{ "n", "gf", actions.goto_file_edit, { desc = "Open the file in the previous tabpage" } },
|
||||
{ "n", "<C-w><C-f>", actions.goto_file_split, { desc = "Open the file in a new split" } },
|
||||
{ "n", "<C-w>gf", actions.goto_file_tab, { desc = "Open the file in a new tabpage" } },
|
||||
{ "n", "<leader>e", actions.focus_files, { desc = "Bring focus to the file panel" } },
|
||||
{ "n", "<leader>b", actions.toggle_files, { desc = "Toggle the file panel" } },
|
||||
{ "n", "g<C-x>", actions.cycle_layout, { desc = "Cycle available layouts" } },
|
||||
{ "n", "g?", actions.help("file_history_panel"), { desc = "Open the help panel" } },
|
||||
},
|
||||
option_panel = {
|
||||
{ "n", "<tab>", actions.select_entry, { desc = "Change the current option" } },
|
||||
{ "n", "q", actions.close, { desc = "Close the panel" } },
|
||||
{ "n", "g?", actions.help("option_panel"), { desc = "Open the help panel" } },
|
||||
},
|
||||
help_panel = {
|
||||
{ "n", "q", actions.close, { desc = "Close help menu" } },
|
||||
{ "n", "<esc>", actions.close, { desc = "Close help menu" } },
|
||||
},
|
||||
},
|
||||
})
|
||||
+32
-2
@@ -1,4 +1,34 @@
|
||||
local function on_attach(bufnr)
|
||||
local gs = require "gitsigns"
|
||||
|
||||
local function map(mode, lhs, rhs, desc)
|
||||
vim.keymap.set(mode, lhs, rhs, { buffer = bufnr, desc = desc })
|
||||
end
|
||||
|
||||
map("n", "]g", function()
|
||||
if vim.wo.diff then return "]g" end
|
||||
vim.schedule(function() gs.next_hunk() end)
|
||||
return "<Ignore>"
|
||||
end, "Next hunk")
|
||||
|
||||
map("n", "[g", function()
|
||||
if vim.wo.diff then return "[g" end
|
||||
vim.schedule(function() gs.prev_hunk() end)
|
||||
return "<Ignore>"
|
||||
end, "Prev hunk")
|
||||
|
||||
map("n", "<leader>hs", gs.stage_hunk, "Stage hunk")
|
||||
map("n", "<leader>hr", gs.reset_hunk, "Reset hunk")
|
||||
map("n", "<leader>hp", gs.preview_hunk, "Preview hunk")
|
||||
map("n", "<leader>hb", gs.blame_line, "Blame line")
|
||||
map("n", "<leader>hd", gs.diffthis, "Diff this")
|
||||
map("n", "<leader>hD", function() gs.diffthis "~" end, "Diff against ~")
|
||||
map("n", "<leader>htb", gs.toggle_current_line_blame, "Toggle line blame")
|
||||
map("n", "<leader>htd", gs.toggle_deleted, "Toggle deleted")
|
||||
end
|
||||
|
||||
require("gitsigns").setup {
|
||||
on_attach = on_attach,
|
||||
signs = {
|
||||
add = { text = "┃" },
|
||||
change = { text = "┃" },
|
||||
@@ -25,11 +55,11 @@ require("gitsigns").setup {
|
||||
},
|
||||
auto_attach = true,
|
||||
attach_to_untracked = false,
|
||||
current_line_blame = false,
|
||||
current_line_blame = true,
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = "eol",
|
||||
delay = 1000,
|
||||
delay = 500,
|
||||
ignore_whitespace = false,
|
||||
virt_text_priority = 100,
|
||||
use_focus = true,
|
||||
|
||||
@@ -8,8 +8,6 @@ local highlight = {
|
||||
"RainbowCyan",
|
||||
}
|
||||
local hooks = require "ibl.hooks"
|
||||
-- create the highlight groups in the highlight setup hook, so they are reset
|
||||
-- every time the colorscheme changes
|
||||
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
|
||||
vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
|
||||
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
|
||||
@@ -21,6 +19,12 @@ hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
|
||||
end)
|
||||
|
||||
vim.g.rainbow_delimiters = { highlight = highlight }
|
||||
require("ibl").setup { indent = { char = "▏" }, scope = { highlight = highlight } }
|
||||
require("ibl").setup {
|
||||
indent = { char = "▏" },
|
||||
scope = { highlight = highlight },
|
||||
}
|
||||
|
||||
hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)
|
||||
hooks.register(
|
||||
hooks.type.SCOPE_HIGHLIGHT,
|
||||
hooks.builtin.scope_highlight_from_extmark
|
||||
)
|
||||
|
||||
@@ -0,0 +1,154 @@
|
||||
vim.lsp.config("vtsls", {
|
||||
settings = {
|
||||
typescript = {
|
||||
inlayHints = {
|
||||
parameterNames = { enabled = "all" },
|
||||
parameterTypes = { enabled = true },
|
||||
variableTypes = { enabled = true },
|
||||
propertyDeclarationTypes = { enabled = true },
|
||||
functionLikeReturnTypes = { enabled = true },
|
||||
enumMemberValues = { enabled = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.lsp.config("tsgo", {
|
||||
settings = {
|
||||
typescript = {
|
||||
inlayHints = {
|
||||
parameterNames = { enabled = "all" },
|
||||
parameterTypes = { enabled = true },
|
||||
variableTypes = { enabled = true },
|
||||
propertyDeclarationTypes = { enabled = true },
|
||||
functionLikeReturnTypes = { enabled = true },
|
||||
enumMemberValues = { enabled = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.lsp.config("denols", {
|
||||
settings = {
|
||||
deno = {
|
||||
inlayHints = {
|
||||
parameterNames = {
|
||||
enabled = "all", -- "none" | "literals" | "all"
|
||||
suppressWhenArgumentMatchesName = true,
|
||||
},
|
||||
parameterTypes = { enabled = true },
|
||||
variableTypes = {
|
||||
enabled = true,
|
||||
suppressWhenTypeMatchesName = true,
|
||||
},
|
||||
propertyDeclarationTypes = { enabled = true },
|
||||
functionLikeReturnTypes = { enabled = true },
|
||||
enumMemberValues = { enabled = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.lsp.config("basedpyright", {
|
||||
settings = {
|
||||
basedpyright = {
|
||||
analysis = {
|
||||
inlayHints = {
|
||||
variableTypes = true, -- Variable type hints
|
||||
callArgumentNames = true, -- Function argument name hints
|
||||
callArgumentNamesMatching = false, -- Show even when arg name matches param name
|
||||
functionReturnTypes = true, -- Function return type hints
|
||||
genericTypes = true, -- Inferred generic type hints
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.lsp.config("gopls", {
|
||||
settings = {
|
||||
gopls = {
|
||||
hints = {
|
||||
assignVariableTypes = true, -- Variable type hints in assignments
|
||||
compositeLiteralFields = true, -- Composite literal field name hints
|
||||
compositeLiteralTypes = true, -- Composite literal type hints
|
||||
constantValues = true, -- Constant value hints (iota)
|
||||
functionTypeParameters = true, -- Generic function type parameter hints
|
||||
ignoredError = true, -- Implicitly discarded error hints (experimental)
|
||||
parameterNames = true, -- Function call parameter name hints
|
||||
rangeVariableTypes = true, -- Range statement variable type hints
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.lsp.config("rust_analyzer", {
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
inlayHints = {
|
||||
-- Type related
|
||||
typeHints = { enable = true }, -- Variable type hints
|
||||
chainingHints = { enable = true }, -- Method chain type hints
|
||||
closureReturnTypeHints = { enable = "never" }, -- "never" | "always"
|
||||
closureCaptureHints = { enable = false }, -- Closure capture hints
|
||||
-- Parameter related
|
||||
parameterHints = { enable = true }, -- Function parameter hints
|
||||
-- Brace related
|
||||
closingBraceHints = { enable = true, minLines = 25 }, -- Closing brace hints
|
||||
-- Other
|
||||
bindingModeHints = { enable = false }, -- Binding mode hints
|
||||
discriminantHints = { enable = "never" }, -- Enum discriminant hints
|
||||
expressionAdjustmentHints = { enable = "never" }, -- Type adjustment hints
|
||||
implicitDrops = { enable = false }, -- Implicit drop hints
|
||||
lifetimeElisionHints = { enable = "never" }, -- Lifetime elision hints
|
||||
genericParameterHints = {
|
||||
type = { enable = false },
|
||||
lifetime = { enable = false },
|
||||
const = { enable = false },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.lsp.config("zls", {
|
||||
settings = {
|
||||
zls = {
|
||||
enable_inlay_hints = true, -- Global enable
|
||||
inlay_hints_show_builtin = true, -- Show builtin function hints
|
||||
inlay_hints_show_parameter_name = true, -- Show parameter name hints
|
||||
inlay_hints_show_variable_type_hints = true, -- Show variable type hints
|
||||
inlay_hints_show_struct_literal_field_type = true, -- Show struct literal field type hints
|
||||
inlay_hints_exclude_single_argument = true, -- Exclude single argument hints
|
||||
inlay_hints_hide_redundant_param_names = false, -- Hide redundant parameter names
|
||||
inlay_hints_hide_redundant_param_names_last_token = false, -- Hide redundant param names for last token
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.lsp.config("jdtls", {
|
||||
settings = {
|
||||
java = {
|
||||
inlayHints = {
|
||||
parameterNames = {
|
||||
enabled = "all", -- "none" | "literals" | "all"
|
||||
exclusions = { "this" },
|
||||
},
|
||||
variableTypes = { enabled = true }, -- Variable type hints
|
||||
parameterTypes = { enabled = true }, -- Parameter type hints
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.lsp.config("phpactor", {
|
||||
settings = {
|
||||
language_server_worse_reflection = {
|
||||
inlay_hints = {
|
||||
enable = true, -- Master switch
|
||||
types = true, -- Variable type hints
|
||||
params = true, -- Parameter name hints
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -1,13 +1,16 @@
|
||||
local cmp_cap = require("config.cmp").capabilities
|
||||
|
||||
local servers = {
|
||||
"gopls",
|
||||
"phpactor",
|
||||
"ols",
|
||||
"zls",
|
||||
"ts_ls",
|
||||
"tsc",
|
||||
"eslint",
|
||||
"yamlls",
|
||||
"vimls",
|
||||
"ruff",
|
||||
"pyright",
|
||||
"basedpyright",
|
||||
"denols",
|
||||
"lua_ls",
|
||||
"qmlls",
|
||||
@@ -25,6 +28,8 @@ local servers = {
|
||||
"jdtls",
|
||||
"powershell_es",
|
||||
"rust_analyzer",
|
||||
"digestif",
|
||||
"elixirls",
|
||||
}
|
||||
|
||||
for _, server in ipairs(servers) do
|
||||
@@ -34,6 +39,23 @@ for _, server in ipairs(servers) do
|
||||
vim.lsp.enable(server)
|
||||
end
|
||||
|
||||
vim.lsp.config("tsgo", {
|
||||
cmd = function(dispatchers, config)
|
||||
local bin = "tsc"
|
||||
if (config or {}).root_dir then
|
||||
local local_bin = vim.fs.joinpath(config.root_dir, "node_modules/.bin", bin)
|
||||
if vim.fn.executable(local_bin) == 1 then
|
||||
bin = local_bin
|
||||
end
|
||||
end
|
||||
return vim.lsp.rpc.start({ bin, "--lsp", "--stdio" }, dispatchers)
|
||||
end,
|
||||
})
|
||||
|
||||
vim.lsp.config("digestif", {
|
||||
cmd = { vim.fn.expand "~/.luarocks/bin/digestif" },
|
||||
})
|
||||
|
||||
vim.lsp.config("powershell_es", {
|
||||
capabilities = cmp_cap,
|
||||
bundle_path = "/opt/powershell-editor-services",
|
||||
@@ -58,3 +80,12 @@ vim.lsp.config("eslint", {
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
local arduino_cap = vim.tbl_deep_extend("force", cmp_cap, {
|
||||
textDocument = { semanticTokens = vim.NIL },
|
||||
workspace = { semanticTokens = vim.NIL },
|
||||
})
|
||||
|
||||
vim.lsp.config("arduino_language_server", {
|
||||
capabilities = arduino_cap,
|
||||
})
|
||||
|
||||
+18
-25
@@ -1,11 +1,12 @@
|
||||
local fn = vim.fn
|
||||
|
||||
local function get_coc_lsp_client()
|
||||
local clients = vim.g.coc_service_initialized and vim.fn["CocAction"] "services" or {}
|
||||
local clients = vim.g.coc_service_initialized
|
||||
and vim.fn["CocAction"] "services"
|
||||
or {}
|
||||
for _, client in pairs(clients) do
|
||||
if client["state"] == "running" then
|
||||
local client_name = client["id"]
|
||||
-- Remove 'languageserver.' prefix if it exists
|
||||
client_name = client_name:gsub("^languageserver%.", "")
|
||||
return client_name
|
||||
end
|
||||
@@ -14,21 +15,17 @@ local function get_coc_lsp_client()
|
||||
end
|
||||
|
||||
local function spell()
|
||||
if vim.o.spell then
|
||||
return string.format "[SPELL]"
|
||||
end
|
||||
if vim.o.spell then return string.format "[SPELL]" end
|
||||
|
||||
return ""
|
||||
end
|
||||
|
||||
--- show indicator for Chinese IME
|
||||
local function ime_state()
|
||||
if vim.g.is_mac then
|
||||
local layout = fn.libcall(vim.g.XkbSwitchLib, "Xkb_Switch_getXkbLayout", "")
|
||||
local layout =
|
||||
fn.libcall(vim.g.XkbSwitchLib, "Xkb_Switch_getXkbLayout", "")
|
||||
local res = fn.match(layout, [[\v(Squirrel\.Rime|SCIM.ITABC)]])
|
||||
if res ~= -1 then
|
||||
return "[CN]"
|
||||
end
|
||||
if res ~= -1 then return "[CN]" end
|
||||
end
|
||||
|
||||
return ""
|
||||
@@ -36,24 +33,19 @@ end
|
||||
|
||||
local diff = function()
|
||||
local git_status = vim.b.gitsigns_status_dict
|
||||
if git_status == nil then
|
||||
return
|
||||
end
|
||||
if git_status == nil then return end
|
||||
|
||||
local modify_num = git_status.changed
|
||||
local remove_num = git_status.removed
|
||||
local add_num = git_status.added
|
||||
|
||||
local info = { added = add_num, modified = modify_num, removed = remove_num }
|
||||
-- vim.print(info)
|
||||
local info =
|
||||
{ added = add_num, modified = modify_num, removed = remove_num }
|
||||
return info
|
||||
end
|
||||
|
||||
local virtual_env = function()
|
||||
-- only show virtual env for Python
|
||||
if vim.bo.filetype ~= "python" then
|
||||
return ""
|
||||
end
|
||||
if vim.bo.filetype ~= "python" then return "" end
|
||||
|
||||
local conda_env = os.getenv "CONDA_DEFAULT_ENV"
|
||||
local venv_path = os.getenv "VIRTUAL_ENV"
|
||||
@@ -85,10 +77,7 @@ require("lualine").setup {
|
||||
lualine_b = {
|
||||
{
|
||||
"branch",
|
||||
fmt = function(name, _)
|
||||
-- truncate branch name in case the name is too long
|
||||
return string.sub(name, 1, 20)
|
||||
end,
|
||||
fmt = function(name, _) return string.sub(name, 1, 20) end,
|
||||
color = { gui = "italic,bold" },
|
||||
separator = { right = "" },
|
||||
},
|
||||
@@ -116,7 +105,10 @@ require("lualine").setup {
|
||||
},
|
||||
lualine_y = {
|
||||
{ "encoding", fmt = string.upper },
|
||||
{ "fileformat", symbols = { unix = "", dos = "", mac = "" } },
|
||||
{
|
||||
"fileformat",
|
||||
symbols = { unix = "", dos = "", mac = "" },
|
||||
},
|
||||
"filetype",
|
||||
},
|
||||
lualine_z = { "progress" },
|
||||
@@ -133,4 +125,5 @@ require("lualine").setup {
|
||||
extensions = { "quickfix", "fugitive", "nvim-tree" },
|
||||
}
|
||||
|
||||
vim.o.laststatus = 0 -- required for some reason -> avoid two bar lualine /w tmux
|
||||
-- also in options, but has to be here as well
|
||||
vim.o.laststatus = 0;
|
||||
|
||||
+55
-38
@@ -21,14 +21,10 @@ require("notify").setup {
|
||||
end,
|
||||
}
|
||||
|
||||
-- Utility functions shared between progress reports for LSP and DAP
|
||||
|
||||
local client_notifs = {}
|
||||
|
||||
local function get_notif_data(client_id, token)
|
||||
if not client_notifs[client_id] then
|
||||
client_notifs[client_id] = {}
|
||||
end
|
||||
if not client_notifs[client_id] then client_notifs[client_id] = {} end
|
||||
|
||||
if not client_notifs[client_id][token] then
|
||||
client_notifs[client_id][token] = {}
|
||||
@@ -37,7 +33,8 @@ local function get_notif_data(client_id, token)
|
||||
return client_notifs[client_id][token]
|
||||
end
|
||||
|
||||
local spinner_frames = { "⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷" }
|
||||
local spinner_frames =
|
||||
{ "⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷" }
|
||||
|
||||
local function update_spinner(client_id, token)
|
||||
local notif_data = get_notif_data(client_id, token)
|
||||
@@ -52,9 +49,7 @@ local function update_spinner(client_id, token)
|
||||
replace = notif_data.notification,
|
||||
})
|
||||
|
||||
vim.defer_fn(function()
|
||||
update_spinner(client_id, token)
|
||||
end, 100)
|
||||
vim.defer_fn(function() update_spinner(client_id, token) end, 100)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -66,17 +61,12 @@ local function format_message(message, percentage)
|
||||
return (percentage and percentage .. "%\t" or "") .. (message or "")
|
||||
end
|
||||
|
||||
-- LSP integration
|
||||
-- Make sure to also have the snippet with the common helper functions in your config!
|
||||
|
||||
vim.lsp.handlers["$/progress"] = function(_, result, ctx)
|
||||
local client_id = ctx.client_id
|
||||
|
||||
local val = result.value
|
||||
|
||||
if not val.kind then
|
||||
return
|
||||
end
|
||||
if not val.kind then return end
|
||||
|
||||
local notif_data = get_notif_data(client_id, result.token)
|
||||
|
||||
@@ -84,7 +74,10 @@ vim.lsp.handlers["$/progress"] = function(_, result, ctx)
|
||||
local message = format_message(val.message, val.percentage)
|
||||
|
||||
notif_data.notification = vim.notify(message, "info", {
|
||||
title = format_title(val.title, vim.lsp.get_client_by_id(client_id).name),
|
||||
title = format_title(
|
||||
val.title,
|
||||
vim.lsp.get_client_by_id(client_id).name
|
||||
),
|
||||
icon = spinner_frames[1],
|
||||
timeout = false,
|
||||
hide_from_history = false,
|
||||
@@ -93,16 +86,21 @@ vim.lsp.handlers["$/progress"] = function(_, result, ctx)
|
||||
notif_data.spinner = 1
|
||||
update_spinner(client_id, result.token)
|
||||
elseif val.kind == "report" and notif_data then
|
||||
notif_data.notification = vim.notify(format_message(val.message, val.percentage), "info", {
|
||||
replace = notif_data.notification,
|
||||
hide_from_history = false,
|
||||
})
|
||||
notif_data.notification =
|
||||
vim.notify(format_message(val.message, val.percentage), "info", {
|
||||
replace = notif_data.notification,
|
||||
hide_from_history = false,
|
||||
})
|
||||
elseif val.kind == "end" and notif_data then
|
||||
notif_data.notification = vim.notify(val.message and format_message(val.message) or "Complete", "info", {
|
||||
icon = "",
|
||||
replace = notif_data.notification,
|
||||
timeout = 6000,
|
||||
})
|
||||
notif_data.notification = vim.notify(
|
||||
val.message and format_message(val.message) or "Complete",
|
||||
"info",
|
||||
{
|
||||
icon = "",
|
||||
replace = notif_data.notification,
|
||||
timeout = 6000,
|
||||
}
|
||||
)
|
||||
|
||||
notif_data.spinner = nil
|
||||
end
|
||||
@@ -111,14 +109,22 @@ end
|
||||
-- table from lsp severity to vim severity.
|
||||
local severity = { "error", "warn", "info" }
|
||||
|
||||
vim.lsp.handlers["window/showMessage"] = function(err, method, params, client_id)
|
||||
vim.lsp.handlers["window/showMessage"] = function(
|
||||
err,
|
||||
method,
|
||||
params,
|
||||
client_id
|
||||
)
|
||||
vim.notify(method.message, severity[params.type])
|
||||
end
|
||||
|
||||
-- DAP integration
|
||||
-- Make sure to also have the snippet with the common helper functions in your config!
|
||||
|
||||
dap.listeners.before["event_progressStart"]["progress-notifications"] = function(session, body)
|
||||
dap.listeners.before["event_progressStart"]["progress-notifications"] = function(
|
||||
session,
|
||||
body
|
||||
)
|
||||
local notif_data = get_notif_data("dap", body.progressId)
|
||||
|
||||
local message = format_message(body.message, body.percentage)
|
||||
@@ -132,20 +138,31 @@ dap.listeners.before["event_progressStart"]["progress-notifications"] = function
|
||||
notif_data.notification.spinner = 1, update_spinner("dap", body.progressId)
|
||||
end
|
||||
|
||||
dap.listeners.before["event_progressUpdate"]["progress-notifications"] = function(session, body)
|
||||
dap.listeners.before["event_progressUpdate"]["progress-notifications"] = function(
|
||||
session,
|
||||
body
|
||||
)
|
||||
local notif_data = get_notif_data("dap", body.progressId)
|
||||
notif_data.notification = vim.notify(format_message(body.message, body.percentage), "info", {
|
||||
replace = notif_data.notification,
|
||||
hide_from_history = false,
|
||||
})
|
||||
notif_data.notification =
|
||||
vim.notify(format_message(body.message, body.percentage), "info", {
|
||||
replace = notif_data.notification,
|
||||
hide_from_history = false,
|
||||
})
|
||||
end
|
||||
|
||||
dap.listeners.before["event_progressEnd"]["progress-notifications"] = function(session, body)
|
||||
dap.listeners.before["event_progressEnd"]["progress-notifications"] = function(
|
||||
session,
|
||||
body
|
||||
)
|
||||
local notif_data = client_notifs["dap"][body.progressId]
|
||||
notif_data.notification = vim.notify(body.message and format_message(body.message) or "Complete", "info", {
|
||||
icon = "",
|
||||
replace = notif_data.notification,
|
||||
timeout = 6000,
|
||||
})
|
||||
notif_data.notification = vim.notify(
|
||||
body.message and format_message(body.message) or "Complete",
|
||||
"info",
|
||||
{
|
||||
icon = "",
|
||||
replace = notif_data.notification,
|
||||
timeout = 6000,
|
||||
}
|
||||
)
|
||||
notif_data.spinner = nil
|
||||
end
|
||||
|
||||
@@ -0,0 +1,389 @@
|
||||
require"octo".setup {
|
||||
picker = "telescope", -- or "fzf-lua" or "snacks" or "default"
|
||||
picker_config = {
|
||||
use_emojis = false, -- only used by "fzf-lua" picker for now
|
||||
search_static = true, -- Whether to use static search results (true) or dynamic search (false)
|
||||
mappings = { -- mappings for the pickers
|
||||
open_in_browser = { lhs = "<C-b>", desc = "open issue in browser" },
|
||||
copy_url = { lhs = "<C-y>", desc = "copy url to system clipboard" },
|
||||
copy_sha = { lhs = "<C-e>", desc = "copy commit SHA to system clipboard" },
|
||||
checkout_pr = { lhs = "<C-o>", desc = "checkout pull request" },
|
||||
merge_pr = { lhs = "<C-r>", desc = "merge pull request" },
|
||||
},
|
||||
snacks = { -- snacks specific config
|
||||
-- Initialize actions as empty arrays
|
||||
actions = { -- custom actions for specific snacks pickers (array of tables)
|
||||
issues = { -- actions for the issues picker
|
||||
-- { name = "my_issue_action", fn = function(picker, item) print("Issue action:", vim.inspect(item)) end, lhs = "<leader>a", desc = "My custom issue action" },
|
||||
},
|
||||
pull_requests = { -- actions for the pull requests picker
|
||||
-- { name = "my_pr_action", fn = function(picker, item) print("PR action:", vim.inspect(item)) end, lhs = "<leader>b", desc = "My custom PR action" },
|
||||
},
|
||||
notifications = {}, -- actions for the notifications picker
|
||||
issue_templates = {}, -- actions for the issue templates picker
|
||||
search = {}, -- actions for the search picker
|
||||
-- ... add actions for other pickers as needed
|
||||
changed_files = {},
|
||||
commits = {},
|
||||
review_commits = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
default_remote = { "upstream", "origin" }, -- order to try remotes
|
||||
default_merge_method = "merge", -- default merge method which should be used for both `Octo pr merge` and merging from picker, could be `merge`, `rebase` or `squash`
|
||||
default_delete_branch = false, -- whether to delete branch when merging pull request with either `Octo pr merge` or from picker (can be overridden with `delete`/`nodelete` argument to `Octo pr merge`)
|
||||
ssh_aliases = {}, -- SSH aliases. e.g. `ssh_aliases = {["github.com-work"] = "github.com"}`. The key part will be interpreted as an anchored Lua pattern.
|
||||
reaction_viewer_hint_icon = " ", -- marker for user reactions
|
||||
commands = {}, -- additional subcommands made available to `Octo` command
|
||||
users = "search", -- Users for assignees or reviewers. Values: "search" | "mentionable" | "assignable"
|
||||
user_icon = " ", -- user icon
|
||||
ghost_icon = " ", -- ghost icon
|
||||
copilot_icon = " ", -- copilot icon
|
||||
dependabot_icon = " ",
|
||||
comment_icon = "▎",
|
||||
outdated_icon = " ",
|
||||
resolved_icon = " ",
|
||||
timeline_marker = " ",
|
||||
timeline_indent = 2,
|
||||
use_timeline_icons = true,
|
||||
timeline_icons = {
|
||||
auto_squash = " ",
|
||||
blocking = " ",
|
||||
commit_push = " ",
|
||||
comment_deleted = " ",
|
||||
duplicate = " ",
|
||||
force_push = " ",
|
||||
draft = " ",
|
||||
ready = " ",
|
||||
commit = " ",
|
||||
deployed = " ",
|
||||
issue_type = " ",
|
||||
label = " ",
|
||||
reference = " ",
|
||||
project = " ",
|
||||
connected = " ",
|
||||
subissue = " ",
|
||||
cross_reference = " ",
|
||||
transferred = " ",
|
||||
parent_issue = " ",
|
||||
head_ref = " ",
|
||||
pinned = " ",
|
||||
milestone = " ",
|
||||
renamed = " ",
|
||||
automatic_base_change_succeeded = " ",
|
||||
base_ref_changed = " ",
|
||||
merged = { " ", "OctoPurple" },
|
||||
closed = {
|
||||
closed = { " ", "OctoRed" },
|
||||
completed = { " ", "OctoPurple" },
|
||||
not_planned = { " ", "OctoWhite" },
|
||||
duplicate = { " ", "OctoWhite" },
|
||||
},
|
||||
reopened = { " ", "OctoGreen" },
|
||||
assigned = " ",
|
||||
locked = " ",
|
||||
merge_queue = " ",
|
||||
review_requested = " ",
|
||||
},
|
||||
right_bubble_delimiter = "", -- bubble delimiter
|
||||
left_bubble_delimiter = "", -- bubble delimiter
|
||||
github_hostname = "", -- GitHub Enterprise host
|
||||
use_local_fs = false, -- use local files on right side of reviews
|
||||
enable_builtin = false, -- shows a list of builtin actions when no action is provided
|
||||
snippet_context_lines = 4, -- number of lines around commented lines
|
||||
gh_cmd = "gh", -- Command to use when calling Github CLI
|
||||
gh_env = {}, -- extra environment variables to pass on to GitHub CLI, can be a table or function returning a table
|
||||
timeout = 5000, -- timeout for requests between the remote server
|
||||
default_to_projects_v2 = false, -- use projects v2 for the `Octo card ...` command by default. Both legacy and v2 commands are available under `Octo cardlegacy ...` and `Octo cardv2 ...` respectively.
|
||||
suppress_missing_scope = {
|
||||
projects_v2 = false,
|
||||
},
|
||||
ui = {
|
||||
conceallevel = 2, -- conceallevel for octo buffers
|
||||
use_signcolumn = false, -- show "modified" marks on the sign column
|
||||
use_statuscolumn = true, -- show "modified" marks on the status column
|
||||
use_foldtext = true,
|
||||
},
|
||||
issues = {
|
||||
order_by = { -- criteria to sort results of `Octo issue list`
|
||||
field = "CREATED_AT", -- either COMMENTS, CREATED_AT or UPDATED_AT (https://docs.github.com/en/graphql/reference/enums#issueorderfield)
|
||||
direction = "DESC", -- either DESC or ASC (https://docs.github.com/en/graphql/reference/enums#orderdirection)
|
||||
},
|
||||
},
|
||||
discussions = {
|
||||
order_by = {
|
||||
field = "CREATED_AT",
|
||||
direction = "DESC",
|
||||
},
|
||||
},
|
||||
notifications = {
|
||||
current_repo_only = false, -- show notifications for current repo only
|
||||
},
|
||||
reviews = {
|
||||
auto_show_threads = true, -- automatically show comment threads on cursor move
|
||||
focus = "right", -- focus right buffer on diff open
|
||||
},
|
||||
runs = {
|
||||
icons = {
|
||||
pending = "🕖",
|
||||
in_progress = "🔄",
|
||||
failed = "❌",
|
||||
succeeded = "",
|
||||
skipped = "⏩",
|
||||
cancelled = "✖",
|
||||
},
|
||||
},
|
||||
pull_requests = {
|
||||
order_by = { -- criteria to sort the results of `Octo pr list`
|
||||
field = "CREATED_AT", -- either COMMENTS, CREATED_AT or UPDATED_AT (https://docs.github.com/en/graphql/reference/enums#issueorderfield)
|
||||
direction = "DESC", -- either DESC or ASC (https://docs.github.com/en/graphql/reference/enums#orderdirection)
|
||||
},
|
||||
always_select_remote_on_create = false, -- always give prompt to select base remote repo when creating PRs
|
||||
use_branch_name_as_title = false, -- sets branch name to be the name for the PR
|
||||
},
|
||||
file_panel = {
|
||||
size = 10, -- changed files panel rows
|
||||
icons = true, -- true = nvim-web-devicons, false = disabled, function = custom provider
|
||||
},
|
||||
colors = { -- used for highlight groups (see Colors section below)
|
||||
white = "#ffffff",
|
||||
grey = "#2A354C",
|
||||
black = "#000000",
|
||||
red = "#fdb8c0",
|
||||
dark_red = "#da3633",
|
||||
green = "#acf2bd",
|
||||
dark_green = "#238636",
|
||||
yellow = "#d3c846",
|
||||
dark_yellow = "#735c0f",
|
||||
blue = "#58A6FF",
|
||||
dark_blue = "#0366d6",
|
||||
purple = "#6f42c1",
|
||||
},
|
||||
mappings_disable_default = false, -- disable default mappings if true, but will still adapt user mappings
|
||||
mappings = {
|
||||
discussion = {
|
||||
discussion_options = { lhs = "<CR>", desc = "show discussion options" },
|
||||
open_in_browser = { lhs = "<C-b>", desc = "open discussion in browser" },
|
||||
copy_url = { lhs = "<C-y>", desc = "copy url to system clipboard" },
|
||||
add_comment = { lhs = "<localleader>ca", desc = "add comment" },
|
||||
add_reply = { lhs = "<localleader>cr", desc = "add reply" },
|
||||
delete_comment = { lhs = "<localleader>cd", desc = "delete comment" },
|
||||
comment_edits = { lhs = "<localleader>ce", desc = "show comment edit history" },
|
||||
reference_in_new_issue = { lhs = "<localleader>ri", desc = "reference comment in new issue" },
|
||||
add_label = { lhs = "<localleader>la", desc = "add label" },
|
||||
remove_label = { lhs = "<localleader>ld", desc = "remove label" },
|
||||
next_comment = { lhs = "]c", desc = "go to next comment" },
|
||||
prev_comment = { lhs = "[c", desc = "go to previous comment" },
|
||||
react_hooray = { lhs = "<localleader>rp", desc = "add/remove 🎉 reaction" },
|
||||
react_heart = { lhs = "<localleader>rh", desc = "add/remove ❤️ reaction" },
|
||||
react_eyes = { lhs = "<localleader>re", desc = "add/remove 👀 reaction" },
|
||||
react_thumbs_up = { lhs = "<localleader>r+", desc = "add/remove 👍 reaction" },
|
||||
react_thumbs_down = { lhs = "<localleader>r-", desc = "add/remove 👎 reaction" },
|
||||
react_rocket = { lhs = "<localleader>rr", desc = "add/remove 🚀 reaction" },
|
||||
react_laugh = { lhs = "<localleader>rl", desc = "add/remove 😄 reaction" },
|
||||
react_confused = { lhs = "<localleader>rc", desc = "add/remove 😕 reaction" },
|
||||
},
|
||||
runs = {
|
||||
expand_step = { lhs = "o", desc = "expand workflow step" },
|
||||
next_step = { lhs = "]s", desc = "next workflow step" },
|
||||
prev_step = { lhs = "[s", desc = "previous workflow step" },
|
||||
next_job = { lhs = "]j", desc = "next workflow job" },
|
||||
prev_job = { lhs = "[j", desc = "previous workflow job" },
|
||||
open_in_browser = { lhs = "<C-b>", desc = "open workflow run in browser" },
|
||||
refresh = { lhs = "<C-r>", desc = "refresh workflow" },
|
||||
rerun = { lhs = "<C-o>", desc = "rerun workflow" },
|
||||
rerun_failed = { lhs = "<C-f>", desc = "rerun failed workflow" },
|
||||
cancel = { lhs = "<C-x>", desc = "cancel workflow" },
|
||||
copy_url = { lhs = "<C-y>", desc = "copy url to system clipboard" },
|
||||
},
|
||||
issue = {
|
||||
issue_options = { lhs = "<CR>", desc = "show issue options" },
|
||||
close_issue = { lhs = "<localleader>ic", desc = "close issue" },
|
||||
reopen_issue = { lhs = "<localleader>io", desc = "reopen issue" },
|
||||
list_issues = { lhs = "<localleader>il", desc = "list open issues on same repo" },
|
||||
reload = { lhs = "<C-r>", desc = "reload issue" },
|
||||
open_in_browser = { lhs = "<C-b>", desc = "open issue in browser" },
|
||||
copy_url = { lhs = "<C-y>", desc = "copy url to system clipboard" },
|
||||
add_assignee = { lhs = "<localleader>aa", desc = "add assignee" },
|
||||
remove_assignee = { lhs = "<localleader>ad", desc = "remove assignee" },
|
||||
create_label = { lhs = "<localleader>lc", desc = "create label" },
|
||||
add_label = { lhs = "<localleader>la", desc = "add label" },
|
||||
remove_label = { lhs = "<localleader>ld", desc = "remove label" },
|
||||
goto_issue = { lhs = "<localleader>gi", desc = "navigate to a local repo issue" },
|
||||
add_comment = { lhs = "<localleader>ca", desc = "add comment" },
|
||||
add_reply = { lhs = "<localleader>cr", desc = "add reply" },
|
||||
delete_comment = { lhs = "<localleader>cd", desc = "delete comment" },
|
||||
comment_edits = { lhs = "<localleader>ce", desc = "show comment edit history" },
|
||||
reference_in_new_issue = { lhs = "<localleader>ri", desc = "reference comment in new issue" },
|
||||
next_comment = { lhs = "]c", desc = "go to next comment" },
|
||||
prev_comment = { lhs = "[c", desc = "go to previous comment" },
|
||||
react_hooray = { lhs = "<localleader>rp", desc = "add/remove 🎉 reaction" },
|
||||
react_heart = { lhs = "<localleader>rh", desc = "add/remove ❤️ reaction" },
|
||||
react_eyes = { lhs = "<localleader>re", desc = "add/remove 👀 reaction" },
|
||||
react_thumbs_up = { lhs = "<localleader>r+", desc = "add/remove 👍 reaction" },
|
||||
react_thumbs_down = { lhs = "<localleader>r-", desc = "add/remove 👎 reaction" },
|
||||
react_rocket = { lhs = "<localleader>rr", desc = "add/remove 🚀 reaction" },
|
||||
react_laugh = { lhs = "<localleader>rl", desc = "add/remove 😄 reaction" },
|
||||
react_confused = { lhs = "<localleader>rc", desc = "add/remove 😕 reaction" },
|
||||
},
|
||||
pull_request = {
|
||||
pr_options = { lhs = "<CR>", desc = "show PR options" },
|
||||
checkout_pr = { lhs = "<localleader>po", desc = "checkout PR" },
|
||||
merge_pr = { lhs = "<localleader>pm", desc = "merge commit PR" },
|
||||
squash_and_merge_pr = { lhs = "<localleader>psm", desc = "squash and merge PR" },
|
||||
rebase_and_merge_pr = { lhs = "<localleader>prm", desc = "rebase and merge PR" },
|
||||
merge_pr_queue = {
|
||||
lhs = "<localleader>pq",
|
||||
desc = "merge commit PR and add to merge queue (Merge queue must be enabled in the repo)",
|
||||
},
|
||||
squash_and_merge_queue = {
|
||||
lhs = "<localleader>psq",
|
||||
desc = "squash and add to merge queue (Merge queue must be enabled in the repo)",
|
||||
},
|
||||
rebase_and_merge_queue = {
|
||||
lhs = "<localleader>prq",
|
||||
desc = "rebase and add to merge queue (Merge queue must be enabled in the repo)",
|
||||
},
|
||||
list_commits = { lhs = "<localleader>pc", desc = "list PR commits" },
|
||||
list_changed_files = { lhs = "<localleader>pf", desc = "list PR changed files" },
|
||||
show_pr_diff = { lhs = "<localleader>pd", desc = "show PR diff" },
|
||||
add_reviewer = { lhs = "<localleader>va", desc = "add reviewer" },
|
||||
remove_reviewer = { lhs = "<localleader>vd", desc = "remove reviewer request" },
|
||||
close_issue = { lhs = "<localleader>ic", desc = "close PR" },
|
||||
reopen_issue = { lhs = "<localleader>io", desc = "reopen PR" },
|
||||
list_issues = { lhs = "<localleader>il", desc = "list open issues on same repo" },
|
||||
reload = { lhs = "<C-r>", desc = "reload PR" },
|
||||
approve_pr = { lhs = "<leader>qa", desc = "approve PR" },
|
||||
open_in_browser = { lhs = "<C-b>", desc = "open PR in browser" },
|
||||
copy_url = { lhs = "<C-y>", desc = "copy url to system clipboard" },
|
||||
copy_sha = { lhs = "<C-e>", desc = "copy commit SHA to system clipboard" },
|
||||
goto_file = { lhs = "gf", desc = "go to file" },
|
||||
add_assignee = { lhs = "<localleader>aa", desc = "add assignee" },
|
||||
remove_assignee = { lhs = "<localleader>ad", desc = "remove assignee" },
|
||||
create_label = { lhs = "<localleader>lc", desc = "create label" },
|
||||
add_label = { lhs = "<localleader>la", desc = "add label" },
|
||||
remove_label = { lhs = "<localleader>ld", desc = "remove label" },
|
||||
goto_issue = { lhs = "<localleader>gi", desc = "navigate to a local repo issue" },
|
||||
add_comment = { lhs = "<localleader>ca", desc = "add comment" },
|
||||
add_reply = { lhs = "<localleader>cr", desc = "add reply" },
|
||||
delete_comment = { lhs = "<localleader>cd", desc = "delete comment" },
|
||||
comment_edits = { lhs = "<localleader>ce", desc = "show comment edit history" },
|
||||
reference_in_new_issue = { lhs = "<localleader>ri", desc = "reference comment in new issue" },
|
||||
next_comment = { lhs = "]c", desc = "go to next comment" },
|
||||
prev_comment = { lhs = "[c", desc = "go to previous comment" },
|
||||
react_hooray = { lhs = "<localleader>rp", desc = "add/remove 🎉 reaction" },
|
||||
react_heart = { lhs = "<localleader>rh", desc = "add/remove ❤️ reaction" },
|
||||
react_eyes = { lhs = "<localleader>re", desc = "add/remove 👀 reaction" },
|
||||
react_thumbs_up = { lhs = "<localleader>r+", desc = "add/remove 👍 reaction" },
|
||||
react_thumbs_down = { lhs = "<localleader>r-", desc = "add/remove 👎 reaction" },
|
||||
react_rocket = { lhs = "<localleader>rr", desc = "add/remove 🚀 reaction" },
|
||||
react_laugh = { lhs = "<localleader>rl", desc = "add/remove 😄 reaction" },
|
||||
react_confused = { lhs = "<localleader>rc", desc = "add/remove 😕 reaction" },
|
||||
review_start = { lhs = "<localleader>vs", desc = "start a review for the current PR" },
|
||||
review_resume = { lhs = "<localleader>vr", desc = "resume a pending review for the current PR" },
|
||||
resolve_thread = { lhs = "<localleader>rt", desc = "resolve PR thread" },
|
||||
unresolve_thread = { lhs = "<localleader>rT", desc = "unresolve PR thread" },
|
||||
},
|
||||
review_thread = {
|
||||
goto_issue = { lhs = "<localleader>gi", desc = "navigate to a local repo issue" },
|
||||
add_comment = { lhs = "<localleader>ca", desc = "add comment" },
|
||||
add_reply = { lhs = "<localleader>cr", desc = "add reply" },
|
||||
add_suggestion = { lhs = "<localleader>sa", desc = "add suggestion" },
|
||||
delete_comment = { lhs = "<localleader>cd", desc = "delete comment" },
|
||||
comment_edits = { lhs = "<localleader>ce", desc = "show comment edit history" },
|
||||
reference_in_new_issue = { lhs = "<localleader>ri", desc = "reference comment in new issue" },
|
||||
next_comment = { lhs = "]c", desc = "go to next comment" },
|
||||
prev_comment = { lhs = "[c", desc = "go to previous comment" },
|
||||
select_next_entry = { lhs = "]q", desc = "move to next changed file" },
|
||||
select_prev_entry = { lhs = "[q", desc = "move to previous changed file" },
|
||||
select_first_entry = { lhs = "[Q", desc = "move to first changed file" },
|
||||
select_last_entry = { lhs = "]Q", desc = "move to last changed file" },
|
||||
select_next_unviewed_entry = { lhs = "]u", desc = "move to next unviewed file" },
|
||||
select_prev_unviewed_entry = { lhs = "[u", desc = "move to previous unviewed file" },
|
||||
close_review_tab = { lhs = "<C-c>", desc = "close review tab" },
|
||||
react_hooray = { lhs = "<localleader>rp", desc = "add/remove 🎉 reaction" },
|
||||
react_heart = { lhs = "<localleader>rh", desc = "add/remove ❤️ reaction" },
|
||||
react_eyes = { lhs = "<localleader>re", desc = "add/remove 👀 reaction" },
|
||||
react_thumbs_up = { lhs = "<localleader>r+", desc = "add/remove 👍 reaction" },
|
||||
react_thumbs_down = { lhs = "<localleader>r-", desc = "add/remove 👎 reaction" },
|
||||
react_rocket = { lhs = "<localleader>rr", desc = "add/remove 🚀 reaction" },
|
||||
react_laugh = { lhs = "<localleader>rl", desc = "add/remove 😄 reaction" },
|
||||
react_confused = { lhs = "<localleader>rc", desc = "add/remove 😕 reaction" },
|
||||
resolve_thread = { lhs = "<localleader>rt", desc = "resolve PR thread" },
|
||||
unresolve_thread = { lhs = "<localleader>rT", desc = "unresolve PR thread" },
|
||||
},
|
||||
submit_win = {
|
||||
approve_review = { lhs = "<C-a>", desc = "approve review", mode = { "n" } },
|
||||
comment_review = { lhs = "<C-m>", desc = "comment review", mode = { "n" } },
|
||||
request_changes = { lhs = "<C-r>", desc = "request changes review", mode = { "n" } },
|
||||
close_review_tab = { lhs = "<C-c>", desc = "close review tab", mode = { "n" } },
|
||||
},
|
||||
review_diff = {
|
||||
submit_review = { lhs = "<localleader>vs", desc = "submit review" },
|
||||
discard_review = { lhs = "<localleader>vd", desc = "discard review" },
|
||||
add_review_comment = { lhs = "<localleader>ca", desc = "add a new review comment", mode = { "n", "x" } },
|
||||
add_review_suggestion = { lhs = "<localleader>sa", desc = "add a new review suggestion", mode = { "n", "x" } },
|
||||
focus_files = { lhs = "<localleader>e", desc = "move focus to changed file panel" },
|
||||
toggle_files = { lhs = "<localleader>b", desc = "hide/show changed files panel" },
|
||||
next_thread = { lhs = "]t", desc = "move to next thread" },
|
||||
prev_thread = { lhs = "[t", desc = "move to previous thread" },
|
||||
select_next_entry = { lhs = "]q", desc = "move to next changed file" },
|
||||
select_prev_entry = { lhs = "[q", desc = "move to previous changed file" },
|
||||
select_first_entry = { lhs = "[Q", desc = "move to first changed file" },
|
||||
select_last_entry = { lhs = "]Q", desc = "move to last changed file" },
|
||||
select_next_unviewed_entry = { lhs = "]u", desc = "move to next unviewed file" },
|
||||
select_prev_unviewed_entry = { lhs = "[u", desc = "move to previous unviewed file" },
|
||||
close_review_tab = { lhs = "<C-c>", desc = "close review tab" },
|
||||
toggle_viewed = { lhs = "<localleader><space>", desc = "toggle viewer viewed state" },
|
||||
goto_file = { lhs = "gf", desc = "go to file" },
|
||||
copy_sha = { lhs = "<C-e>", desc = "copy commit SHA to system clipboard" },
|
||||
review_commits = { lhs = "<localleader>C", desc = "review PR commits" },
|
||||
},
|
||||
file_panel = {
|
||||
submit_review = { lhs = "<localleader>vs", desc = "submit review" },
|
||||
discard_review = { lhs = "<localleader>vd", desc = "discard review" },
|
||||
next_entry = { lhs = "j", desc = "move to next changed file" },
|
||||
prev_entry = { lhs = "k", desc = "move to previous changed file" },
|
||||
select_entry = { lhs = "<cr>", desc = "show selected changed file diffs" },
|
||||
refresh_files = { lhs = "R", desc = "refresh changed files panel" },
|
||||
focus_files = { lhs = "<localleader>e", desc = "move focus to changed file panel" },
|
||||
toggle_files = { lhs = "<localleader>b", desc = "hide/show changed files panel" },
|
||||
select_next_entry = { lhs = "]q", desc = "move to next changed file" },
|
||||
select_prev_entry = { lhs = "[q", desc = "move to previous changed file" },
|
||||
select_first_entry = { lhs = "[Q", desc = "move to first changed file" },
|
||||
select_last_entry = { lhs = "]Q", desc = "move to last changed file" },
|
||||
select_next_unviewed_entry = { lhs = "]u", desc = "move to next unviewed file" },
|
||||
select_prev_unviewed_entry = { lhs = "[u", desc = "move to previous unviewed file" },
|
||||
close_review_tab = { lhs = "<C-c>", desc = "close review tab" },
|
||||
toggle_viewed = { lhs = "<localleader><space>", desc = "toggle viewer viewed state" },
|
||||
review_commits = { lhs = "<localleader>C", desc = "review PR commits" },
|
||||
},
|
||||
notification = {
|
||||
read = { lhs = "<localleader>nr", desc = "mark notification as read" },
|
||||
done = { lhs = "<localleader>nd", desc = "mark notification as done" },
|
||||
unsubscribe = { lhs = "<localleader>nu", desc = "unsubscribe from notifications" },
|
||||
},
|
||||
repo = {
|
||||
repo_options = { lhs = "<CR>", desc = "show repo options" },
|
||||
create_issue = { lhs = "<localleader>ic", desc = "create issue" },
|
||||
create_discussion = { lhs = "<localleader>dc", desc = "create discussion" },
|
||||
contributing_guidelines = { lhs = "<localleader>cg", desc = "view contributing guidelines" },
|
||||
open_in_browser = { lhs = "<C-b>", desc = "open repo in browser" },
|
||||
},
|
||||
release = {
|
||||
open_in_browser = { lhs = "<C-b>", desc = "open release in browser" },
|
||||
},
|
||||
},
|
||||
poll = {
|
||||
enabled = false, -- opt-in polling for remote changes
|
||||
interval = 10000, -- polling interval in milliseconds (default: 10s)
|
||||
notify_on_refresh = true, -- notify when a buffer is auto-refreshed
|
||||
notify_on_change = true, -- notify when remote changed but buffer has local edits
|
||||
},
|
||||
search = {
|
||||
completion_overrides = {}, -- key is a qualifier, value is an array table or a function returning a table
|
||||
},
|
||||
debug = {
|
||||
notify_missing_timeline_items = false,
|
||||
},
|
||||
}
|
||||
@@ -1,12 +1,8 @@
|
||||
if not vim.F then
|
||||
vim.F = {}
|
||||
end
|
||||
if not vim.F then vim.F = {} end
|
||||
|
||||
if not vim.F.if_nil and not vim.nonnil then
|
||||
vim.F.if_nil = function(value, default)
|
||||
if value == nil then
|
||||
return default
|
||||
end
|
||||
if value == nil then return default end
|
||||
return value
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
-- Default options:
|
||||
require("gruvbox").setup {
|
||||
terminal_colors = true, -- add neovim terminal colors
|
||||
undercurl = true,
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
-- Lua
|
||||
require("onedarkpro").setup {}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
local time = tonumber(os.date "%H")
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
vim.g.base46_cache = vim.fn.stdpath "data" .. "/base46/"
|
||||
|
||||
+11
-7
@@ -1,9 +1,7 @@
|
||||
local map = vim.keymap.set
|
||||
local default_opts = { noremap = true }
|
||||
|
||||
map("n", "<leader>n", function()
|
||||
Snacks.notifier.show_history()
|
||||
end)
|
||||
map("n", "<leader>n", function() Snacks.notifier.show_history() end)
|
||||
|
||||
map(
|
||||
"n",
|
||||
@@ -34,7 +32,12 @@ map("n", "<A-k>", "<C-w>k", { desc = "Move to top split" })
|
||||
map("n", "<A-l>", "<C-w>l", { desc = "Move to right split" })
|
||||
|
||||
map("n", "<leader>e", vim.cmd.NvimTreeToggle)
|
||||
map("n", "<leader>u", require("undotree").toggle, { noremap = true, silent = true })
|
||||
map(
|
||||
"n",
|
||||
"<leader>u",
|
||||
require("undotree").toggle,
|
||||
{ noremap = true, silent = true }
|
||||
)
|
||||
|
||||
map("n", "<A-->", ":bdelete<CR>")
|
||||
-- map("n", "<SA-->", ":BufferRestore<CR>")
|
||||
@@ -52,6 +55,9 @@ map("n", "<C-u>", "<C-u>zz")
|
||||
map("n", "n", "nzzzv")
|
||||
map("n", "N", "Nzzzv")
|
||||
map("n", "<leader>zig", "<cmd>LspRestart<cr>")
|
||||
map("n", "gd", vim.lsp.buf.definition)
|
||||
map("n", "gD", vim.lsp.buf.definition)
|
||||
map("n", "gr", vim.lsp.buf.references)
|
||||
|
||||
-- greatest remap ever
|
||||
map("x", "<leader>p", [["_dP]])
|
||||
@@ -67,6 +73,4 @@ map("i", "<C-c>", "<Esc>")
|
||||
|
||||
map("n", "<leader>mr", "<cmd>CellularAutomaton make_it_rain<CR>")
|
||||
|
||||
map("n", "<leader><leader>", function()
|
||||
vim.cmd "so"
|
||||
end)
|
||||
map("n", "<leader><leader>", function() vim.cmd "so" end)
|
||||
|
||||
+6
-5
@@ -22,7 +22,8 @@ vim.opt.updatetime = 50
|
||||
vim.opt.textwidth = 0
|
||||
vim.opt.colorcolumn = "100"
|
||||
vim.opt.formatoptions = "rqnj"
|
||||
vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
|
||||
vim.o.sessionoptions =
|
||||
"blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
|
||||
vim.o.laststatus = 0
|
||||
vim.o.clipboard = "unnamedplus"
|
||||
vim.o.cursorline = true
|
||||
@@ -47,8 +48,8 @@ vim.g.loaded_ruby_provider = 0
|
||||
local is_windows = vim.fn.has "win32" ~= 0
|
||||
local sep = is_windows and "\\" or "/"
|
||||
local delim = is_windows and ";" or ":"
|
||||
vim.env.PATH = table.concat({ vim.fn.stdpath "data", "mason", "bin" }, sep) .. delim .. vim.env.PATH
|
||||
vim.env.PATH = table.concat({ vim.fn.stdpath "data", "mason", "bin" }, sep)
|
||||
.. delim
|
||||
.. vim.env.PATH
|
||||
|
||||
vim.api.nvim_create_user_command("Nf", function()
|
||||
vim.cmd "Neoformat"
|
||||
end, {})
|
||||
vim.api.nvim_create_user_command("Nf", function() vim.cmd "Neoformat" end, {})
|
||||
|
||||
+82
-45
@@ -1,24 +1,85 @@
|
||||
return {
|
||||
{
|
||||
"sindrets/diffview.nvim",
|
||||
config = function() require("diffview").setup() end,
|
||||
},
|
||||
{
|
||||
"pwntester/octo.nvim",
|
||||
cmd = "Octo",
|
||||
config = function() require("octo").setup() end,
|
||||
opts = {
|
||||
-- or "fzf-lua" or "snacks" or "default"
|
||||
picker = "telescope",
|
||||
-- bare Octo command opens picker of commands
|
||||
enable_builtin = true,
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>oi",
|
||||
"<CMD>Octo issue list<CR>",
|
||||
desc = "List GitHub Issues",
|
||||
},
|
||||
{
|
||||
"<leader>op",
|
||||
"<CMD>Octo pr list<CR>",
|
||||
desc = "List GitHub PullRequests",
|
||||
},
|
||||
{
|
||||
"<leader>od",
|
||||
"<CMD>Octo discussion list<CR>",
|
||||
desc = "List GitHub Discussions",
|
||||
},
|
||||
{
|
||||
"<leader>on",
|
||||
"<CMD>Octo notification list<CR>",
|
||||
desc = "List GitHub Notifications",
|
||||
},
|
||||
{
|
||||
"<leader>os",
|
||||
function()
|
||||
require("octo.utils").create_base_search_command {
|
||||
include_current_repo = true,
|
||||
}
|
||||
end,
|
||||
desc = "Search GitHub",
|
||||
},
|
||||
},
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-telescope/telescope.nvim",
|
||||
-- OR "ibhagwan/fzf-lua",
|
||||
-- OR "folke/snacks.nvim",
|
||||
"nvim-tree/nvim-web-devicons", -- optional if file_panel.icons is a function
|
||||
},
|
||||
},
|
||||
{
|
||||
"MysticalDevil/inlay-hints.nvim",
|
||||
event = "LspAttach",
|
||||
dependencies = { "neovim/nvim-lspconfig" },
|
||||
config = function() require("inlay-hints").setup() end,
|
||||
},
|
||||
{
|
||||
"mg979/vim-visual-multi",
|
||||
},
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
config = function()
|
||||
require "gitsigns"
|
||||
end,
|
||||
config = function() require "config.gitsigns" end,
|
||||
},
|
||||
{
|
||||
"vimpostor/vim-tpipeline",
|
||||
},
|
||||
{ "vimpostor/vim-tpipeline" },
|
||||
{
|
||||
"aznhe21/actions-preview.nvim",
|
||||
config = function()
|
||||
require "actions-preview"
|
||||
end,
|
||||
config = function() require "config.actions-preview" end,
|
||||
},
|
||||
{
|
||||
"sbdchd/neoformat",
|
||||
init = function()
|
||||
vim.cmd("source" .. vim.fn.stdpath "config" .. "/lua/config/neoformat.vim")
|
||||
vim.cmd(
|
||||
"source"
|
||||
.. vim.fn.stdpath "config"
|
||||
.. "/lua/config/neoformat.vim"
|
||||
)
|
||||
end,
|
||||
},
|
||||
{
|
||||
@@ -38,7 +99,7 @@ return {
|
||||
opts = {
|
||||
bigfile = { enabled = true },
|
||||
dashboard = { enabled = true },
|
||||
explorer = { enabled = true },
|
||||
explorer = { enabled = false },
|
||||
indent = { enabled = true },
|
||||
input = { enabled = true },
|
||||
picker = { enabled = true },
|
||||
@@ -62,90 +123,66 @@ return {
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"j-hui/fidget.nvim",
|
||||
},
|
||||
config = function()
|
||||
require "config.lspconfig"
|
||||
end,
|
||||
config = function() require "config.lspconfig" end,
|
||||
},
|
||||
{
|
||||
"https://gitlab.com/itaranto/plantuml.nvim",
|
||||
version = "*",
|
||||
config = function()
|
||||
require("plantuml").setup()
|
||||
end,
|
||||
config = function() require("plantuml").setup() end,
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
lazy = false,
|
||||
branch = "main",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
require "config.treesitter"
|
||||
end,
|
||||
config = function() require "config.treesitter" end,
|
||||
},
|
||||
{
|
||||
"rmagatti/auto-session",
|
||||
config = function()
|
||||
require "config.autosession"
|
||||
end,
|
||||
config = function() require "config.autosession" end,
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
require "config.telescope"
|
||||
end,
|
||||
config = function() require "config.telescope" end,
|
||||
},
|
||||
{ "lambdalisue/vim-suda" },
|
||||
{ "nvim-tree/nvim-web-devicons" },
|
||||
{
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
cmd = { "NvimTreeToggle", "NvimTreeFocus" },
|
||||
config = function()
|
||||
require "config.nvimtree"
|
||||
end,
|
||||
config = function() require "config.nvimtree" end,
|
||||
},
|
||||
{
|
||||
"akinsho/bufferline.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require "config.barbar"
|
||||
end,
|
||||
config = function() require "config.barbar" end,
|
||||
},
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require "config.lualine"
|
||||
end,
|
||||
config = function() require "config.lualine" end,
|
||||
},
|
||||
{
|
||||
"jiaoshijie/undotree",
|
||||
config = function()
|
||||
require "config.undotree"
|
||||
end,
|
||||
config = function() require "config.undotree" end,
|
||||
},
|
||||
{ "hiphish/rainbow-delimiters.nvim" },
|
||||
{
|
||||
"windwp/nvim-autopairs",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
require "config.autopairs"
|
||||
end,
|
||||
config = function() require "config.autopairs" end,
|
||||
},
|
||||
{ "tpope/vim-fugitive" },
|
||||
{
|
||||
"catgoose/nvim-colorizer.lua",
|
||||
config = function()
|
||||
require "config.colorizer"
|
||||
end,
|
||||
config = function() require "config.colorizer" end,
|
||||
},
|
||||
{ "catppuccin/nvim", name = "catppuccin", priority = 1000 },
|
||||
{ "ellisonleao/gruvbox.nvim", priority = 1000, config = true, opts = ... },
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
config = function()
|
||||
require "config.dap"
|
||||
end,
|
||||
config = function() require "config.dap" end,
|
||||
},
|
||||
{
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
|
||||
Reference in New Issue
Block a user