init
This commit is contained in:
20
nvim/lua/plugins/disabled.lua
Normal file
20
nvim/lua/plugins/disabled.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
-- Delete this condition if you want to execute the file
|
||||
if true then
|
||||
return {}
|
||||
end
|
||||
|
||||
-- Example of disabling some plugins. Add yours
|
||||
local disabled = {
|
||||
{
|
||||
"akinsho/bufferline.nvim",
|
||||
},
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
},
|
||||
}
|
||||
|
||||
for i, plugin in ipairs(disabled) do
|
||||
plugin.enabled = false
|
||||
end
|
||||
|
||||
return disabled
|
||||
20
nvim/lua/plugins/extras/coding/ai/avante.lua
Normal file
20
nvim/lua/plugins/extras/coding/ai/avante.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
return {
|
||||
{
|
||||
"yetone/avante.nvim",
|
||||
event = "VeryLazy",
|
||||
build = "make",
|
||||
opts = {
|
||||
openai = {
|
||||
endpoint = "http://127.0.0.1:11434",
|
||||
model = "deepseek-coder-v2",
|
||||
temperature = 60,
|
||||
max_tokens = 4096,
|
||||
["local"] = true,
|
||||
},
|
||||
},
|
||||
dependencies = {
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
ft = { "markdown", "norg", "rmd", "org", "Avante" },
|
||||
},
|
||||
},
|
||||
}
|
||||
91
nvim/lua/plugins/extras/coding/ai/codecompanion.lua
Normal file
91
nvim/lua/plugins/extras/coding/ai/codecompanion.lua
Normal file
@@ -0,0 +1,91 @@
|
||||
local prefix = "<leader>a"
|
||||
local user = vim.env.USER or "User"
|
||||
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "CodeCompanionChatAdapter",
|
||||
callback = function(args)
|
||||
if args.data.adapter == nil or vim.tbl_isempty(args.data) then
|
||||
return
|
||||
end
|
||||
vim.g.llm_name = args.data.adapter.name
|
||||
end,
|
||||
})
|
||||
|
||||
return {
|
||||
{
|
||||
"olimorris/codecompanion.nvim",
|
||||
cmd = { "CodeCompanion", "CodeCompanionActions", "CodeCompanionToggle", "CodeCompanionAdd", "CodeCompanionChat" },
|
||||
opts = {
|
||||
adapters = {
|
||||
deepseek_coder = function()
|
||||
return require("codecompanion.adapters").extend("ollama", {
|
||||
name = "deepseek_coder",
|
||||
schema = {
|
||||
model = {
|
||||
default = "deepseek-coder-v2:latest",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
deepseek_r1 = function()
|
||||
return require("codecompanion.adapters").extend("ollama", {
|
||||
name = "deepseek_r1",
|
||||
schema = {
|
||||
model = {
|
||||
default = "deepseek-r1:14b",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
strategies = {
|
||||
chat = {
|
||||
adapter = "deepseek_r1",
|
||||
roles = {
|
||||
llm = " CodeCompanion",
|
||||
user = " " .. user:sub(1, 1):upper() .. user:sub(2),
|
||||
},
|
||||
keymaps = {
|
||||
close = { modes = { n = "q", i = "<C-c>" } },
|
||||
stop = { modes = { n = "<C-c>" } },
|
||||
},
|
||||
},
|
||||
inline = { adapter = "deepseek_r1" },
|
||||
agent = { adapter = "deepseek_r1" },
|
||||
},
|
||||
display = {
|
||||
chat = {
|
||||
show_settings = true,
|
||||
render_headers = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{ prefix .. "a", "<cmd>CodeCompanionActions<cr>", mode = { "n", "v" }, desc = "Action Palette" },
|
||||
{ prefix .. "c", "<cmd>CodeCompanionChat<cr>", mode = { "n", "v" }, desc = "New Chat" },
|
||||
{ prefix .. "A", "<cmd>CodeCompanionAdd<cr>", mode = "v", desc = "Add Code" },
|
||||
{ prefix .. "i", "<cmd>CodeCompanion<cr>", mode = "n", desc = "Inline Prompt" },
|
||||
{ prefix .. "C", "<cmd>CodeCompanionToggle<cr>", mode = "n", desc = "Toggle Chat" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
spec = {
|
||||
{ prefix, group = "ai", icon = " ", mode = { "n", "v" } },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/edgy.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
opts.right = opts.right or {}
|
||||
table.insert(opts.right, {
|
||||
ft = "codecompanion",
|
||||
title = "CodeCompanion",
|
||||
size = { width = 70 },
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
65
nvim/lua/plugins/extras/coding/ai/codeium.lua
Normal file
65
nvim/lua/plugins/extras/coding/ai/codeium.lua
Normal file
@@ -0,0 +1,65 @@
|
||||
return {
|
||||
{
|
||||
"Exafunction/codeium.vim",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
if vim.g.codeium_cmp_hide == true then
|
||||
local cmp = require("cmp")
|
||||
cmp.event:on("menu_opened", function()
|
||||
vim.g.codeium_manual = true
|
||||
vim.fn["codeium#Clear"]()
|
||||
end)
|
||||
cmp.event:on("menu_closed", function()
|
||||
vim.g.codeium_manual = false
|
||||
vim.fn["codeium#Complete"]()
|
||||
end)
|
||||
end
|
||||
|
||||
vim.g.codeium_filetypes = {
|
||||
TelescopePrompt = false,
|
||||
DressingInput = false,
|
||||
["neo-tree-popup"] = false,
|
||||
["dap-repl"] = false,
|
||||
["snacks_picker_input"] = false,
|
||||
}
|
||||
|
||||
local opts = { expr = true, silent = true }
|
||||
vim.g.codeium_disable_bindings = 1
|
||||
|
||||
vim.keymap.set("i", "<M-CR>", function()
|
||||
return vim.fn["codeium#Accept"]()
|
||||
end, opts)
|
||||
|
||||
vim.keymap.set("n", "<leader>ch", function()
|
||||
return vim.fn["codeium#Chat"]()
|
||||
end, { desc = "Chat with IA (Codeium)" })
|
||||
|
||||
vim.keymap.set("i", "<M-]>", function()
|
||||
return vim.fn["codeium#CycleCompletions"](1)
|
||||
end, opts)
|
||||
|
||||
vim.keymap.set("i", "<M-[>", function()
|
||||
return vim.fn["codeium#CycleCompletions"](-1)
|
||||
end, opts)
|
||||
|
||||
vim.keymap.set("i", "<M-c>", function()
|
||||
return vim.fn["codeium#Clear"]()
|
||||
end, opts)
|
||||
|
||||
vim.keymap.set("n", "<leader>cI", "<cmd>CodeiumToggle<cr>", { desc = "Toggle IA (Codeium)" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
local icon = require("lazyvim.config").icons.kinds.Codeium
|
||||
local function show_codeium_status()
|
||||
return icon .. vim.fn["codeium#GetStatusString"]()
|
||||
end
|
||||
|
||||
-- Insert the icon
|
||||
table.insert(opts.sections.lualine_x, 2, show_codeium_status)
|
||||
end,
|
||||
},
|
||||
}
|
||||
24
nvim/lua/plugins/extras/coding/ai/copilot.lua
Normal file
24
nvim/lua/plugins/extras/coding/ai/copilot.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
return {
|
||||
{ import = "lazyvim.plugins.extras.ai.copilot" },
|
||||
{
|
||||
"zbirenbaum/copilot.lua",
|
||||
event = "InsertEnter",
|
||||
opts = {
|
||||
suggestion = {
|
||||
enabled = true,
|
||||
auto_trigger = true,
|
||||
keymap = {
|
||||
accept = "<M-CR>",
|
||||
accept_line = "<M-l>",
|
||||
accept_word = "<M-k>",
|
||||
next = "<M-]>",
|
||||
prev = "<M-[>",
|
||||
dismiss = "<M-c>",
|
||||
},
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>cI", "<cmd>Copilot toggle<cr>", desc = "Toggle IA (Copilot)" },
|
||||
},
|
||||
},
|
||||
}
|
||||
65
nvim/lua/plugins/extras/coding/ai/gen.lua
Normal file
65
nvim/lua/plugins/extras/coding/ai/gen.lua
Normal file
@@ -0,0 +1,65 @@
|
||||
local prefix = "<leader>a"
|
||||
|
||||
return {
|
||||
{
|
||||
"jellydn/gen.nvim",
|
||||
opts = {
|
||||
model = "codellama",
|
||||
host = "localhost",
|
||||
port = "11434",
|
||||
display_mode = "split",
|
||||
show_prompt = true,
|
||||
show_model = true,
|
||||
no_auto_close = false,
|
||||
init = function(options)
|
||||
pcall(io.popen, "ollama serve > /dev/null 2>&1 &")
|
||||
end,
|
||||
command = function(options)
|
||||
local body = { model = options.model, stream = true }
|
||||
return "curl --silent --no-buffer -X POST http://"
|
||||
.. options.host
|
||||
.. ":"
|
||||
.. options.port
|
||||
.. "/api/generate -d $body"
|
||||
end,
|
||||
},
|
||||
config = function(_, opts)
|
||||
local gen = require("gen")
|
||||
gen.setup(opts)
|
||||
|
||||
gen.prompts["Elaborate_Text"] = {
|
||||
prompt = "Elaborate the following text:\n$text",
|
||||
}
|
||||
gen.prompts["Fix_Code"] = {
|
||||
prompt = "Fix the following code. Only output the result in format ```$filetype\n...\n```:\n```$filetype\n$text\n```",
|
||||
extract = "```$filetype\n(.-)```",
|
||||
}
|
||||
end,
|
||||
keys = {
|
||||
{ prefix .. "i", "<cmd>Gen<cr>", mode = { "n", "v" }, desc = "IA (Gen)" },
|
||||
{ prefix .. "g", "<cmd>Gen Generate<cr>", mode = { "n" }, desc = "Generate" },
|
||||
{ prefix .. "c", "<cmd>Gen Chat<cr>", mode = { "n" }, desc = "Chat" },
|
||||
{ prefix .. "s", "<cmd>Gen Summarize<cr>", mode = { "n", "v" }, desc = "Summarize" },
|
||||
{ prefix .. "a", "<cmd>Gen Ask<cr>", mode = { "v" }, desc = "Ask" },
|
||||
{ prefix .. "H", "<cmd>Gen Change<cr>", mode = { "v" }, desc = "Change" },
|
||||
{ prefix .. "G", "<cmd>Gen Enhance_Grammar_Spelling<cr>", mode = { "v" }, desc = "Enhance Grammar Spelling" },
|
||||
{ prefix .. "w", "<cmd>Gen Enhance_Wording<cr>", mode = { "v" }, desc = "Enhance Wording" },
|
||||
{ prefix .. "C", "<cmd>Gen Make_Concise<cr>", mode = { "v" }, desc = "Make Concise" },
|
||||
{ prefix .. "l", "<cmd>Gen Make_List<cr>", mode = { "v" }, desc = "Make List" },
|
||||
{ prefix .. "t", "<cmd>Gen Make_Table<cr>", mode = { "v" }, desc = "Make Table" },
|
||||
{ prefix .. "r", "<cmd>Gen Review_Code<cr>", mode = { "v" }, desc = "Review Code" },
|
||||
{ prefix .. "e", "<cmd>Gen Enhance_Code<cr>", mode = { "v" }, desc = "Enhance Code" },
|
||||
{ prefix .. "h", "<cmd>Gen Change_Code<cr>", mode = { "v" }, desc = "Change Code" },
|
||||
{ prefix .. "f", "<cmd>Gen Fix_Code<cr>", mode = { "v" }, desc = "Fix Code" },
|
||||
{ prefix .. "E", "<cmd>Gen Elaborate_Text<cr>", mode = { "v" }, desc = "Elaborate Text" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
spec = {
|
||||
{ prefix, group = "IA (Gen)", icon = " " },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
108
nvim/lua/plugins/extras/coding/ai/gpt.lua
Normal file
108
nvim/lua/plugins/extras/coding/ai/gpt.lua
Normal file
@@ -0,0 +1,108 @@
|
||||
local prefix = "<leader>C"
|
||||
|
||||
return {
|
||||
{
|
||||
"jackMort/ChatGPT.nvim",
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-telescope/telescope.nvim",
|
||||
},
|
||||
cond = function()
|
||||
local api_key = os.getenv("OPENAI_API_KEY")
|
||||
return api_key and api_key ~= "" and true or false
|
||||
end,
|
||||
opts = {
|
||||
edit_with_instructions = {
|
||||
diff = false,
|
||||
keymaps = {
|
||||
close = "<C-c>",
|
||||
accept = "<C-y>",
|
||||
toggle_diff = "<C-d>",
|
||||
toggle_settings = "<C-o>",
|
||||
cycle_windows = "<Tab>",
|
||||
use_output_as_input = "<C-i>",
|
||||
},
|
||||
},
|
||||
chat = {
|
||||
welcome_message = "",
|
||||
keymaps = {
|
||||
close = { "<C-c>" },
|
||||
yank_last = "<C-y>",
|
||||
yank_last_code = "<C-k>",
|
||||
scroll_up = "<C-u>",
|
||||
scroll_down = "<C-d>",
|
||||
new_session = "<C-n>",
|
||||
cycle_windows = "<Tab>",
|
||||
cycle_modes = "<C-f>",
|
||||
next_message = "<C-j>",
|
||||
prev_message = "<C-k>",
|
||||
select_session = { "<Space>", "o", "<cr>" },
|
||||
rename_session = "r",
|
||||
delete_session = "d",
|
||||
draft_message = "<C-d>",
|
||||
edit_message = "e",
|
||||
delete_message = "d",
|
||||
toggle_settings = "<C-o>",
|
||||
toggle_message_role = "<C-r>",
|
||||
toggle_system_role_open = "<C-s>",
|
||||
stop_generating = "<C-x>",
|
||||
},
|
||||
},
|
||||
openai_params = {
|
||||
model = "gpt-3.5-turbo-16k",
|
||||
-- model = "gpt-4",
|
||||
frequency_penalty = 0,
|
||||
presence_penalty = 0,
|
||||
max_tokens = 300,
|
||||
temperature = 0.3,
|
||||
top_p = 0.3,
|
||||
n = 1,
|
||||
-- temperature = 0,
|
||||
-- top_p = 1,
|
||||
},
|
||||
openai_edit_params = {
|
||||
model = "gpt-3.5-turbo-16k",
|
||||
-- model = "gpt-4",
|
||||
frequency_penalty = 0,
|
||||
presence_penalty = 0,
|
||||
temperature = 0,
|
||||
top_p = 1,
|
||||
n = 1,
|
||||
},
|
||||
show_quickfixes_cmd = "Trouble quickfix",
|
||||
-- actions_paths = { "~/.config/nvim/custom_actions.json" },
|
||||
},
|
||||
cmd = {
|
||||
"ChatGPT",
|
||||
"ChatGPTActAs",
|
||||
"ChatGPTCompleteCode",
|
||||
"ChatGPTEditWithInstructions",
|
||||
"ChatGPTRun",
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ prefix .. "c", "<cmd>ChatGPT<CR>", desc = "ChatGPT" },
|
||||
{ prefix .. "e", "<cmd>ChatGPTEditWithInstruction<CR>", desc = "Edit With Instruction", mode = { "n", "v" } },
|
||||
{ prefix .. "g", "<cmd>ChatGPTRun grammar_correction<CR>", desc = "Grammar Correction", mode = { "n", "v" } },
|
||||
{ prefix .. "t", "<cmd>ChatGPTRun translate<CR>", desc = "Translate", mode = { "n", "v" } },
|
||||
{ prefix .. "k", "<cmd>ChatGPTRun keywords<CR>", desc = "Keywords", mode = { "n", "v" } },
|
||||
{ prefix .. "d", "<cmd>ChatGPTRun docstring<CR>", desc = "Docstring", mode = { "n", "v" } },
|
||||
{ prefix .. "T", "<cmd>ChatGPTRun add_tests<CR>", desc = "Add Tests", mode = { "n", "v" } },
|
||||
{ prefix .. "o", "<cmd>ChatGPTRun optimize_code<CR>", desc = "Optimize Code", mode = { "n", "v" } },
|
||||
{ prefix .. "s", "<cmd>ChatGPTRun summarize<CR>", desc = "Summarize", mode = { "n", "v" } },
|
||||
{ prefix .. "f", "<cmd>ChatGPTRun fix_bugs<CR>", desc = "Fix Bugs", mode = { "n", "v" } },
|
||||
{ prefix .. "x", "<cmd>ChatGPTRun explain_code<CR>", desc = "Explain Code", mode = { "n", "v" } },
|
||||
{ prefix .. "r", "<cmd>ChatGPTRun roxygen_edit<CR>", desc = "Roxygen Edit", mode = { "n", "v" } },
|
||||
{ prefix .. "l", "<cmd>ChatGPTRun code_readability_analysis<CR>", desc = "Code Readability Analysis", mode = { "n", "v" }, },
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
spec = {
|
||||
{ prefix, group = "chatGPT", icon = " " },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
40
nvim/lua/plugins/extras/coding/ai/neocodeium.lua
Normal file
40
nvim/lua/plugins/extras/coding/ai/neocodeium.lua
Normal file
@@ -0,0 +1,40 @@
|
||||
return {
|
||||
"monkoose/neocodeium",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
local neocodeium = require("neocodeium")
|
||||
neocodeium.setup()
|
||||
|
||||
local commands = require("neocodeium.commands")
|
||||
if vim.g.codeium_cmp_hide == true then
|
||||
local cmp = require("cmp")
|
||||
cmp.event:on("menu_opened", function()
|
||||
commands.disable()
|
||||
neocodeium.clear()
|
||||
end)
|
||||
|
||||
cmp.event:on("menu_closed", function()
|
||||
commands.enable()
|
||||
end)
|
||||
end
|
||||
|
||||
vim.keymap.set("i", "<M-CR>", function()
|
||||
require("neocodeium").accept()
|
||||
end)
|
||||
vim.keymap.set("i", "<A-w>", function()
|
||||
require("neocodeium").accept_word()
|
||||
end)
|
||||
vim.keymap.set("i", "<A-a>", function()
|
||||
require("neocodeium").accept_line()
|
||||
end)
|
||||
vim.keymap.set("i", "<M-]>", function()
|
||||
require("neocodeium").cycle_or_complete()
|
||||
end)
|
||||
vim.keymap.set("i", "<M-[>", function()
|
||||
require("neocodeium").cycle_or_complete(-1)
|
||||
end)
|
||||
vim.keymap.set("i", "<M-c>", function()
|
||||
require("neocodeium").clear()
|
||||
end)
|
||||
end,
|
||||
}
|
||||
35
nvim/lua/plugins/extras/coding/annotation.lua
Normal file
35
nvim/lua/plugins/extras/coding/annotation.lua
Normal file
@@ -0,0 +1,35 @@
|
||||
local prefix = "<leader>A"
|
||||
|
||||
return {
|
||||
{ import = "lazyvim.plugins.extras.coding.neogen" },
|
||||
{
|
||||
"danymat/neogen",
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ prefix .. "d", function() require("neogen").generate() end, desc = "Default Annotation" },
|
||||
{ prefix .. "C", function() require("neogen").generate({ type = "class" }) end, desc = "Class" },
|
||||
{ prefix .. "f", function() require("neogen").generate({ type = "func" }) end, desc = "Function" },
|
||||
{ prefix .. "t", function() require("neogen").generate({ type = "type" }) end, desc = "Type" },
|
||||
{ prefix .. "F", function() require("neogen").generate({ type = "file" }) end, desc = "File" },
|
||||
{ "<leader>cn", false },
|
||||
},
|
||||
},
|
||||
{
|
||||
"Zeioth/dooku.nvim",
|
||||
cmd = { "DookuGenerate", "DookuOpen", "DookuAutoSetup" },
|
||||
opts = {},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ prefix .. "g", "<Cmd>DookuGenerate<CR>", desc = "Generate HTML Docs" },
|
||||
{ prefix .. "o", "<Cmd>DookuOpen<CR>", desc = "Open HTML Docs" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
spec = {
|
||||
{ prefix, group = "annotation/snippets", icon = " " },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
20
nvim/lua/plugins/extras/coding/blink-extended.lua
Normal file
20
nvim/lua/plugins/extras/coding/blink-extended.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
return {
|
||||
"saghen/blink.cmp",
|
||||
opts = {
|
||||
keymap = {
|
||||
["<C-k>"] = { "select_prev", "fallback" },
|
||||
["<C-j>"] = { "select_next", "fallback" },
|
||||
},
|
||||
completion = {
|
||||
menu = {
|
||||
border = "rounded",
|
||||
winhighlight = "Normal:BlinkCmpDoc,FloatBorder:BlinkCmpDocBorder,CursorLine:BlinkCmpDocCursorLine,Search:None",
|
||||
},
|
||||
documentation = {
|
||||
window = {
|
||||
border = "rounded",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
84
nvim/lua/plugins/extras/coding/cmp-extended.lua
Normal file
84
nvim/lua/plugins/extras/coding/cmp-extended.lua
Normal file
@@ -0,0 +1,84 @@
|
||||
local cmp = require("cmp")
|
||||
|
||||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>ciC", "<cmd>CmpStatus<CR>", desc = "Cmp Status" },
|
||||
},
|
||||
opts = function(_, opts)
|
||||
opts.mapping = cmp.mapping.preset.insert({
|
||||
["<C-j>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-k>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
["<S-CR>"] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
}), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
["<C-CR>"] = function(fallback)
|
||||
cmp.abort()
|
||||
fallback()
|
||||
end,
|
||||
})
|
||||
|
||||
opts.window = {
|
||||
completion = {
|
||||
border = "rounded",
|
||||
winhighlight = "Normal:Normal,FloatBorder:Normal,CursorLine:Visual,Search:None",
|
||||
scrollbar = false,
|
||||
col_offset = -3,
|
||||
side_padding = 1,
|
||||
},
|
||||
documentation = {
|
||||
border = "rounded",
|
||||
winhighlight = "Normal:Normal,FloatBorder:Normal,CursorLine:Visual,Search:None",
|
||||
scrollbar = false,
|
||||
},
|
||||
}
|
||||
|
||||
opts.performance = {
|
||||
debounce = 0,
|
||||
throttle = 0,
|
||||
fetching_timeout = 20,
|
||||
confirm_resolve_timeout = 20,
|
||||
async_budget = 1,
|
||||
max_view_entries = 50,
|
||||
}
|
||||
|
||||
cmp.setup.cmdline({ "/", "?" }, {
|
||||
mapping = cmp.mapping.preset.cmdline({
|
||||
["<C-j>"] = {
|
||||
c = function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
},
|
||||
["<C-k>"] = {
|
||||
c = function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
},
|
||||
}),
|
||||
sources = {
|
||||
{ name = "buffer" },
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
125
nvim/lua/plugins/extras/coding/cmp/autopairs.lua
Normal file
125
nvim/lua/plugins/extras/coding/cmp/autopairs.lua
Normal file
@@ -0,0 +1,125 @@
|
||||
return {
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
"windwp/nvim-autopairs",
|
||||
opts = {},
|
||||
},
|
||||
opts = function()
|
||||
local cmp = require("cmp")
|
||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||
local ts_utils = require("nvim-treesitter.ts_utils")
|
||||
local ts_node_func_parens_disabled = {
|
||||
-- ecma
|
||||
named_imports = true,
|
||||
-- rust
|
||||
use_declaration = true,
|
||||
}
|
||||
|
||||
local npairs = require("nvim-autopairs")
|
||||
local Rule = require("nvim-autopairs.rule")
|
||||
local cond = require("nvim-autopairs.conds")
|
||||
local brackets = { { "(", ")" }, { "[", "]" }, { "{", "}" } }
|
||||
|
||||
local default_handler = cmp_autopairs.filetypes["*"]["("].handler
|
||||
cmp_autopairs.filetypes["*"]["("].handler = function(char, item, bufnr, rules, commit_character)
|
||||
local node_type = ts_utils.get_node_at_cursor():type()
|
||||
if ts_node_func_parens_disabled[node_type] then
|
||||
if item.data then
|
||||
item.data.funcParensDisabled = true
|
||||
else
|
||||
char = ""
|
||||
end
|
||||
end
|
||||
default_handler(char, item, bufnr, rules, commit_character)
|
||||
end
|
||||
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||
|
||||
npairs.add_rules({
|
||||
-- Rule for a pair with left-side ' ' and right side ' '
|
||||
Rule(" ", " ")
|
||||
-- Pair will only occur if the conditional function returns true
|
||||
:with_pair(function(opts)
|
||||
-- We are checking if we are inserting a space in (), [], or {}
|
||||
local pair = opts.line:sub(opts.col - 1, opts.col)
|
||||
return vim.tbl_contains({
|
||||
brackets[1][1] .. brackets[1][2],
|
||||
brackets[2][1] .. brackets[2][2],
|
||||
brackets[3][1] .. brackets[3][2],
|
||||
}, pair)
|
||||
end)
|
||||
:with_move(cond.none())
|
||||
:with_cr(cond.none())
|
||||
-- We only want to delete the pair of spaces when the cursor is as such: ( | )
|
||||
:with_del(
|
||||
function(opts)
|
||||
local col = vim.api.nvim_win_get_cursor(0)[2]
|
||||
local context = opts.line:sub(col - 1, col + 2)
|
||||
return vim.tbl_contains({
|
||||
brackets[1][1] .. " " .. brackets[1][2],
|
||||
brackets[2][1] .. " " .. brackets[2][2],
|
||||
brackets[3][1] .. " " .. brackets[3][2],
|
||||
}, context)
|
||||
end
|
||||
),
|
||||
|
||||
-- Javascript arrow key
|
||||
Rule("%(.*%)%s*%=>$", " { }", { "typescript", "typescriptreact", "javascript" })
|
||||
:use_regex(true)
|
||||
:set_end_pair_length(2),
|
||||
|
||||
-- Auto addspace on =
|
||||
Rule("=", "")
|
||||
:with_pair(cond.not_inside_quote())
|
||||
:with_pair(function(opts)
|
||||
local last_char = opts.line:sub(opts.col - 1, opts.col - 1)
|
||||
if last_char:match("[%w%=%s]") then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end)
|
||||
:replace_endpair(function(opts)
|
||||
local prev_2char = opts.line:sub(opts.col - 2, opts.col - 1)
|
||||
local next_char = opts.line:sub(opts.col, opts.col)
|
||||
next_char = next_char == " " and "" or " "
|
||||
if prev_2char:match("%w$") then
|
||||
return "<bs> =" .. next_char
|
||||
end
|
||||
if prev_2char:match("%=$") then
|
||||
return next_char
|
||||
end
|
||||
if prev_2char:match("=") then
|
||||
return "<bs><bs>=" .. next_char
|
||||
end
|
||||
return ""
|
||||
end)
|
||||
:set_end_pair_length(0)
|
||||
:with_move(cond.none())
|
||||
:with_del(cond.none()),
|
||||
})
|
||||
|
||||
-- For each pair of brackets we will add another rule
|
||||
for _, bracket in pairs(brackets) do
|
||||
npairs.add_rules({
|
||||
-- Each of these rules is for a pair with left-side '( ' and right-side ' )' for each bracket type
|
||||
Rule(bracket[1] .. " ", " " .. bracket[2])
|
||||
:with_pair(cond.none())
|
||||
:with_move(function(opts)
|
||||
return opts.char == bracket[2]
|
||||
end)
|
||||
:with_del(cond.none())
|
||||
:use_key(bracket[2])
|
||||
-- Removes the trailing whitespace that can occur without this
|
||||
:replace_map_cr(function(_)
|
||||
return "<C-c>2xi<CR><C-c>O"
|
||||
end),
|
||||
})
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"echasnovski/mini.pairs",
|
||||
enabled = false,
|
||||
},
|
||||
}
|
||||
9
nvim/lua/plugins/extras/coding/cmp/dotenv.lua
Normal file
9
nvim/lua/plugins/extras/coding/cmp/dotenv.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
"SergioRibera/cmp-dotenv",
|
||||
},
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sources, { name = "dotenv" })
|
||||
end,
|
||||
}
|
||||
9
nvim/lua/plugins/extras/coding/cmp/emoji.lua
Normal file
9
nvim/lua/plugins/extras/coding/cmp/emoji.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-emoji",
|
||||
},
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sources, { name = "emoji" })
|
||||
end,
|
||||
}
|
||||
9
nvim/lua/plugins/extras/coding/cmp/fonts.lua
Normal file
9
nvim/lua/plugins/extras/coding/cmp/fonts.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
"amarakon/nvim-cmp-fonts",
|
||||
},
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sources, { name = "fonts", option = { space_filter = "-" } })
|
||||
end,
|
||||
}
|
||||
9
nvim/lua/plugins/extras/coding/cmp/nerd-fonts.lua
Normal file
9
nvim/lua/plugins/extras/coding/cmp/nerd-fonts.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
"chrisgrieser/cmp-nerdfont",
|
||||
},
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sources, { name = "nerdfont" })
|
||||
end,
|
||||
}
|
||||
12
nvim/lua/plugins/extras/coding/cmp/npm.lua
Normal file
12
nvim/lua/plugins/extras/coding/cmp/npm.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
"David-Kunz/cmp-npm",
|
||||
dependencies = "nvim-lua/plenary.nvim",
|
||||
ft = "json",
|
||||
opts = {},
|
||||
},
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sources, { name = "npm", keyword_length = 4 })
|
||||
end,
|
||||
}
|
||||
9
nvim/lua/plugins/extras/coding/cmp/rg.lua
Normal file
9
nvim/lua/plugins/extras/coding/cmp/rg.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
"lukas-reineke/cmp-rg",
|
||||
},
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sources, { name = "rg", keyword_length = 3 })
|
||||
end,
|
||||
}
|
||||
9
nvim/lua/plugins/extras/coding/cmp/under-comparator.lua
Normal file
9
nvim/lua/plugins/extras/coding/cmp/under-comparator.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
"lukas-reineke/cmp-under-comparator",
|
||||
},
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sorting.comparators, 4, require("cmp-under-comparator").under)
|
||||
end,
|
||||
}
|
||||
9
nvim/lua/plugins/extras/coding/cmp/yanky.lua
Normal file
9
nvim/lua/plugins/extras/coding/cmp/yanky.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
"chrisgrieser/cmp_yanky",
|
||||
},
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sources, { name = "cmp_yanky" })
|
||||
end,
|
||||
}
|
||||
36
nvim/lua/plugins/extras/coding/debugprint.lua
Normal file
36
nvim/lua/plugins/extras/coding/debugprint.lua
Normal file
@@ -0,0 +1,36 @@
|
||||
local prefix = "<leader>dd"
|
||||
|
||||
return {
|
||||
{
|
||||
"andrewferrier/debugprint.nvim",
|
||||
opts = {
|
||||
create_keymaps = false,
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ prefix .. "l", function() return require("debugprint").debugprint() end, desc = "Under Line", expr = true },
|
||||
{ prefix .. "L", function() return require("debugprint").debugprint({ above = true }) end, desc = "Above Line", expr = true },
|
||||
{
|
||||
prefix .. "v",
|
||||
function() return require("debugprint").debugprint({ variable = true }) end,
|
||||
desc = "Variable Under Line",
|
||||
expr = true,
|
||||
},
|
||||
{
|
||||
prefix .. "V",
|
||||
function() return require("debugprint").debugprint({ above = true, variable = true }) end,
|
||||
desc = "Variable Above Line",
|
||||
expr = true,
|
||||
},
|
||||
{ prefix .. "d", function() return require("debugprint").deleteprints() end, desc = "Delete All" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
spec = {
|
||||
{ prefix, group = "debugPrint", icon = " " },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
5
nvim/lua/plugins/extras/coding/ibus.lua
Normal file
5
nvim/lua/plugins/extras/coding/ibus.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
"kevinhwang91/nvim-ibus-sw",
|
||||
event = "InsertLeave",
|
||||
opts = {},
|
||||
}
|
||||
32
nvim/lua/plugins/extras/coding/luasnip-extended.lua
Normal file
32
nvim/lua/plugins/extras/coding/luasnip-extended.lua
Normal file
@@ -0,0 +1,32 @@
|
||||
return {
|
||||
{ import = "lazyvim.plugins.extras.coding.luasnip" },
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
dependencies = {
|
||||
"rafamadriz/friendly-snippets",
|
||||
config = function()
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
require("luasnip").filetype_extend("typescript", { "tsdoc" })
|
||||
require("luasnip").filetype_extend("typescript", { "next-ts" })
|
||||
require("luasnip").filetype_extend("javascript", { "jsdoc" })
|
||||
require("luasnip").filetype_extend("javascript", { "next" })
|
||||
require("luasnip").filetype_extend("lua", { "luadoc" })
|
||||
require("luasnip").filetype_extend("python", { "pydoc" })
|
||||
require("luasnip").filetype_extend("rust", { "rustdoc" })
|
||||
require("luasnip").filetype_extend("cs", { "csharpdoc" })
|
||||
require("luasnip").filetype_extend("java", { "javadoc" })
|
||||
require("luasnip").filetype_extend("c", { "cdoc" })
|
||||
require("luasnip").filetype_extend("cpp", { "cppdoc" })
|
||||
require("luasnip").filetype_extend("php", { "phpdoc" })
|
||||
require("luasnip").filetype_extend("kotlin", { "kdoc" })
|
||||
require("luasnip").filetype_extend("ruby", { "rdoc" })
|
||||
require("luasnip").filetype_extend("sh", { "shelldoc" })
|
||||
require("luasnip.loaders.from_vscode").lazy_load({ paths = vim.fn.stdpath("config") .. "/snippets" })
|
||||
end,
|
||||
},
|
||||
},
|
||||
{
|
||||
"garymjr/nvim-snippets",
|
||||
enabled = false,
|
||||
},
|
||||
}
|
||||
48
nvim/lua/plugins/extras/coding/multicursor.lua
Normal file
48
nvim/lua/plugins/extras/coding/multicursor.lua
Normal file
@@ -0,0 +1,48 @@
|
||||
return {
|
||||
{
|
||||
"smoka7/multicursors.nvim",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"smoka7/hydra.nvim",
|
||||
},
|
||||
cmd = { "MCstart", "MCvisual", "MCclear", "MCpattern", "MCvisualPattern", "MCunderCursor" },
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ mode = { "v", "n" }, "<leader>M", "<cmd>MCstart<cr>", desc = "Multicursor" },
|
||||
},
|
||||
opts = {
|
||||
hint_config = {
|
||||
border = "rounded",
|
||||
position = "bottom-right",
|
||||
},
|
||||
generate_hints = {
|
||||
normal = true,
|
||||
insert = true,
|
||||
extend = true,
|
||||
config = {
|
||||
column_count = 1,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
local function is_active()
|
||||
local ok, hydra = pcall(require, "hydra.statusline")
|
||||
return ok and hydra.is_active()
|
||||
end
|
||||
|
||||
local function get_name()
|
||||
local ok, hydra = pcall(require, "hydra.statusline")
|
||||
if ok then
|
||||
return hydra.get_name()
|
||||
end
|
||||
return ""
|
||||
end
|
||||
|
||||
table.insert(opts.sections.lualine_b, { get_name, cond = is_active })
|
||||
end,
|
||||
},
|
||||
}
|
||||
34
nvim/lua/plugins/extras/coding/recorder.lua
Normal file
34
nvim/lua/plugins/extras/coding/recorder.lua
Normal file
@@ -0,0 +1,34 @@
|
||||
return {
|
||||
{
|
||||
"chrisgrieser/nvim-recorder",
|
||||
event = "VeryLazy",
|
||||
vscode = true,
|
||||
keys = {
|
||||
{ "q", desc = "Start Recording" },
|
||||
{ "Q", desc = "Play Recording" },
|
||||
{ "<C-q>", desc = "Switch Slot" },
|
||||
{ "cq", desc = "Edit Macro" },
|
||||
{ "yq", desc = "Yank Macro" },
|
||||
{ "dq", desc = "Delete All Macros" },
|
||||
},
|
||||
opts = {
|
||||
useNerdFontsIcons = false,
|
||||
slots = { "a", "b", "c", "d" },
|
||||
mapping = {
|
||||
startStopRecording = "q",
|
||||
playMacro = "Q",
|
||||
editMacro = "cq",
|
||||
switchSlot = "<C-q>",
|
||||
deleteAllMacros = "dq",
|
||||
yankMacro = "yq",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sections.lualine_x, require("recorder").displaySlots)
|
||||
end,
|
||||
},
|
||||
}
|
||||
23
nvim/lua/plugins/extras/coding/snippets.lua
Normal file
23
nvim/lua/plugins/extras/coding/snippets.lua
Normal file
@@ -0,0 +1,23 @@
|
||||
local prefix = "<leader>a"
|
||||
|
||||
return {
|
||||
{
|
||||
"chrisgrieser/nvim-scissors",
|
||||
opts = {
|
||||
jsonFormatter = "jq",
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ prefix .. "S", function() require("scissors").editSnippet() end, desc = "Edit Snippets" },
|
||||
{ prefix .. "s", mode = { "n", "v" }, function() require("scissors").addNewSnippet() end, desc = "Add Snippets" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
spec = {
|
||||
{ prefix, group = "annotation/snippets", icon = " " },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
71
nvim/lua/plugins/extras/coding/sniprun.lua
Normal file
71
nvim/lua/plugins/extras/coding/sniprun.lua
Normal file
@@ -0,0 +1,71 @@
|
||||
local prefix = "<leader>cu"
|
||||
|
||||
return {
|
||||
{
|
||||
"michaelb/sniprun",
|
||||
run = "bash ./install.sh",
|
||||
cmd = { "SnipRun", "SnipInfo", "SnipLive", "SnipClose", "SnipReset", "SnipReplMemoryClean" },
|
||||
opts = {
|
||||
selected_interpreters = {}, --# use those instead of the default for the current filetype
|
||||
repl_enable = { "javascript", "typescript" }, --# enable REPL-like behavior for the given interpreters
|
||||
repl_disable = {}, --# disable REPL-like behavior for the given interpreters
|
||||
|
||||
interpreter_options = {
|
||||
GFM_original = {
|
||||
use_on_filetypes = { "markdown.pandoc" }, --# the 'use_on_filetypes' configuration key is
|
||||
},
|
||||
Python3_original = {
|
||||
error_truncate = "auto", --# Truncate runtime errors 'long', 'short' or 'auto'
|
||||
},
|
||||
},
|
||||
|
||||
display = {
|
||||
"VirtualText", --# display results as virtual text
|
||||
},
|
||||
|
||||
live_display = { "VirtualTextOk" }, --# display mode used in live_mode
|
||||
|
||||
display_options = {
|
||||
terminal_scrollback = vim.o.scrollback, --# change terminal display scrollback lines
|
||||
terminal_line_number = false, --# whether show line number in terminal window
|
||||
terminal_signcolumn = false, --# whether show signcolumn in terminal window
|
||||
terminal_persistence = true, --# always keep the terminal open (true) or close it at every occasion (false)
|
||||
terminal_width = 45, --# change the terminal display option width
|
||||
notification_timeout = 5, --# timeout for nvim_notify output
|
||||
},
|
||||
|
||||
--# You can use the same keys to customize whether a sniprun producing
|
||||
--# no output should display nothing or '(no output)'
|
||||
show_no_output = {
|
||||
"Classic",
|
||||
"TempFloatingWindow", --# implies LongTempFloatingWindow, which has no effect on its own
|
||||
},
|
||||
|
||||
live_mode_toggle = "off", --# live mode toggle, see Usage - Running for more info
|
||||
|
||||
inline_messages = false, --# inline_message (0/1) is a one-line way to display messages
|
||||
|
||||
borders = "single", --# display borders around floating windows
|
||||
--# possible values are 'none', 'single', 'double', or 'shadow'
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ prefix .. "r", "<cmd>SnipRun<cr>", desc = "Run" },
|
||||
{ "<F6>", "<cmd>SnipRun<cr>", desc = "Run" },
|
||||
{ prefix .. "r", function() require("sniprun").run("v") end, mode = { "v" }, desc = "Run" },
|
||||
{ "<F6>", function() require("sniprun").run("v") end, mode = { "v" }, desc = "Run" },
|
||||
{ prefix .. "i", function() require("sniprun").info() end, desc = "Info" },
|
||||
{ prefix .. "R", function() require("sniprun").reset() end, desc = "Reset" },
|
||||
{ "<S-F6>", function() require("sniprun").reset() end, desc = "Reset" },
|
||||
{ prefix .. "l", function() require("sniprun.live_mode").toggle() end, desc = "Live" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
spec = {
|
||||
{ prefix, group = "runner", icon = " " },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
11
nvim/lua/plugins/extras/coding/treesitter/auto-indent.lua
Normal file
11
nvim/lua/plugins/extras/coding/treesitter/auto-indent.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
return {
|
||||
"vidocqh/auto-indent.nvim",
|
||||
event = "LazyFile",
|
||||
opts = {
|
||||
---@param lnum: number
|
||||
---@return number
|
||||
indentexpr = function(lnum)
|
||||
return require("nvim-treesitter.indent").get_indent(lnum)
|
||||
end,
|
||||
},
|
||||
}
|
||||
11
nvim/lua/plugins/extras/coding/treesitter/endwise.lua
Normal file
11
nvim/lua/plugins/extras/coding/treesitter/endwise.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
dependencies = {
|
||||
"RRethy/nvim-treesitter-endwise",
|
||||
},
|
||||
opts = {
|
||||
endwise = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
"nmac427/guess-indent.nvim",
|
||||
event = "LazyFile",
|
||||
opts = {},
|
||||
}
|
||||
9
nvim/lua/plugins/extras/coding/treesitter/mini-align.lua
Normal file
9
nvim/lua/plugins/extras/coding/treesitter/mini-align.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
"echasnovski/mini.align",
|
||||
opts = {},
|
||||
vscode = true,
|
||||
keys = {
|
||||
{ "ga", mode = { "n", "v" }, desc = "Align" },
|
||||
{ "gA", mode = { "n", "v" }, desc = "Align Preview" },
|
||||
},
|
||||
}
|
||||
10
nvim/lua/plugins/extras/coding/treesitter/node-action.lua
Normal file
10
nvim/lua/plugins/extras/coding/treesitter/node-action.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
return {
|
||||
"ckolkey/ts-node-action",
|
||||
dependencies = { "nvim-treesitter" },
|
||||
vscode = true,
|
||||
opts = {},
|
||||
--stylua: ignore
|
||||
keys = {
|
||||
{ "J", "<cmd>NodeAction<cr>", mode = "n", desc = "Node action" }
|
||||
},
|
||||
}
|
||||
4
nvim/lua/plugins/extras/coding/treesitter/puppeteer.lua
Normal file
4
nvim/lua/plugins/extras/coding/treesitter/puppeteer.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
dependencies = { "chrisgrieser/nvim-puppeteer" },
|
||||
}
|
||||
14
nvim/lua/plugins/extras/coding/treesitter/sibling-swap.lua
Normal file
14
nvim/lua/plugins/extras/coding/treesitter/sibling-swap.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
return {
|
||||
"Wansmer/sibling-swap.nvim",
|
||||
dependencies = "nvim-treesitter/nvim-treesitter",
|
||||
vscode = true,
|
||||
opts = {
|
||||
use_default_keymaps = false,
|
||||
highlight_node_at_cursor = true,
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<C-.>", function() require("sibling-swap").swap_with_right() end, desc = "Move Node Right" },
|
||||
{ "<C-,>", function() require("sibling-swap").swap_with_left() end, desc = "Move Node Left" },
|
||||
},
|
||||
}
|
||||
12
nvim/lua/plugins/extras/coding/treesitter/spider.lua
Normal file
12
nvim/lua/plugins/extras/coding/treesitter/spider.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
return {
|
||||
"chrisgrieser/nvim-spider",
|
||||
opts = {},
|
||||
vscode = true,
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "e", mode = { "n", "o", "x" }, function() require("spider").motion("e") end, desc = "Spider-e" },
|
||||
{ "w", mode = { "n", "o", "x" }, function() require("spider").motion("w") end, desc = "Spider-w" },
|
||||
{ "b", mode = { "n", "o", "x" }, function() require("spider").motion("b") end, desc = "Spider-b" },
|
||||
{ "E", mode = { "n", "x", "o" }, function() require("spider").motion("ge") end, desc = "Spider-E" },
|
||||
},
|
||||
}
|
||||
12
nvim/lua/plugins/extras/coding/treesitter/text-case.lua
Normal file
12
nvim/lua/plugins/extras/coding/treesitter/text-case.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
return {
|
||||
"johmsalas/text-case.nvim",
|
||||
config = function()
|
||||
require("textcase").setup()
|
||||
LazyVim.on_load("telescope.nvim", function()
|
||||
require("telescope").load_extension("lazy")
|
||||
end)
|
||||
end,
|
||||
keys = {
|
||||
{ "gC", "<cmd>TextCaseOpenTelescope<CR>", mode = { "n", "v" }, desc = "Text Case" },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
return {
|
||||
"chrisgrieser/nvim-various-textobjs",
|
||||
opts = {
|
||||
keymaps = {
|
||||
useDefaults = false,
|
||||
},
|
||||
},
|
||||
vscode = true,
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "im", ft = { "markdown", "toml" }, mode = { "o", "x" }, function() require("various-textobjs").mdlink("inner") end, desc = "Markdown Link" },
|
||||
{ "am", ft = { "markdown", "toml" }, mode = { "o", "x" }, function() require("various-textobjs").mdlink("outer") end, desc = "Markdown Link" },
|
||||
{ "iC", ft = { "markdown" }, mode = { "o", "x" }, function() require("various-textobjs").mdFencedCodeBlock("inner") end, desc = "CodeBlock" },
|
||||
{ "aC", ft = { "markdown" }, mode = { "o", "x" }, function() require("various-textobjs").mdFencedCodeBlock("outer") end, desc = "CodeBlock" },
|
||||
{ "ie", ft = { "markdown" }, mode = { "o", "x" }, function() require("various-textobjs").mdEmphasis("inner") end, desc = "Emphasis" },
|
||||
{ "ae", ft = { "markdown" }, mode = { "o", "x" }, function() require("various-textobjs").mdEmphasis("outer") end, desc = "Emphasis" },
|
||||
{ "gd", mode = { "o", "x" }, function() require("various-textobjs").diagnostics() end, desc = "Diagnostics" },
|
||||
{ "iy", ft = { "python" }, mode = { "o", "x" }, function() require("various-textobjs").pyTripleQuotes("inner") end, desc = "Triple Quotes" },
|
||||
{ "ay", ft = { "python" }, mode = { "o", "x" }, function() require("various-textobjs").pyTripleQuotes("outer") end, desc = "Triple Quotes" },
|
||||
{ "iC", ft = { "css", "scss", "less" }, mode = { "o", "x" }, function() require("various-textobjs").cssSelector("inner") end, desc = "CSS Selector" },
|
||||
{ "aC", ft = { "css", "scss", "less" }, mode = { "o", "x" }, function() require("various-textobjs").cssSelector("outer") end, desc = "CSS Selector" },
|
||||
{ "i#", ft = { "css", "scss", "less" }, mode = { "o", "x" }, function() require("various-textobjs").cssColor("inner") end, desc = "CSS Color" },
|
||||
{ "a#", ft = { "css", "scss", "less" }, mode = { "o", "x" }, function() require("various-textobjs").cssColor("outer") end, desc = "CSS Color" },
|
||||
{ "iP", ft = { "sh" }, mode = { "o", "x" }, function() require("various-textobjs").shellPipe("inner") end, desc = "Pipe" },
|
||||
{ "aP", ft = { "sh" }, mode = { "o", "x" }, function() require("various-textobjs").shellPipe("outer") end, desc = "Pipe" },
|
||||
{ "iH", ft = { "html, xml, css, scss, less" }, mode = { "o", "x" }, function() require("various-textobjs").htmlAttribute("inner") end, desc = "HTML Attribute" },
|
||||
{ "iv", mode = { "o", "x" }, function() require("various-textobjs").value("inner") end, desc = "Value" },
|
||||
{ "av", mode = { "o", "x" }, function() require("various-textobjs").value("outer") end, desc = "Value" },
|
||||
{ "ik", mode = { "o", "x" }, function() require("various-textobjs").key("inner") end, desc = "Key" },
|
||||
{ "ak", mode = { "o", "x" }, function() require("various-textobjs").key("outer") end, desc = "Key" },
|
||||
{ "L", mode = { "o", "x" }, function() require("various-textobjs").url() end, desc = "Link" },
|
||||
{ "iN", mode = { "o", "x" }, function() require("various-textobjs").number("inner") end, desc = "Number" },
|
||||
{ "aN", mode = { "o", "x" }, function() require("various-textobjs").number("outer") end, desc = "Number" },
|
||||
},
|
||||
}
|
||||
6
nvim/lua/plugins/extras/coding/treesitter/wildfire.lua
Normal file
6
nvim/lua/plugins/extras/coding/treesitter/wildfire.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
return {
|
||||
"sustech-data/wildfire.nvim",
|
||||
event = "BufEnter",
|
||||
vscode = true,
|
||||
opts = {},
|
||||
}
|
||||
12
nvim/lua/plugins/extras/coding/ultimate-autopair.lua
Normal file
12
nvim/lua/plugins/extras/coding/ultimate-autopair.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
return {
|
||||
{
|
||||
"altermo/ultimate-autopair.nvim",
|
||||
event = { "InsertEnter", "CmdlineEnter" },
|
||||
branch = "v0.6", --recomended as each new version will have breaking changes
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"echasnovski/mini.pairs",
|
||||
enabled = false,
|
||||
},
|
||||
}
|
||||
45
nvim/lua/plugins/extras/coding/yanky-extended.lua
Normal file
45
nvim/lua/plugins/extras/coding/yanky-extended.lua
Normal file
@@ -0,0 +1,45 @@
|
||||
return {
|
||||
{ import = "lazyvim.plugins.extras.coding.yanky" },
|
||||
{
|
||||
"gbprod/yanky.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.highlight = { timer = 250 }
|
||||
|
||||
if LazyVim.has("telescope.nvim") then
|
||||
local utils = require("yanky.utils")
|
||||
local mapping = require("yanky.telescope.mapping")
|
||||
opts.picker = {
|
||||
telescope = {
|
||||
use_default_mappings = false,
|
||||
mappings = {
|
||||
default = mapping.put("p"),
|
||||
i = {
|
||||
["<c-g>"] = mapping.put("p"),
|
||||
["<c-h>"] = mapping.put("P"),
|
||||
["<c-x>"] = mapping.delete(),
|
||||
["<c-r>"] = mapping.set_register(utils.get_default_register()),
|
||||
},
|
||||
n = {
|
||||
p = mapping.put("p"),
|
||||
P = mapping.put("P"),
|
||||
d = mapping.delete(),
|
||||
r = mapping.set_register(utils.get_default_register()),
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<leader>sy",
|
||||
function()
|
||||
vim.cmd([[YankyRingHistory]])
|
||||
end,
|
||||
mode = { "n", "v" },
|
||||
desc = "Yank History",
|
||||
},
|
||||
{ "<leader>p", mode = { "n", "x" }, false },
|
||||
},
|
||||
},
|
||||
}
|
||||
33
nvim/lua/plugins/extras/dap/core-extended.lua
Normal file
33
nvim/lua/plugins/extras/dap/core-extended.lua
Normal file
@@ -0,0 +1,33 @@
|
||||
return {
|
||||
{ import = "lazyvim.plugins.extras.dap.core" },
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
opts = {
|
||||
defaults = {
|
||||
fallback = {
|
||||
external_terminal = {
|
||||
command = "/usr/bin/kitty",
|
||||
args = { "--class", "kitty-dap", "--hold", "--detach", "nvim-dap", "-c", "DAP" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<F5>", function() require("dap").continue() end, desc = "Debug: Continue" },
|
||||
{ "<F10>", function() require("dap").step_over() end, desc = "Debug: Step over" },
|
||||
{ "<F11>", function() require("dap").step_into() end, desc = "Debug: Step into" },
|
||||
{ "<F12>", function() require("dap").step_out() end, desc = "Debug: Step out" },
|
||||
{ "<F2>", function() require("dap").toggle_breakpoint() end, desc = "Debug: Toggle breakpoint" },
|
||||
{ "<S-F2>", function() require("dap").set_breakpoint(vim.fn.input('Breakpoint condition: ')) end, desc = "Breakpoint Condition" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-neotest/neotest",
|
||||
optional = true,
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>tL", function() require("neotest").run.run_last({ strategy = "dap" }) end, desc = "Debug Last Test" },
|
||||
},
|
||||
},
|
||||
}
|
||||
35
nvim/lua/plugins/extras/dap/persistent-breakpoints.lua
Normal file
35
nvim/lua/plugins/extras/dap/persistent-breakpoints.lua
Normal file
@@ -0,0 +1,35 @@
|
||||
local prefix = "<leader>db"
|
||||
|
||||
return {
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
optional = true,
|
||||
vscode = false,
|
||||
dependencies = {
|
||||
"Weissle/persistent-breakpoints.nvim",
|
||||
vscode = false,
|
||||
event = "LazyFile",
|
||||
keys = {
|
||||
{ prefix .. "d", "<cmd>PBClearAllBreakpoints<cr>", desc = "Delete All Breakpoints" },
|
||||
{ prefix .. "B", "<cmd>PBSetConditionalBreakpoint<cr>", desc = "Breakpoint Condition" },
|
||||
{ prefix .. "b", "<cmd>PBToggleBreakpoint<cr>", desc = "Toggle Breakpoint" },
|
||||
{ "<F2>", "<cmd>PBToggleBreakpoint<cr>", desc = "Toggle Breakpoint" },
|
||||
},
|
||||
opts = {
|
||||
load_breakpoints_event = { "BufReadPost" },
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{ "<F2>", false },
|
||||
{ "<leader>dB", false },
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
spec = {
|
||||
{ prefix, group = "breakpoints", icon = " " },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
12
nvim/lua/plugins/extras/dap/repl-highlights.lua
Normal file
12
nvim/lua/plugins/extras/dap/repl-highlights.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
dependencies = {
|
||||
"LiadOz/nvim-dap-repl-highlights",
|
||||
opts = {},
|
||||
},
|
||||
opts = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "dap_repl" })
|
||||
end
|
||||
end,
|
||||
}
|
||||
17
nvim/lua/plugins/extras/dap/telescope.lua
Normal file
17
nvim/lua/plugins/extras/dap/telescope.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
return {
|
||||
"nvim-telescope/telescope-dap.nvim",
|
||||
cond = LazyVim.has("nvim-dap"),
|
||||
config = function()
|
||||
LazyVim.on_load("telescope.nvim", function()
|
||||
require("telescope").load_extension("dap")
|
||||
end)
|
||||
end,
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>dm", "<cmd>Telescope dap commands<CR>", desc = "Commands" },
|
||||
{ "<leader>df", "<cmd>Telescope dap frames<CR>", desc = "Frames" },
|
||||
{ "<leader>dG", "<cmd>Telescope dap configurations<CR>", desc = "Configurations" },
|
||||
{ "<leader>dbL", "<cmd>Telescope dap list_breakpoints<CR>", desc = "List Breakpoints" },
|
||||
{ "<leader>dv", "<cmd>Telescope dap variables<CR>", desc = "Variables" },
|
||||
},
|
||||
}
|
||||
5
nvim/lua/plugins/extras/editor/carbon-now.lua
Normal file
5
nvim/lua/plugins/extras/editor/carbon-now.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
"kristijanhusak/vim-carbon-now-sh",
|
||||
cmd = "CarbonNowSh",
|
||||
vscode = true,
|
||||
}
|
||||
16
nvim/lua/plugins/extras/editor/ccc.lua
Normal file
16
nvim/lua/plugins/extras/editor/ccc.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
return {
|
||||
"uga-rosa/ccc.nvim",
|
||||
ft = { "html", "javascript", "typescript", "javascriptreact", "typescriptreact", "css", "scss", "sh" },
|
||||
cmd = { "CccPick", "CccConvert", "CccHighlighterEnable", "CccHighlighterDisable", "CccHighlighterToggle" },
|
||||
keys = {
|
||||
{ "<leader>up", "<cmd>CccHighlighterToggle<cr>", desc = "Toggle Paint/Colorizer" },
|
||||
{ "<A-C>", "<cmd>CccConvert<cr>", desc = "Convert color" },
|
||||
{ "<S-c>", "<cmd>CccPick<cr>", desc = "Pick Color" },
|
||||
},
|
||||
opts = {
|
||||
highlighter = {
|
||||
auto_enable = true,
|
||||
lsp = true,
|
||||
},
|
||||
},
|
||||
}
|
||||
19
nvim/lua/plugins/extras/editor/codesnap.lua
Normal file
19
nvim/lua/plugins/extras/editor/codesnap.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
return {
|
||||
"mistricky/codesnap.nvim",
|
||||
build = "make",
|
||||
cmd = { "CodeSnap", "CodeSnapSave" },
|
||||
vscode = false,
|
||||
keys = {
|
||||
{ "<leader>cs", mode = "v", "<cmd>'<,'>CodeSnap<cr>", desc = "Screenshot (Clipboard)" },
|
||||
{ "<leader>cS", mode = "v", "<cmd>'<,'>CodeSnapSave<cr>", desc = "Screenshot (Save)" },
|
||||
},
|
||||
cond = vim.env.KITTY_SCROLLBACK_NVIM == nil,
|
||||
opts = {
|
||||
save_path = (os.getenv("HOME") .. "/pictures/screenshots/code"),
|
||||
title = "CodeSnap.nvim",
|
||||
code_font_family = "JetBrainsMono Nerd Font",
|
||||
watermark_font_family = "JetBrainsMono Nerd Font",
|
||||
watermark = "",
|
||||
bg_theme = "summer",
|
||||
},
|
||||
}
|
||||
40
nvim/lua/plugins/extras/editor/compiler.lua
Normal file
40
nvim/lua/plugins/extras/editor/compiler.lua
Normal file
@@ -0,0 +1,40 @@
|
||||
return {
|
||||
{
|
||||
"Zeioth/compiler.nvim",
|
||||
cmd = { "CompilerOpen", "CompilerToggleResults", "CompilerRedo" },
|
||||
dependencies = { "stevearc/overseer.nvim" },
|
||||
opts = {},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<F3>", "<cmd>CompilerOpen<cr>", desc = "Open Compiler" },
|
||||
{ "<S-F3>", function() vim.cmd("CompilerStop") vim.cmd("CompilerRedo") end, desc = "Redo Compiler" },
|
||||
{ "<F4>", "<cmd>CompilerToggleResults<cr>", desc = "Toggle Compiler Results" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"stevearc/overseer.nvim",
|
||||
cmd = {
|
||||
"OverseerOpen",
|
||||
"OverseerClose",
|
||||
"OverseerToggle",
|
||||
"OverseerSaveBundle",
|
||||
"OverseerLoadBundle",
|
||||
"OverseerDeleteBundle",
|
||||
"OverseerRunCmd",
|
||||
"OverseerRun",
|
||||
"OverseerInfo",
|
||||
"OverseerBuild",
|
||||
"OverseerQuickAction",
|
||||
"OverseerTaskAction ",
|
||||
"OverseerClearCache",
|
||||
},
|
||||
opts = {
|
||||
task_list = {
|
||||
direction = "bottom",
|
||||
min_height = 15,
|
||||
max_height = 15,
|
||||
default_detail = 1,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
34
nvim/lua/plugins/extras/editor/dev-container.lua
Normal file
34
nvim/lua/plugins/extras/editor/dev-container.lua
Normal file
@@ -0,0 +1,34 @@
|
||||
local prefix = "<leader>o"
|
||||
|
||||
return {
|
||||
{
|
||||
"https://codeberg.org/esensar/nvim-dev-container",
|
||||
cmd = {
|
||||
"DevcontainerStart",
|
||||
"DevcontainerStop",
|
||||
"DevcontainerLogs",
|
||||
"DevcontainerEditNearestConfig",
|
||||
"DevcontainerAttach",
|
||||
"DevcontainerExec",
|
||||
"DevcontainerStopAll",
|
||||
"DevcontainerRemoveAll",
|
||||
},
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
||||
opts = {},
|
||||
keys = {
|
||||
{ prefix .. "s", "<cmd>DevcontainerStart<cr>", desc = "Start" },
|
||||
{ prefix .. "S", "<cmd>DevcontainerStop<cr>", desc = "Stop" },
|
||||
{ prefix .. "l", "<cmd>DevcontainerLogs<cr>", desc = "Log" },
|
||||
{ prefix .. "c", "<cmd>DevcontainerEditNearestConfig<cr>", desc = "Config" },
|
||||
{ prefix .. "a", "<cmd>DevcontainerAttach<cr>", desc = "Attach" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
spec = {
|
||||
{ "<leader><S-Tab>", group = "containers", icon = " " },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
45
nvim/lua/plugins/extras/editor/docs/devdocs.lua
Normal file
45
nvim/lua/plugins/extras/editor/docs/devdocs.lua
Normal file
@@ -0,0 +1,45 @@
|
||||
return {
|
||||
"luckasRanarison/nvim-devdocs",
|
||||
cmd = {
|
||||
"DevdocsFetch",
|
||||
"DevdocsInstall",
|
||||
"DevdocsUninstall",
|
||||
"DevdocsOpen",
|
||||
"DevdocsOpenFloat",
|
||||
"DevdocsOpenCurrent",
|
||||
"DevdocsOpenCurrentFloat",
|
||||
"DevdocsUpdate",
|
||||
"DevdocsUpdateAll",
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>sE", "<cmd>DevdocsOpen<cr>", desc = "Devdocs" },
|
||||
{ "<leader>se", "<cmd>DevdocsOpenCurrent<cr>", desc = "Devdocs Current" },
|
||||
},
|
||||
opts = {
|
||||
dir_path = vim.fn.stdpath("data") .. "/devdocs", -- installation directory
|
||||
telescope = {}, -- passed to the telescope picker
|
||||
float_win = { -- passed to nvim_open_win(), see :h api-floatwin
|
||||
relative = "editor",
|
||||
height = 25,
|
||||
width = 100,
|
||||
border = "rounded",
|
||||
},
|
||||
wrap = false, -- text wrap, only applies to floating window
|
||||
previewer_cmd = nil, -- for example: "glow"
|
||||
cmd_args = {}, -- example using glow: { "-s", "dark", "-w", "80" }
|
||||
cmd_ignore = {}, -- ignore cmd rendering for the listed docs
|
||||
picker_cmd = false, -- use cmd previewer in picker preview
|
||||
picker_cmd_args = {}, -- example using glow: { "-s", "dark", "-w", "50" }
|
||||
after_open = function(bufnr)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, "n", "q", ":close<CR>", {})
|
||||
end,
|
||||
ensure_installed = {
|
||||
"javascript",
|
||||
"lua-5.4",
|
||||
"fish-3.6",
|
||||
"git",
|
||||
"npm",
|
||||
"node",
|
||||
},
|
||||
},
|
||||
}
|
||||
26
nvim/lua/plugins/extras/editor/docs/neorg.lua
Normal file
26
nvim/lua/plugins/extras/editor/docs/neorg.lua
Normal file
@@ -0,0 +1,26 @@
|
||||
return {
|
||||
"nvim-neorg/neorg",
|
||||
build = ":Neorg sync-parsers",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
ft = "norg",
|
||||
opts = {
|
||||
load = {
|
||||
["core.defaults"] = {}, -- Loads default behaviour
|
||||
["core.concealer"] = {}, -- Adds pretty icons to your documents
|
||||
["core.keybinds"] = {}, -- Adds default keybindings
|
||||
["core.completion"] = {
|
||||
config = {
|
||||
engine = "nvim-cmp",
|
||||
},
|
||||
}, -- Enables support for completion plugins
|
||||
["core.journal"] = {}, -- Enables support for the journal module
|
||||
["core.dirman"] = { -- Manages Neorg workspaces
|
||||
config = {
|
||||
workspaces = {
|
||||
notes = "~/projects/notes",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
99
nvim/lua/plugins/extras/editor/docs/obsidian.lua
Normal file
99
nvim/lua/plugins/extras/editor/docs/obsidian.lua
Normal file
@@ -0,0 +1,99 @@
|
||||
local prefix = "<leader>o"
|
||||
|
||||
return {
|
||||
{ import = "plugins.extras.lang.markdown-extended" },
|
||||
{
|
||||
-- "epwalsh/obsidian.nvim",
|
||||
"obsidian-nvim/obsidian.nvim", -- NOTE: Using a fork from the community
|
||||
ft = "markdown",
|
||||
keys = {
|
||||
{ prefix .. "o", "<cmd>ObsidianOpen<CR>", desc = "Open on App" },
|
||||
{ prefix .. "g", "<cmd>ObsidianSearch<CR>", desc = "Grep" },
|
||||
{ "<leader>sO", "<cmd>ObsidianSearch<CR>", desc = "Obsidian Grep" },
|
||||
{ prefix .. "n", "<cmd>ObsidianNew<CR>", desc = "New Note" },
|
||||
{ prefix .. "<space>", "<cmd>ObsidianQuickSwitch<CR>", desc = "Find Files" },
|
||||
{ prefix .. "b", "<cmd>ObsidianBacklinks<CR>", desc = "Backlinks" },
|
||||
{ prefix .. "t", "<cmd>ObsidianTags<CR>", desc = "Tags" },
|
||||
{ prefix .. "t", "<cmd>ObsidianTemplate<CR>", desc = "Template" },
|
||||
{ prefix .. "l", "<cmd>ObsidianLink<CR>", mode = "v", desc = "Link" },
|
||||
{ prefix .. "L", "<cmd>ObsidianLinks<CR>", desc = "Links" },
|
||||
{ prefix .. "N", "<cmd>ObsidianLinkNew<CR>", mode = "v", desc = "New Link" },
|
||||
{ prefix .. "e", "<cmd>ObsidianExtractNote<CR>", mode = "v", desc = "Extract Note" },
|
||||
{ prefix .. "w", "<cmd>ObsidianWorkspace<CR>", desc = "Workspace" },
|
||||
{ prefix .. "r", "<cmd>ObsidianRename<CR>", desc = "Rename" },
|
||||
{ prefix .. "i", "<cmd>ObsidianPasteImg<CR>", desc = "Paste Image" },
|
||||
{ prefix .. "d", "<cmd>ObsidianDailies<CR>", desc = "Daily Notes" },
|
||||
},
|
||||
opts = {
|
||||
workspaces = {
|
||||
{
|
||||
name = "personal-brain",
|
||||
path = "~/documents/obsidian/personal-brain/vault",
|
||||
},
|
||||
},
|
||||
|
||||
notes_subdir = "01 - Bandeja Entrada",
|
||||
|
||||
daily_notes = {
|
||||
folder = "03 - Diario/Diariamente",
|
||||
date_format = "%Y-%m-%d",
|
||||
alias_format = "%B %-d, %Y",
|
||||
template = "00 - Data/Plantillas/Diariamente.md",
|
||||
},
|
||||
|
||||
completion = {
|
||||
nvim_cmp = false,
|
||||
blink = true,
|
||||
},
|
||||
|
||||
picker = {
|
||||
name = "snacks.pick",
|
||||
},
|
||||
|
||||
mappings = {
|
||||
["gf"] = {
|
||||
action = function()
|
||||
return require("obsidian").util.gf_passthrough()
|
||||
end,
|
||||
opts = { noremap = false, expr = true, buffer = true },
|
||||
},
|
||||
["<C-c>"] = {
|
||||
action = function()
|
||||
return require("obsidian").util.toggle_checkbox()
|
||||
end,
|
||||
opts = { buffer = true },
|
||||
},
|
||||
["<cr>"] = {
|
||||
action = function()
|
||||
return require("obsidian").util.smart_action()
|
||||
end,
|
||||
opts = { buffer = true, expr = true },
|
||||
},
|
||||
},
|
||||
|
||||
templates = {
|
||||
subdir = "00 - Data/Plantillas",
|
||||
date_format = "%Y-%m-%d-%a",
|
||||
time_format = "%H:%M",
|
||||
},
|
||||
|
||||
follow_url_func = function(url)
|
||||
vim.fn.jobstart({ "xdg-open", url })
|
||||
end,
|
||||
|
||||
attachments = {
|
||||
img_folder = "00 - Data/Documentos",
|
||||
},
|
||||
|
||||
ui = { enable = false },
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
spec = {
|
||||
{ prefix, group = "obsidian", icon = " ", mode = { "n", "v" } },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
23
nvim/lua/plugins/extras/editor/docs/peek.lua
Normal file
23
nvim/lua/plugins/extras/editor/docs/peek.lua
Normal file
@@ -0,0 +1,23 @@
|
||||
return {
|
||||
{ "iamcco/markdown-preview.nvim", enabled = false },
|
||||
{
|
||||
"toppair/peek.nvim",
|
||||
build = "deno task --quiet build:fast",
|
||||
keys = {
|
||||
{
|
||||
"<leader>cp",
|
||||
ft = "markdown",
|
||||
function()
|
||||
local peek = require("peek")
|
||||
if peek.is_open() then
|
||||
peek.close()
|
||||
else
|
||||
peek.open()
|
||||
end
|
||||
end,
|
||||
desc = "Peek (Markdown Preview)",
|
||||
},
|
||||
},
|
||||
opts = {},
|
||||
},
|
||||
}
|
||||
16
nvim/lua/plugins/extras/editor/exercism.lua
Normal file
16
nvim/lua/plugins/extras/editor/exercism.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
return {
|
||||
"2kabhishek/exercism.nvim",
|
||||
cmd = {
|
||||
"ExercismLanguages",
|
||||
"ExercismList",
|
||||
"ExercismSubmit",
|
||||
"ExercismTest",
|
||||
},
|
||||
dependencies = {
|
||||
"2kabhishek/utils.nvim", -- required, for utility functions
|
||||
},
|
||||
opts = {
|
||||
exercism_workspace = "~/dev/study/exercism",
|
||||
add_default_keybindings = false,
|
||||
},
|
||||
}
|
||||
8
nvim/lua/plugins/extras/editor/five-server.lua
Normal file
8
nvim/lua/plugins/extras/editor/five-server.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
return {
|
||||
"Diogo-ss/five-server.nvim",
|
||||
cmd = { "FiveServer" },
|
||||
build = function()
|
||||
require("fs.utils.install")()
|
||||
end,
|
||||
opts = {},
|
||||
}
|
||||
28
nvim/lua/plugins/extras/editor/flash-extended.lua
Normal file
28
nvim/lua/plugins/extras/editor/flash-extended.lua
Normal file
@@ -0,0 +1,28 @@
|
||||
return {
|
||||
"folke/flash.nvim",
|
||||
opts = {},
|
||||
vscode = true,
|
||||
keys = {
|
||||
{
|
||||
"s",
|
||||
mode = { "n", "x", "o" },
|
||||
function()
|
||||
require("flash").jump({
|
||||
search = {
|
||||
mode = function(str)
|
||||
return "\\<" .. str
|
||||
end,
|
||||
},
|
||||
})
|
||||
end,
|
||||
desc = "Flash",
|
||||
},
|
||||
{
|
||||
"<leader>*",
|
||||
function()
|
||||
require("flash").jump({ pattern = vim.fn.expand("<cword>") })
|
||||
end,
|
||||
desc = "Jump With Current Word",
|
||||
},
|
||||
},
|
||||
}
|
||||
77
nvim/lua/plugins/extras/editor/fold.lua
Normal file
77
nvim/lua/plugins/extras/editor/fold.lua
Normal file
@@ -0,0 +1,77 @@
|
||||
return {
|
||||
{
|
||||
"kevinhwang91/nvim-ufo",
|
||||
event = { "LazyFile" },
|
||||
dependencies = { "kevinhwang91/promise-async" },
|
||||
init = function()
|
||||
vim.o.foldcolumn = "1"
|
||||
vim.o.foldlevel = 99
|
||||
vim.o.foldlevelstart = 99
|
||||
vim.o.foldenable = true
|
||||
vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
|
||||
end,
|
||||
opts = function()
|
||||
local handler = function(virtText, lnum, endLnum, width, truncate)
|
||||
local newVirtText = {}
|
||||
local suffix = (" ... %d "):format(endLnum - lnum)
|
||||
local sufWidth = vim.fn.strdisplaywidth(suffix)
|
||||
local targetWidth = width - sufWidth
|
||||
local curWidth = 0
|
||||
for _, chunk in ipairs(virtText) do
|
||||
local chunkText = chunk[1]
|
||||
local chunkWidth = vim.fn.strdisplaywidth(chunkText)
|
||||
if targetWidth > curWidth + chunkWidth then
|
||||
table.insert(newVirtText, chunk)
|
||||
else
|
||||
chunkText = truncate(chunkText, targetWidth - curWidth)
|
||||
local hlGroup = chunk[2]
|
||||
table.insert(newVirtText, { chunkText, hlGroup })
|
||||
chunkWidth = vim.fn.strdisplaywidth(chunkText)
|
||||
if curWidth + chunkWidth < targetWidth then
|
||||
suffix = suffix .. (" "):rep(targetWidth - curWidth - chunkWidth)
|
||||
end
|
||||
break
|
||||
end
|
||||
curWidth = curWidth + chunkWidth
|
||||
end
|
||||
table.insert(newVirtText, { suffix, "MoreMsg" })
|
||||
return newVirtText
|
||||
end
|
||||
|
||||
return {
|
||||
fold_virt_text_handler = handler,
|
||||
provider_selector = function()
|
||||
return { "treesitter", "indent" }
|
||||
end,
|
||||
open_fold_hl_timeout = 400,
|
||||
close_fold_kinds_for_ft = { "imports", "comment" },
|
||||
preview = {
|
||||
win_config = { border = { "", "─", "", "", "", "─", "", "" }, winblend = 0 },
|
||||
mappings = {
|
||||
scrollU = "<C-b>",
|
||||
scrollD = "<C-f>",
|
||||
jumpTop = "[",
|
||||
jumpBot = "]",
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"zp",
|
||||
function()
|
||||
local winid = require("ufo").peekFoldedLinesUnderCursor()
|
||||
if not winid then
|
||||
vim.lsp.buf.hover()
|
||||
end
|
||||
end,
|
||||
desc = "Peek Folded Line",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"chrisgrieser/nvim-origami",
|
||||
event = { "LazyFile" },
|
||||
opts = {},
|
||||
},
|
||||
}
|
||||
18
nvim/lua/plugins/extras/editor/fzf/fzf-extended.lua
Normal file
18
nvim/lua/plugins/extras/editor/fzf/fzf-extended.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
return {
|
||||
{ import = "lazyvim.plugins.extras.editor.fzf" },
|
||||
{
|
||||
"ibhagwan/fzf-lua",
|
||||
opts = {
|
||||
previewers = {
|
||||
builtin = {
|
||||
syntax_limit_b = 1024 * 100, -- 100KB
|
||||
},
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>sA", "<cmd>FzfLua treesitter<cr>", desc = "Treesiter Symbols" },
|
||||
{ "<leader>gr", "<cmd>FzfLua git_branches<cr>", desc = "Branches" },
|
||||
{ "<leader>S", "<cmd>FzfLua spell_suggest<cr>", desc = "Spelling" },
|
||||
},
|
||||
},
|
||||
}
|
||||
75
nvim/lua/plugins/extras/editor/git/diffview.lua
Normal file
75
nvim/lua/plugins/extras/editor/git/diffview.lua
Normal file
@@ -0,0 +1,75 @@
|
||||
local prefix = "<leader>gC"
|
||||
local function toggle_diffview(cmd)
|
||||
if next(require("diffview.lib").views) == nil then
|
||||
vim.cmd(cmd)
|
||||
else
|
||||
vim.cmd("DiffviewClose")
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
{
|
||||
"sindrets/diffview.nvim",
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>gD", function() toggle_diffview("DiffviewFileHistory") end, desc = "Diff Repo" },
|
||||
{ "<leader>gd", function() toggle_diffview("DiffviewOpen") end, desc = "Diff View" },
|
||||
{ "<leader>gF", function() toggle_diffview("DiffviewFileHistory %") end, desc = "Diff Current File" },
|
||||
},
|
||||
opts = function(_, opts)
|
||||
local actions = require("diffview.actions")
|
||||
|
||||
opts.enhanced_diff_hl = true
|
||||
opts.view = {
|
||||
default = { winbar_info = true },
|
||||
file_history = { winbar_info = true },
|
||||
}
|
||||
opts.hooks = {
|
||||
diff_buf_read = function(bufnr)
|
||||
vim.b[bufnr].view_activated = false
|
||||
end,
|
||||
}
|
||||
|
||||
opts.keymaps = {
|
||||
--stylua: ignore
|
||||
view = {
|
||||
{ "n", prefix .. "o", actions.conflict_choose("ours"), { desc = "Choose the OURS version of a conflict" } },
|
||||
{ "n", prefix .. "t", actions.conflict_choose("theirs"), { desc = "Choose the THEIRS version of a conflict" } },
|
||||
{ "n", prefix .. "b", actions.conflict_choose("base"), { desc = "Choose the BASE version of a conflict" } },
|
||||
{ "n", prefix .. "a", actions.conflict_choose("all"), { desc = "Choose all the versions of a conflict" } },
|
||||
{ "n", prefix .. "x", actions.conflict_choose("none"), { desc = "Delete the conflict region" } },
|
||||
{ "n", prefix .. "O", actions.conflict_choose_all("ours"), { desc = "Choose the OURS version of a conflict for the whole file" } },
|
||||
{ "n", prefix .. "T", actions.conflict_choose_all("theirs"), { desc = "Choose the THEIRS version of a conflict for the whole file" } },
|
||||
{ "n", prefix .. "B", actions.conflict_choose_all("base"), { desc = "Choose the BASE version of a conflict for the whole file" } },
|
||||
{ "n", prefix .. "A", actions.conflict_choose_all("all"), { desc = "Choose all the versions of a conflict for the whole file" } },
|
||||
{ "n", prefix .. "X", actions.conflict_choose_all("none"), { desc = "Delete the conflict region for the whole file" } },
|
||||
},
|
||||
--stylua: ignore
|
||||
file_panel = {
|
||||
{ "n", prefix .. "O", actions.conflict_choose_all("ours"), { desc = "Choose the OURS version of a conflict for the whole file" } },
|
||||
{ "n", prefix .. "T", actions.conflict_choose_all("theirs"), { desc = "Choose the THEIRS version of a conflict for the whole file" } },
|
||||
{ "n", prefix .. "B", actions.conflict_choose_all("base"), { desc = "Choose the BASE version of a conflict for the whole file" } },
|
||||
{ "n", prefix .. "A", actions.conflict_choose_all("all"), { desc = "Choose all the versions of a conflict for the whole file" } },
|
||||
{ "n", prefix .. "X", actions.conflict_choose_all("none"), { desc = "Delete the conflict region for the whole file" } },
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
{
|
||||
"NeogitOrg/neogit",
|
||||
optional = true,
|
||||
opts = {
|
||||
integrations = {
|
||||
diffview = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
spec = {
|
||||
{ prefix, group = "conflicts", icon = " " },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
45
nvim/lua/plugins/extras/editor/git/git-conflict.lua
Normal file
45
nvim/lua/plugins/extras/editor/git/git-conflict.lua
Normal file
@@ -0,0 +1,45 @@
|
||||
local prefix = "<leader>gC"
|
||||
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "GitConflictDetected",
|
||||
callback = function()
|
||||
vim.notify("Conflict detected in " .. vim.fn.expand("<afile>"))
|
||||
end,
|
||||
})
|
||||
|
||||
return {
|
||||
{
|
||||
"akinsho/git-conflict.nvim",
|
||||
opts = {
|
||||
default_mappings = {
|
||||
ours = prefix .. "o",
|
||||
theirs = prefix .. "t",
|
||||
none = prefix .. "n",
|
||||
both = prefix .. "b",
|
||||
},
|
||||
},
|
||||
cmd = {
|
||||
"GitConflictChooseTheirs",
|
||||
"GitConflictChooseOurs",
|
||||
"GitConflictChooseBoth",
|
||||
"GitConflictListQf",
|
||||
"GitConflictRefresh",
|
||||
"GitConflictNextConflict",
|
||||
"GitConflictPrevConflict",
|
||||
},
|
||||
keys = {
|
||||
{ "]g", "<cmd>GitConflictNextConflict<cr>", desc = "Next Conflict" },
|
||||
{ "[g", "<cmd>GitConflictPrevConflict<cr>", desc = "Previous Conflict" },
|
||||
{ prefix .. "l", "<cmd>GitConflictListQf<cr>", desc = "List Conflicts" },
|
||||
{ prefix .. "r", "<cmd>GitConflictRefresh<cr>", desc = "Refresh Conflicts" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
spec = {
|
||||
{ prefix, group = "conflicts", icon = " " },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
40
nvim/lua/plugins/extras/editor/git/gitgraph.lua
Normal file
40
nvim/lua/plugins/extras/editor/git/gitgraph.lua
Normal file
@@ -0,0 +1,40 @@
|
||||
return {
|
||||
"isakbm/gitgraph.nvim",
|
||||
opts = {
|
||||
symbols = {
|
||||
merge_commit = "",
|
||||
commit = "",
|
||||
},
|
||||
format = {
|
||||
timestamp = "%H:%M:%S %d-%m-%Y",
|
||||
fields = { "hash", "timestamp", "author", "branch_name", "tag" },
|
||||
},
|
||||
hooks = {
|
||||
on_select_commit = function(commit)
|
||||
if LazyVim.has("diffview.nvim") then
|
||||
vim.notify("DiffviewOpen " .. commit.hash .. "^!")
|
||||
vim.cmd(":DiffviewOpen " .. commit.hash .. "^!")
|
||||
else
|
||||
print("selected commit:", commit.hash)
|
||||
end
|
||||
end,
|
||||
on_select_range_commit = function(from, to)
|
||||
if LazyVim.has("diffview.nvim") then
|
||||
vim.notify("DiffviewOpen " .. from.hash .. "~1.." .. to.hash)
|
||||
vim.cmd(":DiffviewOpen " .. from.hash .. "~1.." .. to.hash)
|
||||
else
|
||||
print("selected range:", from.hash, to.hash)
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>gl",
|
||||
function()
|
||||
require("gitgraph").draw({}, { all = true, max_count = 5000 })
|
||||
end,
|
||||
desc = "Graph",
|
||||
},
|
||||
},
|
||||
}
|
||||
169
nvim/lua/plugins/extras/editor/git/github-extended.lua
Normal file
169
nvim/lua/plugins/extras/editor/git/github-extended.lua
Normal file
@@ -0,0 +1,169 @@
|
||||
local prefix = "<leader>G"
|
||||
|
||||
return {
|
||||
{ import = "lazyvim.plugins.extras.util.octo" },
|
||||
{ import = "plugins.extras.lang.git-extended" },
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "gh" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"almo7aya/openingh.nvim",
|
||||
cmd = { "OpenInGHRepo", "OpenInGHFile", "OpenInGHFileLines" },
|
||||
keys = {
|
||||
{ prefix .. "ro", "<cmd>OpenInGHRepo<CR>", desc = "Open git repo in web", mode = { "n" } },
|
||||
{ prefix .. "rf", "<cmd>OpenInGHFile<CR>", desc = "Open git file in web", mode = { "n" } },
|
||||
{ prefix .. "rc", "<cmd>OpenInGHFileLines<CR>", desc = "Open current line in web", mode = { "n", "x", "v" } },
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
spec = {
|
||||
{ prefix, group = "github", icon = " " },
|
||||
{ prefix .. "c", group = "comments" },
|
||||
{ prefix .. "t", group = "threads" },
|
||||
{ prefix .. "i", group = "issues" },
|
||||
{ prefix .. "p", group = "pull requests" },
|
||||
{ prefix .. "pm", group = "merge current PR" },
|
||||
{ prefix .. "r", group = "repo" },
|
||||
{ prefix .. "a", group = "assignee/reviewer" },
|
||||
{ prefix .. "l", group = "label" },
|
||||
{ prefix .. "e", group = "reaction" },
|
||||
{ prefix .. "R", group = "review" },
|
||||
{ prefix .. "g", group = "gist" },
|
||||
{ prefix .. "s", group = "review" },
|
||||
{ prefix .. "P", group = "profile" },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"Rawnly/gist.nvim",
|
||||
cmd = { "GistCreate", "GistCreateFromFile", "GistsList" },
|
||||
dependencies = {
|
||||
"samjwill/nvim-unception",
|
||||
init = function()
|
||||
vim.g.unception_block_while_host_edits = true
|
||||
end,
|
||||
},
|
||||
opts = {},
|
||||
keys = {
|
||||
{ prefix .. "gc", "<cmd>GistCreate<CR>", desc = "Create a Gist" },
|
||||
{ prefix .. "gf", "<cmd>GistCreateFromFile<CR>", desc = "Create a Gist from File" },
|
||||
{ prefix .. "gl", "<cmd>GistsList<CR>", desc = "List Gists" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"pwntester/octo.nvim",
|
||||
opts = {
|
||||
use_diagnostic_signs = true,
|
||||
mappings = {},
|
||||
},
|
||||
keys = {
|
||||
-- Disable default LazyVim keymaps
|
||||
{ "<leader>gi", false },
|
||||
{ "<leader>gI", false },
|
||||
{ "<leader>gp", false },
|
||||
{ "<leader>gP", false },
|
||||
{ "<leader>gr", false },
|
||||
{ "<leader>gS", false },
|
||||
|
||||
{ prefix .. "ca", "<cmd>Octo comment add<CR>", desc = "Add a New Comment" },
|
||||
{ prefix .. "cd", "<cmd>Octo comment delete<CR>", desc = "Delete a Comment" },
|
||||
|
||||
{ prefix .. "ta", "<cmd>Octo thread resolve<CR>", desc = "Mark Thread as Resolved" },
|
||||
{ prefix .. "td", "<cmd>Octo thread unresolve<CR>", desc = "Mark Thread as Unresolved" },
|
||||
|
||||
{ prefix .. "ic", "<cmd>Octo issue close<CR>", desc = "Close Current Issue" },
|
||||
{ prefix .. "ir", "<cmd>Octo issue reopen<CR>", desc = "Reopen Current Issue" },
|
||||
{ prefix .. "il", "<cmd>Octo issue list<CR>", desc = "List Open Issues" },
|
||||
{ prefix .. "is", "<cmd>Octo issue search<CR>", desc = "Search Issues" },
|
||||
{ prefix .. "iu", "<cmd>Octo issue url<CR>", desc = "Copies URL of Current Issue" },
|
||||
{ prefix .. "io", "<cmd>Octo issue browser<CR>", desc = "Open Current Issue in Browser" },
|
||||
|
||||
{ prefix .. "pp", "<cmd>Octo pr checkout<CR>", desc = "Checkout PR" },
|
||||
{ prefix .. "pmm", "<cmd>Octo pr merge commit<CR>", desc = "Merge Commit PR" },
|
||||
{ prefix .. "pms", "<cmd>Octo pr merge squash<CR>", desc = "Squash Merge PR" },
|
||||
{ prefix .. "pmd", "<cmd>Octo pr merge delete<CR>", desc = "Delete Merge PR" },
|
||||
{ prefix .. "pmr", "<cmd>Octo pr merge rebase<CR>", desc = "Rebase Merge PR" },
|
||||
{ prefix .. "pc", "<cmd>Octo pr close<CR>", desc = "Close Current PR" },
|
||||
{ prefix .. "pn", "<cmd>Octo pr create<CR>", desc = "Create PR for Current Branch" },
|
||||
{ prefix .. "pd", "<cmd>Octo pr diff<CR>", desc = "Show PR Diff" },
|
||||
{ prefix .. "ps", "<cmd>Octo pr search<CR>", desc = "Search PR" },
|
||||
{ prefix .. "ps", "<cmd>Octo pr list<CR>", desc = "List Open PRs" },
|
||||
{ prefix .. "pr", "<cmd>Octo pr ready<CR>", desc = "Mark Draft as Ready for Review" },
|
||||
{ prefix .. "po", "<cmd>Octo pr browser<CR>", desc = "Open Current PR in Browser" },
|
||||
{ prefix .. "pu", "<cmd>Octo pr url<CR>", desc = "Copies URL of Current PR" },
|
||||
{ prefix .. "pt", "<cmd>Octo pr commits<CR>", desc = "List PR Commits" },
|
||||
{ prefix .. "pl", "<cmd>Octo pr commits<CR>", desc = "List Changed Files in PR" },
|
||||
|
||||
{ prefix .. "rf", "<cmd>Octo repo fork<CR>", desc = "Fork Repo" },
|
||||
{ prefix .. "ru", "<cmd>Octo repo url<CR>", desc = "Copies URL of Current Repo" },
|
||||
|
||||
{ prefix .. "aa", "<cmd> Octo assignee add<CR>", desc = "Assign a User" },
|
||||
{ prefix .. "ar", "<cmd> Octo assignee remove<CR>", desc = "Remove a User" },
|
||||
{ prefix .. "ap", "<cmd> Octo reviewer add<CR>", desc = "Assign a PR Reviewer" },
|
||||
|
||||
{ prefix .. "la", "<cmd> Octo label add<CR>", desc = "Assign a Label" },
|
||||
{ prefix .. "lr", "<cmd> Octo label remove<CR>", desc = "Remove a Label" },
|
||||
{ prefix .. "lc", "<cmd> Octo label create<CR>", desc = "Create a Label" },
|
||||
|
||||
{ prefix .. "e1", "<cmd>Octo reaction thumbs_up<CR>", desc = "Add 👍 Reaction" },
|
||||
{ prefix .. "e2", "<cmd>Octo reaction thumbs_down<CR>", desc = "Add 👎 Reaction" },
|
||||
{ prefix .. "e3", "<cmd>Octo reaction eyes<CR>", desc = "Add 👀 Reaction" },
|
||||
{ prefix .. "e4", "<cmd>Octo reaction laugh<CR>", desc = "Add 😄 Reaction" },
|
||||
{ prefix .. "e5", "<cmd>Octo reaction confused<CR>", desc = "Add 😕 Reaction" },
|
||||
{ prefix .. "e6", "<cmd>Octo reaction rocket<CR>", desc = "Add 🚀 Reaction" },
|
||||
{ prefix .. "e7", "<cmd>Octo reaction heart<CR>", desc = "Add ❤️ Reaction" },
|
||||
{ prefix .. "e8", "<cmd>Octo reaction party<CR>", desc = "Add 🎉 Reaction" },
|
||||
|
||||
{ prefix .. "x", "<cmd>Octo actions<CR>", desc = "Run an Action" },
|
||||
|
||||
{ prefix .. "ss", "<cmd> Octo review start<CR>", desc = "Start Review" },
|
||||
{ prefix .. "sf", "<cmd> Octo review submit<CR>", desc = "Submit Review" },
|
||||
{ prefix .. "sr", "<cmd> Octo review resume<CR>", desc = "Submit Resume" },
|
||||
{ prefix .. "sd", "<cmd> Octo review discard<CR>", desc = "Delete Pending Review" },
|
||||
{ prefix .. "sc", "<cmd> Octo review comments<CR>", desc = "View Pending Comments" },
|
||||
{ prefix .. "sp", "<cmd> Octo review commit<CR>", desc = "Select Commit to Review" },
|
||||
{ prefix .. "sc", "<cmd> Octo review close<CR>", desc = "Return to PR" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"2kabhishek/octohub.nvim",
|
||||
dependencies = {
|
||||
"2kabhishek/utils.nvim",
|
||||
},
|
||||
cmd = {
|
||||
"OctoRepos",
|
||||
"OctoRepo",
|
||||
"OctoStats",
|
||||
"OctoActivityStats",
|
||||
"OctoContributionStats",
|
||||
"OctoRepoStats",
|
||||
"OctoProfile",
|
||||
"OctoRepoWeb",
|
||||
},
|
||||
opts = {
|
||||
add_default_keybindings = false,
|
||||
projects_dir = "~/dev/",
|
||||
},
|
||||
keys = {
|
||||
{ prefix .. "rl", "<cmd>OctoRepos<CR>", desc = "List Repos" },
|
||||
{ prefix .. "rS", "<cmd>OctoRepos sort:stars<CR>", desc = "Top Starred Repos" },
|
||||
{ prefix .. "rI", "<cmd>OctoRepos sort:issues<CR>", desc = "Top Repos With Issues" },
|
||||
{ prefix .. "rU", "<cmd>OctoRepos sort:updated<CR>", desc = "Recently Updated Repos" },
|
||||
{ prefix .. "rP", "<cmd>OctoRepos type:private<CR>", desc = "Private Repos" },
|
||||
{ prefix .. "rF", "<cmd>OctoRepos type:fork<CR>", desc = "Forked Repos" },
|
||||
{ prefix .. "rc", "<cmd>OctoRepo<CR>", desc = "Clone/Open Repo" },
|
||||
{ prefix .. "rs", "<cmd>OctoRepoStats<CR>", desc = "Repo Stats" },
|
||||
|
||||
{ prefix .. "Ps", "<cmd>OctoStats<CR>", desc = "All Stats" },
|
||||
{ prefix .. "Pa", "<cmd>OctoActivityStats<CR>", desc = "Activity Stats" },
|
||||
{ prefix .. "Pc", "<cmd>OctoContributionStats<CR>", desc = "Contribution Stats" },
|
||||
{ prefix .. "Po", "<cmd>OctoProfile<CR>", desc = "Open Profile" },
|
||||
},
|
||||
},
|
||||
}
|
||||
24
nvim/lua/plugins/extras/editor/git/neogit.lua
Normal file
24
nvim/lua/plugins/extras/editor/git/neogit.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
local prefix = "<leader>gn"
|
||||
|
||||
return {
|
||||
{
|
||||
"NeogitOrg/neogit",
|
||||
cmd = "Neogit",
|
||||
opts = {},
|
||||
keys = {
|
||||
{ prefix .. "n", "<cmd>Neogit<cr>", desc = "Neogit (Root Dir)" },
|
||||
{ prefix .. "c", "<cmd>Neogit commit<cr>", desc = "Commit" },
|
||||
{ prefix .. "p", "<cmd>Neogit pull<cr>", desc = "Pull" },
|
||||
{ prefix .. "P", "<cmd>Neogit push<cr>", desc = "Push" },
|
||||
{ prefix .. "f", "<cmd>Neogit fetch<cr>", desc = "Fetch" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
spec = {
|
||||
{ prefix, group = "neogit", icon = " " },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
26
nvim/lua/plugins/extras/editor/git/worktree.lua
Normal file
26
nvim/lua/plugins/extras/editor/git/worktree.lua
Normal file
@@ -0,0 +1,26 @@
|
||||
local prefix = "<leader>gw"
|
||||
|
||||
return {
|
||||
{
|
||||
"ThePrimeagen/git-worktree.nvim",
|
||||
opts = {},
|
||||
config = function()
|
||||
LazyVim.on_load("telescope.nvim", function()
|
||||
require("telescope").load_extension("git_worktree")
|
||||
end)
|
||||
end,
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ prefix .. "m", function() require("telescope").extensions.git_worktree.git_worktrees() end, desc = "Manage Worktrees" },
|
||||
{ prefix .. "c", function() require("telescope").extensions.git_worktree.create_git_worktree() end, desc = "Create Worktree" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
spec = {
|
||||
{ prefix, group = "worktrees", icon = " " },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
16
nvim/lua/plugins/extras/editor/gitsigns-extended.lua
Normal file
16
nvim/lua/plugins/extras/editor/gitsigns-extended.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
return {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
opts = {
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
|
||||
delay = 5,
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
-- stylua: ignore
|
||||
{ "<leader>uB", "<cmd>Gitsigns toggle_current_line_blame<CR>", desc = "Toggle Line Blame" },
|
||||
{ "<leader>ghe", "<cmd>Gitsigns toggle_deleted<CR>", desc = "Deletions Inline" },
|
||||
},
|
||||
}
|
||||
22
nvim/lua/plugins/extras/editor/hover.lua
Normal file
22
nvim/lua/plugins/extras/editor/hover.lua
Normal file
@@ -0,0 +1,22 @@
|
||||
return {
|
||||
"lewis6991/hover.nvim",
|
||||
init = function()
|
||||
require("hover.providers.lsp")
|
||||
require("hover.providers.gh")
|
||||
require("hover.providers.gh_user")
|
||||
require("hover.providers.jira")
|
||||
require("hover.providers.dap")
|
||||
require("hover.providers.man")
|
||||
require("hover.providers.dictionary")
|
||||
end,
|
||||
opts = {
|
||||
preview_opts = {
|
||||
border = "rounded",
|
||||
},
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "K", function() require("hover").hover() end, desc = "Hover" },
|
||||
{ "gk", function() require("hover").hover_select() end, desc = "Hover Select" },
|
||||
},
|
||||
}
|
||||
15
nvim/lua/plugins/extras/editor/leap-spooky.lua
Normal file
15
nvim/lua/plugins/extras/editor/leap-spooky.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
return {
|
||||
{ import = "lazyvim.plugins.extras.editor.leap" },
|
||||
{
|
||||
"ggandor/leap.nvim",
|
||||
vscode = true,
|
||||
dependencies = {
|
||||
"ggandor/leap-spooky",
|
||||
vscode = true,
|
||||
},
|
||||
opts = {
|
||||
prefix = true,
|
||||
paste_on_remote_yank = true,
|
||||
},
|
||||
},
|
||||
}
|
||||
10
nvim/lua/plugins/extras/editor/live-server.lua
Normal file
10
nvim/lua/plugins/extras/editor/live-server.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
return {
|
||||
"aurum77/live-server.nvim",
|
||||
build = function()
|
||||
require("live_server.util").install()
|
||||
end,
|
||||
cmd = { "LiveServer", "LiveServerStart", "LiveServerStop" },
|
||||
keys = {
|
||||
{ "<leader>cV", ft = "html", "<cmd>LiveServer<CR>", desc = "Live Server" },
|
||||
},
|
||||
}
|
||||
5
nvim/lua/plugins/extras/editor/macroni.lua
Normal file
5
nvim/lua/plugins/extras/editor/macroni.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
"jesseleite/nvim-macroni",
|
||||
event = "VeryLazy",
|
||||
opts = {},
|
||||
}
|
||||
9
nvim/lua/plugins/extras/editor/markmap.lua
Normal file
9
nvim/lua/plugins/extras/editor/markmap.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
"Zeioth/markmap.nvim",
|
||||
build = "yarn global add markmap-cli",
|
||||
cmd = { "MarkmapOpen", "MarkmapSave", "MarkmapWatch", "MarkmapWatchStop" },
|
||||
opts = {},
|
||||
keys = {
|
||||
{ "<leader>cm", "<cmd>MarkmapOpen<cr>", desc = "Markmap" },
|
||||
},
|
||||
}
|
||||
43
nvim/lua/plugins/extras/editor/marks/arena.lua
Normal file
43
nvim/lua/plugins/extras/editor/marks/arena.lua
Normal file
@@ -0,0 +1,43 @@
|
||||
return {
|
||||
{
|
||||
"dzfrias/arena.nvim",
|
||||
event = "BufWinEnter",
|
||||
opts = {
|
||||
per_project = true,
|
||||
devicons = true,
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>m", function() require("arena").toggle() end, desc = "Marks" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"goolord/alpha-nvim",
|
||||
optional = true,
|
||||
opts = function(_, dashboard)
|
||||
-- stylua: ignore
|
||||
local button = dashboard.button("m", " " .. " Marks", function() require("arena").toggle() end)
|
||||
button.opts.hl = "AlphaButtons"
|
||||
button.opts.hl_shortcut = "AlphaShortcut"
|
||||
table.insert(dashboard.section.buttons.val, 5, button)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvimdev/dashboard-nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
-- stylua: ignore
|
||||
local arrow = {
|
||||
action = function() require("arena").toggle() end,
|
||||
desc = " Marks",
|
||||
icon = " ",
|
||||
key = "m",
|
||||
}
|
||||
|
||||
arrow.desc = arrow.desc .. string.rep(" ", 43 - #arrow.desc)
|
||||
arrow.key_format = " %s"
|
||||
|
||||
table.insert(opts.config.center, 5, arrow)
|
||||
end,
|
||||
},
|
||||
}
|
||||
49
nvim/lua/plugins/extras/editor/marks/arrow.lua
Normal file
49
nvim/lua/plugins/extras/editor/marks/arrow.lua
Normal file
@@ -0,0 +1,49 @@
|
||||
return {
|
||||
{
|
||||
"otavioschwanck/arrow.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
show_icons = true,
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>m", function() require("arrow.ui").openMenu() end, desc = "Marks" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sections.lualine_c, require("arrow.statusline").text_for_statusline_with_icons())
|
||||
end,
|
||||
},
|
||||
{
|
||||
"goolord/alpha-nvim",
|
||||
optional = true,
|
||||
opts = function(_, dashboard)
|
||||
-- stylua: ignore
|
||||
local button = dashboard.button("m", " " .. " Marks", function() require("arrow.ui").openMenu() end)
|
||||
button.opts.hl = "AlphaButtons"
|
||||
button.opts.hl_shortcut = "AlphaShortcut"
|
||||
table.insert(dashboard.section.buttons.val, 5, button)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvimdev/dashboard-nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
-- stylua: ignore
|
||||
local arrow = {
|
||||
action = function() require("arrow.ui").openMenu() end,
|
||||
desc = " Marks",
|
||||
icon = " ",
|
||||
key = "m",
|
||||
}
|
||||
|
||||
arrow.desc = arrow.desc .. string.rep(" ", 43 - #arrow.desc)
|
||||
arrow.key_format = " %s"
|
||||
|
||||
table.insert(opts.config.center, 5, arrow)
|
||||
end,
|
||||
},
|
||||
}
|
||||
43
nvim/lua/plugins/extras/editor/marks/bookmarks.lua
Normal file
43
nvim/lua/plugins/extras/editor/marks/bookmarks.lua
Normal file
@@ -0,0 +1,43 @@
|
||||
return {
|
||||
"tomasky/bookmarks.nvim",
|
||||
config = function()
|
||||
require("bookmarks").setup({
|
||||
save_file = vim.fn.stdpath("state") .. "/bookmarks",
|
||||
keywords = {
|
||||
["@t"] = " ",
|
||||
["@w"] = " ",
|
||||
["@f"] = " ",
|
||||
["@n"] = " ",
|
||||
},
|
||||
})
|
||||
LazyVim.on_load("telescope.nvim", function()
|
||||
require("telescope").setup({
|
||||
extensions = {
|
||||
repo = {
|
||||
list = {
|
||||
fd_opts = {
|
||||
"--no-ignore-vcs",
|
||||
},
|
||||
search_dirs = {
|
||||
"~/Repos/",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
require("telescope").load_extension("bookmarks")
|
||||
end)
|
||||
end,
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>fB", "<cmd>Telescope bookmarks list<cr>", desc = "Bookmarks" },
|
||||
{ "mm", function() require("bookmarks").bookmark_toggle() end, desc = "Toggle Bookmark" },
|
||||
{ "ml", function() require("bookmarks").bookmark_ann() end, desc = "Add/Edit Current Line" },
|
||||
{ "mc", function() require("bookmarks").bookmark_clean() end, desc = "Clear All Bookmarks" },
|
||||
{ "mn", function() require("bookmarks").bookmark_next() end, desc = "Next Bookmark" },
|
||||
{ "mp", function() require("bookmarks").bookmark_prev() end, desc = "Previous Bookmark" },
|
||||
{ "]k", function() require("bookmarks").bookmark_next() end, desc = "Next Bookmark" },
|
||||
{ "[k", function() require("bookmarks").bookmark_prev() end, desc = "Previous Bookmark" },
|
||||
{ "mL", function() require("bookmarks").bookmark_list() end, desc = "List Bookmarks" },
|
||||
},
|
||||
}
|
||||
83
nvim/lua/plugins/extras/editor/marks/grapple.lua
Normal file
83
nvim/lua/plugins/extras/editor/marks/grapple.lua
Normal file
@@ -0,0 +1,83 @@
|
||||
local prefix = "<leader>m"
|
||||
|
||||
local keys = {}
|
||||
|
||||
-- stylua: ignore start
|
||||
for i = 1, 9 do
|
||||
table.insert(keys, { prefix .. i, "<cmd>Grapple select index=" .. i .. "<CR>", desc = "File " .. i })
|
||||
end
|
||||
|
||||
table.insert(keys, { prefix .. "a", "<cmd>Grapple tag<CR>", desc = "Add Mark" })
|
||||
table.insert(keys, { prefix .. "m", "<cmd>Grapple toggle_tags<CR>", desc = "Marks" })
|
||||
table.insert(keys, { prefix .. "t", "<cmd>Telescope grapple tags<CR>", desc = "Marks (Telescope)" })
|
||||
table.insert(keys, { prefix .. "C", "<cmd>Grapple reset<CR>", desc = "Clear all Marks" })
|
||||
table.insert(keys, { prefix .. "c", "<cmd>Grapple untag<CR>", desc = "Clear Current Mark" })
|
||||
table.insert(keys, { prefix .. "s", "<cmd>Grapple toggle_scopes<CR>", desc = "Scopes" })
|
||||
table.insert(keys, { prefix .. "S", "<cmd>Grapple toggle_loaded<CR>", desc = "Loaded Scopes" })
|
||||
|
||||
table.insert(keys, { "]k", "<cmd>Grapple cycle forward<CR>", desc = "Next Mark" })
|
||||
table.insert(keys, { "[k", "<cmd>Grapple cycle backward<CR>", desc = "Prev Mark" })
|
||||
|
||||
table.insert(keys, { "<C-A-l>", "<cmd>Grapple cycle forward<CR>", desc = "Next Mark" })
|
||||
table.insert(keys, { "<C-A-h>", "<cmd>Grapple cycle backward<CR>", desc = "Prev Mark" })
|
||||
-- stylua: ignore end
|
||||
|
||||
return {
|
||||
{
|
||||
"cbochs/grapple.nvim",
|
||||
cmd = { "Grapple" },
|
||||
keys = keys,
|
||||
config = function()
|
||||
require("grapple").setup({
|
||||
win_opts = {
|
||||
footer = "",
|
||||
},
|
||||
})
|
||||
LazyVim.on_load("telescope.nvim", function()
|
||||
require("telescope").load_extension("grapple")
|
||||
end)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"goolord/alpha-nvim",
|
||||
optional = true,
|
||||
opts = function(_, dashboard)
|
||||
local button = dashboard.button("m", " " .. " Marks", "<cmd>Grapple toggle_tags<CR>")
|
||||
button.opts.hl = "AlphaButtons"
|
||||
button.opts.hl_shortcut = "AlphaShortcut"
|
||||
table.insert(dashboard.section.buttons.val, 5, button)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvimdev/dashboard-nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
local grapple = {
|
||||
action = "Grapple toggle_tags",
|
||||
desc = " Marks",
|
||||
icon = " ",
|
||||
key = "m",
|
||||
}
|
||||
|
||||
grapple.desc = grapple.desc .. string.rep(" ", 43 - #grapple.desc)
|
||||
grapple.key_format = " %s"
|
||||
|
||||
table.insert(opts.config.center, 5, grapple)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sections.lualine_c, { require("grapple").statusline, cond = require("grapple").exists })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
spec = {
|
||||
{ prefix, group = "marks", icon = " " },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
110
nvim/lua/plugins/extras/editor/marks/harpoon-extended.lua
Normal file
110
nvim/lua/plugins/extras/editor/marks/harpoon-extended.lua
Normal file
@@ -0,0 +1,110 @@
|
||||
local prefix = "<leader>m"
|
||||
|
||||
local keys = {}
|
||||
|
||||
-- stylua: ignore start
|
||||
for i = 1, 9 do
|
||||
table.insert(keys, { prefix .. i, function() require("harpoon"):list():select(i) end, desc = "File " .. i })
|
||||
end
|
||||
|
||||
table.insert(keys, { prefix .. "a", function() require("harpoon"):list():add() end, desc = "Add Mark" })
|
||||
table.insert(keys, { prefix .. "m", function() require("harpoon").ui:toggle_quick_menu(require("harpoon"):list()) end, desc = "Marks" })
|
||||
table.insert(keys, { prefix .. "t", "<cmd>Telescope harpoon marks<CR>", desc = "Marks (Telescope)" })
|
||||
table.insert(keys, { prefix .. "c", function() require("harpoon"):list():clear() end, desc = "Clear all Marks" })
|
||||
|
||||
table.insert(keys, { "]k", function() require("harpoon"):list():next() end, desc = "Next Mark" })
|
||||
table.insert(keys, { "[k", function() require("harpoon"):list():prev() end, desc = "Prev Mark" })
|
||||
|
||||
table.insert(keys, { "<C-A-l>", function() require("harpoon"):list():next() end, desc = "Next Mark" })
|
||||
table.insert(keys, { "<C-A-h>", function() require("harpoon"):list():prev() end, desc = "Prev Mark" })
|
||||
-- stylua: ignore end
|
||||
|
||||
return {
|
||||
{
|
||||
"ThePrimeagen/harpoon",
|
||||
branch = "harpoon2",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
keys = keys,
|
||||
config = function()
|
||||
local harpoon = require("harpoon")
|
||||
harpoon:setup({
|
||||
menu = {
|
||||
width = vim.api.nvim_win_get_width(0) - 4,
|
||||
},
|
||||
settings = {
|
||||
save_on_toggle = true,
|
||||
},
|
||||
})
|
||||
|
||||
harpoon:extend({
|
||||
UI_CREATE = function(cx)
|
||||
vim.keymap.set("n", "<C-v>", function()
|
||||
harpoon.ui:select_menu_item({ vsplit = true })
|
||||
end, { buffer = cx.bufnr })
|
||||
|
||||
vim.keymap.set("n", "<C-x>", function()
|
||||
harpoon.ui:select_menu_item({ split = true })
|
||||
end, { buffer = cx.bufnr })
|
||||
|
||||
vim.keymap.set("n", "<C-t>", function()
|
||||
harpoon.ui:select_menu_item({ tabedit = true })
|
||||
end, { buffer = cx.bufnr })
|
||||
end,
|
||||
})
|
||||
|
||||
LazyVim.on_load("telescope.nvim", function()
|
||||
require("telescope").load_extension("harpoon")
|
||||
end)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = {
|
||||
"abeldekat/harpoonline",
|
||||
opts = { formatter = "short", icon = "" },
|
||||
},
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sections.lualine_c, require("harpoonline").format)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"goolord/alpha-nvim",
|
||||
optional = true,
|
||||
opts = function(_, dashboard)
|
||||
-- stylua: ignore
|
||||
local button = dashboard.button("m", " " .. " Marks", function() require("harpoon").ui:toggle_quick_menu(require("harpoon"):list()) end)
|
||||
button.opts.hl = "AlphaButtons"
|
||||
button.opts.hl_shortcut = "AlphaShortcut"
|
||||
table.insert(dashboard.section.buttons.val, 5, button)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvimdev/dashboard-nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
local harpoon = {
|
||||
-- stylua: ignore
|
||||
action = function() require("harpoon").ui:toggle_quick_menu(require("harpoon"):list()) end,
|
||||
desc = " Marks",
|
||||
icon = " ",
|
||||
key = "m",
|
||||
}
|
||||
|
||||
harpoon.desc = harpoon.desc .. string.rep(" ", 43 - #harpoon.desc)
|
||||
harpoon.key_format = " %s"
|
||||
|
||||
table.insert(opts.config.center, 5, harpoon)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
spec = {
|
||||
{ prefix, group = "marks", icon = " " },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
26
nvim/lua/plugins/extras/editor/marks/mini-visits.lua
Normal file
26
nvim/lua/plugins/extras/editor/marks/mini-visits.lua
Normal file
@@ -0,0 +1,26 @@
|
||||
local prefix = "<leader>m"
|
||||
|
||||
return {
|
||||
{
|
||||
"echasnovski/mini.visits",
|
||||
event = "BufEnter",
|
||||
opts = {},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ prefix .. "a", function() require("mini.visits").add_label() end, desc = "Add Label" },
|
||||
{ prefix .. "r", function() require("mini.visits").remove_label() end, desc = "Remove Label" },
|
||||
{ prefix .. "l", function() require("mini.visits").select_label("", nil) end, desc = "Select Label (cwd)", },
|
||||
{ prefix .. "L", function() require("mini.visits").select_label("", "") end, desc = "Select Label (all)", },
|
||||
{ prefix .. "p", function() require("mini.visits").select_path() end, desc = "Visited Path (cwd)", },
|
||||
{ prefix .. "P", function() require("mini.visits").select_path("") end, desc = "Visited Path (all)", },
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
spec = {
|
||||
{ prefix, group = "marks", icon = " " },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
52
nvim/lua/plugins/extras/editor/neo-tree-extended.lua
Normal file
52
nvim/lua/plugins/extras/editor/neo-tree-extended.lua
Normal file
@@ -0,0 +1,52 @@
|
||||
return {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
opts = {
|
||||
close_if_last_window = true,
|
||||
window = {
|
||||
mappings = {
|
||||
["e"] = "open",
|
||||
["E"] = function()
|
||||
vim.api.nvim_exec("Neotree focus filesystem left", true)
|
||||
end,
|
||||
["b"] = function()
|
||||
vim.api.nvim_exec("Neotree focus buffers left", true)
|
||||
end,
|
||||
["g"] = function()
|
||||
vim.api.nvim_exec("Neotree focus git_status left", true)
|
||||
end,
|
||||
["<c-/>"] = "fuzzy_finder_directory",
|
||||
["D"] = function(state)
|
||||
local node = state.tree:get_node()
|
||||
local log = require("neo-tree.log")
|
||||
state.clipboard = state.clipboard or {}
|
||||
if diff_Node and diff_Node ~= tostring(node.id) then
|
||||
local current_Diff = node.id
|
||||
require("neo-tree.utils").open_file(state, diff_Node, open)
|
||||
vim.cmd("vert diffs " .. current_Diff)
|
||||
log.info("Diffing " .. diff_Name .. " against " .. node.name)
|
||||
diff_Node = nil
|
||||
current_Diff = nil
|
||||
state.clipboard = {}
|
||||
require("neo-tree.ui.renderer").redraw(state)
|
||||
else
|
||||
local existing = state.clipboard[node.id]
|
||||
if existing and existing.action == "diff" then
|
||||
state.clipboard[node.id] = nil
|
||||
diff_Node = nil
|
||||
require("neo-tree.ui.renderer").redraw(state)
|
||||
else
|
||||
state.clipboard[node.id] = { action = "diff", node = node }
|
||||
diff_Name = state.clipboard[node.id].node.name
|
||||
diff_Node = tostring(state.clipboard[node.id].node.id)
|
||||
log.info("Diff source file " .. diff_Name)
|
||||
require("neo-tree.ui.renderer").redraw(state)
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
filesystem = {
|
||||
hijack_netrw_behavior = "open_default",
|
||||
},
|
||||
},
|
||||
}
|
||||
5
nvim/lua/plugins/extras/editor/numb.lua
Normal file
5
nvim/lua/plugins/extras/editor/numb.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
"nacro90/numb.nvim",
|
||||
event = "CmdlineEnter",
|
||||
opts = {},
|
||||
}
|
||||
21
nvim/lua/plugins/extras/editor/oil.lua
Normal file
21
nvim/lua/plugins/extras/editor/oil.lua
Normal file
@@ -0,0 +1,21 @@
|
||||
return {
|
||||
"stevearc/oil.nvim",
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
optional = true,
|
||||
},
|
||||
opts = {
|
||||
delete_to_trash = true,
|
||||
float = {
|
||||
max_height = 45,
|
||||
max_width = 90,
|
||||
},
|
||||
keymaps = {
|
||||
["q"] = "actions.close",
|
||||
},
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>;", function() require("oil").toggle_float() end, desc = "Toggle Oil" },
|
||||
},
|
||||
}
|
||||
16
nvim/lua/plugins/extras/editor/outline-extended.lua
Normal file
16
nvim/lua/plugins/extras/editor/outline-extended.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
return {
|
||||
{ import = "lazyvim.plugins.extras.editor.outline" },
|
||||
{
|
||||
"hedyhli/outline.nvim",
|
||||
opts = {
|
||||
outline_window = {
|
||||
show_symbol_lineno = true,
|
||||
auto_jump = true,
|
||||
jump_highlight_duration = 150,
|
||||
},
|
||||
symbol_folding = {
|
||||
autofold_depth = 1,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
37
nvim/lua/plugins/extras/editor/package-info.lua
Normal file
37
nvim/lua/plugins/extras/editor/package-info.lua
Normal file
@@ -0,0 +1,37 @@
|
||||
local prefix = "<leader>p"
|
||||
|
||||
return {
|
||||
{
|
||||
"vuki656/package-info.nvim",
|
||||
event = {
|
||||
"BufRead package.json",
|
||||
"BufRead package-lock.json",
|
||||
},
|
||||
opts = {},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ prefix .. "wv", function() require('package-info').show({ force = true }) end, desc = "Show Package Versions" },
|
||||
{ prefix .. "wu", function() require('package-info').update() end, desc = "Update Package" },
|
||||
{ prefix .. "wr", function() require('package-info').delete() end, desc = "Remove Package" },
|
||||
{ prefix .. "wc", function() require('package-info').change_version() end, desc = "Change Package Version" },
|
||||
{ prefix .. "wi", function() require('package-info').install() end, desc = "Install New Dependency" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"voldikss/vim-floaterm",
|
||||
optional = true,
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ prefix .. "wp", "<cmd>FloatermNew --disposable --name=lazynpm --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<root> lazynpm<CR>", desc = "Lazynpm" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
spec = {
|
||||
{ prefix, group = "packages/dependencies", icon = " ", mode = { "n", "v" } },
|
||||
{ prefix .. "w", group = "web", icon = " ", mode = { "n", "v" } },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
19
nvim/lua/plugins/extras/editor/regex.lua
Normal file
19
nvim/lua/plugins/extras/editor/regex.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
return {
|
||||
"bennypowers/nvim-regexplainer",
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
opts = {
|
||||
auto = "true",
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{
|
||||
"gR",
|
||||
function()
|
||||
require("regexplainer").show()
|
||||
end,
|
||||
desc = "Regexplainer",
|
||||
},
|
||||
},
|
||||
}
|
||||
8
nvim/lua/plugins/extras/editor/retirement.lua
Normal file
8
nvim/lua/plugins/extras/editor/retirement.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
return {
|
||||
"chrisgrieser/nvim-early-retirement",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
retirementAgeMins = 30,
|
||||
ignoreUnsavedChangesBufs = false,
|
||||
},
|
||||
}
|
||||
50
nvim/lua/plugins/extras/editor/search-replace.lua
Normal file
50
nvim/lua/plugins/extras/editor/search-replace.lua
Normal file
@@ -0,0 +1,50 @@
|
||||
local prefix = "sr"
|
||||
|
||||
return {
|
||||
{
|
||||
"roobert/search-replace.nvim",
|
||||
opts = {
|
||||
default_replace_single_buffer_options = "gcI",
|
||||
default_replace_multi_buffer_options = "egcI",
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ prefix .. "b", "<CMD>SearchReplaceSingleBufferVisualSelection<CR>", desc = "Buffer", mode = "v" },
|
||||
{ prefix .. "v", "<CMD>SearchReplaceWithinVisualSelection<CR>", desc = "Visual Selection", mode = "v" },
|
||||
{ prefix .. "w", "<CMD>SearchReplaceWithinVisualSelectionCWord<CR>", desc = "Word on Buffer", mode = "v" },
|
||||
|
||||
{ prefix .. "b", "<CMD>SearchReplaceSingleBufferOpen<CR>", desc = "Buffer", mode = "n" },
|
||||
{ prefix .. "w", "<CMD>SearchReplaceSingleBufferCWord<CR>", desc = "Word on Buffer", mode = "n" },
|
||||
{ prefix .. "W", "<CMD>SearchReplaceSingleBufferCWORD<CR>", desc = "WORD on Buffer", mode = "n" },
|
||||
{ prefix .. "e", "<CMD>SearchReplaceSingleBufferCExpr<CR>", desc = "Expression on Buffer", mode = "n" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
spec = {
|
||||
{ prefix, group = "replace", icon = " " },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"MagicDuck/grug-far.nvim",
|
||||
keys = {
|
||||
{
|
||||
prefix .. "p",
|
||||
function()
|
||||
local grug = require("grug-far")
|
||||
local ext = vim.bo.buftype == "" and vim.fn.expand("%:e")
|
||||
grug.grug_far({
|
||||
transient = true,
|
||||
prefills = {
|
||||
filesFilter = ext and ext ~= "" and "*." .. ext or nil,
|
||||
},
|
||||
})
|
||||
end,
|
||||
mode = { "n", "v" },
|
||||
desc = "Project",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
39
nvim/lua/plugins/extras/editor/spectre.lua
Normal file
39
nvim/lua/plugins/extras/editor/spectre.lua
Normal file
@@ -0,0 +1,39 @@
|
||||
local prefix = "<leader>sr"
|
||||
|
||||
return {
|
||||
{
|
||||
"nvim-pack/nvim-spectre",
|
||||
build = false,
|
||||
cmd = "Spectre",
|
||||
opts = {
|
||||
open_cmd = "noswapfile vnew",
|
||||
default = {
|
||||
find = {
|
||||
cmd = "rg",
|
||||
},
|
||||
replace = {
|
||||
cmd = "sd",
|
||||
},
|
||||
},
|
||||
use_trouble_qf = true,
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ prefix .. "g", function() require("spectre").toggle() end, desc = "Globally" },
|
||||
{ prefix .. "G", mode = { "n" }, function() require("spectre").open_visual({ select_word = true }) end, desc = "Word Globally" },
|
||||
{ prefix .. "G", mode = { "v" }, function() require("spectre").open_visual() end, desc = "Word Globally" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
spec = {
|
||||
{ prefix, group = "replace", icon = " " },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"MagicDuck/grug-far.nvim",
|
||||
enabled = false,
|
||||
},
|
||||
}
|
||||
8
nvim/lua/plugins/extras/editor/ssr.lua
Normal file
8
nvim/lua/plugins/extras/editor/ssr.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
return {
|
||||
"cshuaimin/ssr.nvim",
|
||||
opts = {},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>srs", function() require("ssr").open() end, desc = "Structural" },
|
||||
},
|
||||
}
|
||||
11
nvim/lua/plugins/extras/editor/suda.lua
Normal file
11
nvim/lua/plugins/extras/editor/suda.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
return {
|
||||
"lambdalisue/suda.vim",
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>W", ":SudaWrite<CR>", desc = "Suda Write" },
|
||||
},
|
||||
cmd = {
|
||||
"SudaRead",
|
||||
"SudaWrite",
|
||||
},
|
||||
}
|
||||
8
nvim/lua/plugins/extras/editor/tabscope.lua
Normal file
8
nvim/lua/plugins/extras/editor/tabscope.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
return {
|
||||
"akinsho/bufferline.nvim",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
"backdround/tabscope.nvim",
|
||||
opts = {},
|
||||
},
|
||||
}
|
||||
27
nvim/lua/plugins/extras/editor/telescope/all-recent.lua
Normal file
27
nvim/lua/plugins/extras/editor/telescope/all-recent.lua
Normal file
@@ -0,0 +1,27 @@
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
dependencies = {
|
||||
"prochri/telescope-all-recent.nvim",
|
||||
dependencies = {
|
||||
"kkharji/sqlite.lua",
|
||||
},
|
||||
opts = {
|
||||
pickers = {
|
||||
["workspaces.nvim#workspaces"] = {
|
||||
disable = false,
|
||||
sorting = "frecency",
|
||||
},
|
||||
["project.nvim#projects"] = {
|
||||
disable = false,
|
||||
sorting = "frecency",
|
||||
},
|
||||
["yanky.nvim#yank_history"] = {
|
||||
disable = true,
|
||||
},
|
||||
["zoxide.nvim#zoxide"] = {
|
||||
disable = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
28
nvim/lua/plugins/extras/editor/telescope/file-browser.lua
Normal file
28
nvim/lua/plugins/extras/editor/telescope/file-browser.lua
Normal file
@@ -0,0 +1,28 @@
|
||||
return {
|
||||
"nvim-telescope/telescope-file-browser.nvim",
|
||||
config = function()
|
||||
LazyVim.on_load("telescope.nvim", function()
|
||||
require("telescope").setup({
|
||||
extensions = {
|
||||
file_browser = {
|
||||
hijack_netrw = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
require("telescope").load_extension("file_browser")
|
||||
end)
|
||||
end,
|
||||
dependencies = {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
"nvim-lua/plenary.nvim",
|
||||
{
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
optional = true,
|
||||
},
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>'", "<cmd>Telescope file_browser<cr>", desc = "Telescope File Browser (root dir)" },
|
||||
{ '<leader>"', "<cmd>Telescope file_browser path=%:p:h select_buffer=true<cr>", desc = "Telescope File Browser (cwd)" },
|
||||
},
|
||||
}
|
||||
13
nvim/lua/plugins/extras/editor/telescope/frecuency.lua
Normal file
13
nvim/lua/plugins/extras/editor/telescope/frecuency.lua
Normal file
@@ -0,0 +1,13 @@
|
||||
return {
|
||||
"nvim-telescope/telescope-frecency.nvim",
|
||||
opts = {},
|
||||
config = function()
|
||||
LazyVim.on_load("telescope.nvim", function()
|
||||
require("telescope").load_extension("frecency")
|
||||
end)
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>fq", "<cmd>Telescope frecency<CR>", desc = "Frecency (Root Dir)" },
|
||||
{ "<leader>fQ", "<cmd>Telescope frecency workspace=CWD<CR>", desc = "Frecency (cwd)" },
|
||||
},
|
||||
}
|
||||
18
nvim/lua/plugins/extras/editor/telescope/headings.lua
Normal file
18
nvim/lua/plugins/extras/editor/telescope/headings.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
return {
|
||||
"crispgm/telescope-heading.nvim",
|
||||
config = function()
|
||||
LazyVim.on_load("telescope.nvim", function()
|
||||
require("telescope").setup({
|
||||
extensions = {
|
||||
heading = {
|
||||
treesitter = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
require("telescope").load_extension("heading")
|
||||
end)
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>s#", "<cmd>Telescope heading<CR>", desc = "Headings" },
|
||||
},
|
||||
}
|
||||
19
nvim/lua/plugins/extras/editor/telescope/import.lua
Normal file
19
nvim/lua/plugins/extras/editor/telescope/import.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
return {
|
||||
"piersolenski/telescope-import.nvim",
|
||||
opts = {},
|
||||
config = function()
|
||||
LazyVim.on_load("telescope.nvim", function()
|
||||
require("telescope").setup({
|
||||
extensions = {
|
||||
import = {
|
||||
insert_at_top = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
require("telescope").load_extension("import")
|
||||
end)
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>sI", "<cmd>Telescope import<CR>", desc = "Imports" },
|
||||
},
|
||||
}
|
||||
11
nvim/lua/plugins/extras/editor/telescope/lazy.lua
Normal file
11
nvim/lua/plugins/extras/editor/telescope/lazy.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
return {
|
||||
"tsakirist/telescope-lazy.nvim",
|
||||
config = function()
|
||||
LazyVim.on_load("telescope.nvim", function()
|
||||
require("telescope").load_extension("lazy")
|
||||
end)
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>sp", "<cmd>Telescope lazy<CR>", desc = "Plugins (Lazy)" },
|
||||
},
|
||||
}
|
||||
13
nvim/lua/plugins/extras/editor/telescope/live-grep.lua
Normal file
13
nvim/lua/plugins/extras/editor/telescope/live-grep.lua
Normal file
@@ -0,0 +1,13 @@
|
||||
return {
|
||||
"nvim-telescope/telescope-live-grep-args.nvim",
|
||||
config = function()
|
||||
LazyVim.on_load("telescope.nvim", function()
|
||||
require("telescope").load_extension("lazy")
|
||||
end)
|
||||
end,
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>sg", function() require("telescope").extensions.live_grep_args.live_grep_args() end, desc = "Grep (root dir)" },
|
||||
{ "<leader>/", function() require("telescope").extensions.live_grep_args.live_grep_args() end, desc = "Grep (root dir)" },
|
||||
},
|
||||
}
|
||||
11
nvim/lua/plugins/extras/editor/telescope/luasnip.lua
Normal file
11
nvim/lua/plugins/extras/editor/telescope/luasnip.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
return {
|
||||
"benfowler/telescope-luasnip.nvim",
|
||||
config = function()
|
||||
LazyVim.on_load("telescope.nvim", function()
|
||||
require("telescope").load_extension("luasnip")
|
||||
end)
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>sl", "<cmd>Telescope luasnip<CR>", desc = "Luasnip (Snippets)" },
|
||||
},
|
||||
}
|
||||
18
nvim/lua/plugins/extras/editor/telescope/media.lua
Normal file
18
nvim/lua/plugins/extras/editor/telescope/media.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
return {
|
||||
"dharmx/telescope-media.nvim",
|
||||
config = function()
|
||||
LazyVim.on_load("telescope.nvim", function()
|
||||
require("telescope").setup({
|
||||
extensions = {
|
||||
media = {
|
||||
backend = "ueberzug", -- image/gif backend
|
||||
},
|
||||
},
|
||||
})
|
||||
require("telescope").load_extension("media")
|
||||
end)
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>sM", "<cmd>Telescope media<CR>", desc = "Media" },
|
||||
},
|
||||
}
|
||||
69
nvim/lua/plugins/extras/editor/telescope/repo.lua
Normal file
69
nvim/lua/plugins/extras/editor/telescope/repo.lua
Normal file
@@ -0,0 +1,69 @@
|
||||
return {
|
||||
{
|
||||
"cljoly/telescope-repo.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
{
|
||||
"airblade/vim-rooter",
|
||||
init = function()
|
||||
vim.g["rooter_cd_cmd"] = "lcd"
|
||||
vim.g["rooter_silent_chdir"] = 1
|
||||
end,
|
||||
},
|
||||
{ "nvim-telescope/telescope.nvim" },
|
||||
{ "nvim-lua/plenary.nvim" },
|
||||
},
|
||||
opts = {},
|
||||
config = function()
|
||||
LazyVim.on_load("telescope.nvim", function()
|
||||
require("telescope").setup({
|
||||
extensions = {
|
||||
repo = {
|
||||
list = {
|
||||
fd_opts = {
|
||||
"--no-ignore-vcs",
|
||||
},
|
||||
search_dirs = {
|
||||
"~/dev/",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
require("telescope").load_extension("repo")
|
||||
end)
|
||||
end,
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>fp", "<cmd>Telescope repo list<cr>", desc = "Projects (~/dev)" },
|
||||
{ "<leader>fP", "<cmd>lua require'telescope'.extensions.repo.list{search_dirs = { '~/' }}<cr>", desc = "Projects (System)" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"goolord/alpha-nvim",
|
||||
optional = true,
|
||||
opts = function(_, dashboard)
|
||||
local button = dashboard.button("r", " " .. " Repos", "<cmd>Telescope repo list<CR>")
|
||||
button.opts.hl = "AlphaButtons"
|
||||
button.opts.hl_shortcut = "AlphaShortcut"
|
||||
table.insert(dashboard.section.buttons.val, 4, button)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvimdev/dashboard-nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
local projects = {
|
||||
action = "Telescope repo list",
|
||||
desc = " Repos",
|
||||
icon = " ",
|
||||
key = "r",
|
||||
}
|
||||
|
||||
projects.desc = projects.desc .. string.rep(" ", 43 - #projects.desc)
|
||||
projects.key_format = " %s"
|
||||
|
||||
table.insert(opts.config.center, 4, projects)
|
||||
end,
|
||||
},
|
||||
}
|
||||
126
nvim/lua/plugins/extras/editor/telescope/telescope-extended.lua
Normal file
126
nvim/lua/plugins/extras/editor/telescope/telescope-extended.lua
Normal file
@@ -0,0 +1,126 @@
|
||||
local symbols_prefix = "<leader>ss"
|
||||
local symbols_workspace_prefix = "<leader>sS"
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
return {
|
||||
{ import = "lazyvim.plugins.extras.editor.telescope" },
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{
|
||||
symbols_prefix .. "a",
|
||||
LazyVim.pick("lsp_document_symbols", { symbols = { "Class", "Function", "Method", "Constructor", "Interface", "Module", "Struct", "Trait", "Field", "Property", "Enum", "Constant" } }),
|
||||
desc = "All",
|
||||
},
|
||||
{ symbols_prefix .. "c", LazyVim.pick("lsp_document_symbols", { symbols = { "Class" } }), desc = "Class" },
|
||||
{ symbols_prefix .. "f", LazyVim.pick("lsp_document_symbols", { symbols = { "Function" } }), desc = "Function" },
|
||||
{ symbols_prefix .. "m", LazyVim.pick("lsp_document_symbols", { symbols = { "Method" } }), desc = "Method" },
|
||||
{ symbols_prefix .. "C", LazyVim.pick("lsp_document_symbols", { symbols = { "Constructor" } }), desc = "Constructor" },
|
||||
{ symbols_prefix .. "e", LazyVim.pick("lsp_document_symbols", { symbols = { "Enum" } }), desc = "Enum" },
|
||||
{ symbols_prefix .. "i", LazyVim.pick("lsp_document_symbols", { symbols = { "Interface" } }), desc = "Interface" },
|
||||
{ symbols_prefix .. "M", LazyVim.pick("lsp_document_symbols", { symbols = { "Module" } }), desc = "Module" },
|
||||
{ symbols_prefix .. "s", LazyVim.pick("lsp_document_symbols", { symbols = { "Struct" } }), desc = "Struct" },
|
||||
{ symbols_prefix .. "t", LazyVim.pick("lsp_document_symbols", { symbols = { "Trait" } }), desc = "Trait" },
|
||||
{ symbols_prefix .. "F", LazyVim.pick("lsp_document_symbols", { symbols = { "Field" } }), desc = "Field" },
|
||||
{ symbols_prefix .. "p", LazyVim.pick("lsp_document_symbols", { symbols = { "Property" } }), desc = "Property" },
|
||||
{ symbols_prefix .. "v", LazyVim.pick("lsp_document_symbols", { symbols = { "Variable", "Parameter" } }), desc = "Variable" },
|
||||
{
|
||||
symbols_workspace_prefix .. "a",
|
||||
LazyVim.pick("lsp_dynamic_workspace_symbols", { symbols = { "Class", "Function", "Method", "Constructor", "Interface", "Module", "Struct", "Trait", "Field", "Property", "Enum", "Constant" } }),
|
||||
desc = "All",
|
||||
},
|
||||
{ symbols_workspace_prefix .. "c", LazyVim.pick("lsp_dynamic_workspace_symbols", { symbols = { "Class" } }), desc = "Class" },
|
||||
{ symbols_workspace_prefix .. "f", LazyVim.pick("lsp_dynamic_workspace_symbols", { symbols = { "Function" } }), desc = "Function" },
|
||||
{ symbols_workspace_prefix .. "m", LazyVim.pick("lsp_dynamic_workspace_symbols", { symbols = { "Method" } }), desc = "Method" },
|
||||
{ symbols_workspace_prefix .. "C", LazyVim.pick("lsp_dynamic_workspace_symbols", { symbols = { "Constructor" } }), desc = "Constructor" },
|
||||
{ symbols_workspace_prefix .. "e", LazyVim.pick("lsp_dynamic_workspace_symbols", { symbols = { "Enum" } }), desc = "Enum" },
|
||||
{ symbols_workspace_prefix .. "i", LazyVim.pick("lsp_dynamic_workspace_symbols", { symbols = { "Interface" } }), desc = "Interface" },
|
||||
{ symbols_workspace_prefix .. "M", LazyVim.pick("lsp_dynamic_workspace_symbols", { symbols = { "Module" } }), desc = "Module" },
|
||||
{ symbols_workspace_prefix .. "s", LazyVim.pick("lsp_dynamic_workspace_symbols", { symbols = { "Struct" } }), desc = "Struct" },
|
||||
{ symbols_workspace_prefix .. "t", LazyVim.pick("lsp_dynamic_workspace_symbols", { symbols = { "Trait" } }), desc = "Trait" },
|
||||
{ symbols_workspace_prefix .. "F", LazyVim.pick("lsp_dynamic_workspace_symbols", { symbols = { "Field" } }), desc = "Field" },
|
||||
{ symbols_workspace_prefix .. "p", LazyVim.pick("lsp_dynamic_workspace_symbols", { symbols = { "Property" } }), desc = "Property" },
|
||||
{ symbols_workspace_prefix .. "v", LazyVim.pick("lsp_dynamic_workspace_symbols", { symbols = { "Variable", "Parameter" } }), desc = "Variable" },
|
||||
{ "<leader>sA", LazyVim.pick("treesitter"), desc = "Treesitter Symbols" },
|
||||
{ "<leader>sP", "<cmd>Telescope builtin<cr>", desc = "Pickers (Telescope)" },
|
||||
{ "<leader>fh", LazyVim.pick("find_files", { hidden = true }), desc = "Find Files (hidden)" },
|
||||
{ "<leader><c-space>", LazyVim.pick("find_files", { hidden = true }), desc = "Find Files (hidden)" },
|
||||
{ "<leader>gb", "<cmd>Telescope git_branches<cr>", desc = "Branches" },
|
||||
{ "<leader>S", "<cmd>Telescope spell_suggest<cr>", desc = "Spelling" },
|
||||
{ "<leader>gs", false },
|
||||
},
|
||||
opts = {
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<S-esc>"] = actions.close,
|
||||
["<C-p>"] = require("telescope.actions.layout").toggle_preview,
|
||||
["<c-l>"] = require("telescope.actions.layout").cycle_layout_next,
|
||||
["<a-l>"] = require("telescope.actions.layout").cycle_layout_prev,
|
||||
["<C-Down>"] = actions.cycle_history_next,
|
||||
["<C-Up>"] = actions.cycle_history_prev,
|
||||
["<C-Tab>"] = require("telescope.actions").select_tab_drop,
|
||||
["<M-h>"] = require("telescope.actions").results_scrolling_left,
|
||||
["<M-l>"] = require("telescope.actions").results_scrolling_right,
|
||||
},
|
||||
},
|
||||
file_ignore_patterns = {
|
||||
".gitignore",
|
||||
"node_modules",
|
||||
"build",
|
||||
"dist",
|
||||
"yarn.lock",
|
||||
"*.git/*",
|
||||
"*/tmp/*",
|
||||
},
|
||||
},
|
||||
pickers = {
|
||||
find_files = {
|
||||
hidden = false,
|
||||
},
|
||||
buffers = {
|
||||
layout_config = {
|
||||
height = 0.7,
|
||||
width = 0.7,
|
||||
},
|
||||
mappings = {
|
||||
i = {
|
||||
["<c-r>"] = require("telescope.actions").delete_buffer,
|
||||
},
|
||||
},
|
||||
},
|
||||
spell_suggest = {
|
||||
layout_config = {
|
||||
prompt_position = "top",
|
||||
height = 0.3,
|
||||
width = 0.25,
|
||||
},
|
||||
sorting_strategy = "ascending",
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
fzf = {
|
||||
fuzzy = true,
|
||||
override_generic_sorter = true,
|
||||
override_file_sorter = true,
|
||||
case_mode = "smart_case",
|
||||
},
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown({}),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
spec = {
|
||||
{ symbols_prefix, group = "goto symbols", icon = " " },
|
||||
{ symbols_workspace_prefix, group = "goto symbols (Workspace)", icon = " " },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
25
nvim/lua/plugins/extras/editor/telescope/undotree.lua
Normal file
25
nvim/lua/plugins/extras/editor/telescope/undotree.lua
Normal file
@@ -0,0 +1,25 @@
|
||||
return {
|
||||
{
|
||||
"debugloop/telescope-undo.nvim",
|
||||
opts = {},
|
||||
config = function()
|
||||
LazyVim.on_load("telescope.nvim", function()
|
||||
require("telescope").setup({
|
||||
extensions = {
|
||||
undo = {
|
||||
side_by_side = true,
|
||||
layout_strategy = "vertical",
|
||||
layout_config = {
|
||||
preview_height = 0.6,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
require("telescope").load_extension("undo")
|
||||
end)
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>su", "<cmd>Telescope undo<cr>", desc = "Undos" },
|
||||
},
|
||||
},
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user