-
-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(split-and-window): add edgy.nvim (#306)
- Loading branch information
Showing
5 changed files
with
151 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,29 @@ | ||
local prefix = "<leader>x" | ||
return { | ||
"folke/trouble.nvim", | ||
cmd = { "TroubleToggle", "Trouble" }, | ||
keys = { | ||
{ prefix, desc = "Trouble" }, | ||
{ prefix .. "X", "<cmd>TroubleToggle workspace_diagnostics<cr>", desc = "Workspace Diagnostics (Trouble)" }, | ||
{ prefix .. "x", "<cmd>TroubleToggle document_diagnostics<cr>", desc = "Document Diagnostics (Trouble)" }, | ||
{ prefix .. "l", "<cmd>TroubleToggle loclist<cr>", desc = "Location List (Trouble)" }, | ||
{ prefix .. "q", "<cmd>TroubleToggle quickfix<cr>", desc = "Quickfix List (Trouble)" }, | ||
}, | ||
opts = { | ||
use_diagnostic_signs = true, | ||
action_keys = { | ||
close = { "q", "<esc>" }, | ||
cancel = "<c-e>", | ||
{ | ||
"folke/trouble.nvim", | ||
cmd = { "TroubleToggle", "Trouble" }, | ||
keys = { | ||
{ prefix, desc = "Trouble" }, | ||
{ prefix .. "X", "<cmd>TroubleToggle workspace_diagnostics<cr>", desc = "Workspace Diagnostics (Trouble)" }, | ||
{ prefix .. "x", "<cmd>TroubleToggle document_diagnostics<cr>", desc = "Document Diagnostics (Trouble)" }, | ||
{ prefix .. "l", "<cmd>TroubleToggle loclist<cr>", desc = "Location List (Trouble)" }, | ||
{ prefix .. "q", "<cmd>TroubleToggle quickfix<cr>", desc = "Quickfix List (Trouble)" }, | ||
}, | ||
opts = { | ||
use_diagnostic_signs = true, | ||
action_keys = { | ||
close = { "q", "<esc>" }, | ||
cancel = "<c-e>", | ||
}, | ||
}, | ||
}, | ||
{ | ||
"folke/edgy.nvim", | ||
optional = true, | ||
opts = function(_, opts) | ||
if not opts.bottom then opts.bottom = {} end | ||
table.insert(opts.bottom, "Trouble") | ||
end, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,40 @@ | ||
local prefix = "<leader>s" | ||
return { | ||
"nvim-pack/nvim-spectre", | ||
cmd = "Spectre", | ||
keys = { | ||
{ prefix, desc = "Search / Replace", mode = { "n", "x" } }, | ||
{ prefix .. "s", function() require("spectre").open() end, desc = "Spectre" }, | ||
{ | ||
prefix .. "w", | ||
mode = "x", | ||
function() require("spectre").open_visual { select_word = true } end, | ||
desc = "Spectre (current word)", | ||
{ | ||
"nvim-pack/nvim-spectre", | ||
cmd = "Spectre", | ||
keys = { | ||
{ prefix, desc = "Search / Replace", mode = { "n", "x" } }, | ||
{ prefix .. "s", function() require("spectre").toggle() end, desc = "Toggle Spectre" }, | ||
{ | ||
prefix .. "w", | ||
mode = "x", | ||
function() require("spectre").open_visual { select_word = true } end, | ||
desc = "Spectre (current word)", | ||
}, | ||
{ prefix .. "f", function() require("spectre").open_file_search() end, desc = "Spectre (current file)" }, | ||
}, | ||
{ prefix .. "f", function() require("spectre").open_file_search() end, desc = "Spectre (current file)" }, | ||
}, | ||
|
||
opts = function() | ||
return { | ||
mapping = { | ||
send_to_qf = { map = "q" }, | ||
replace_cmd = { map = "c" }, | ||
show_option_menu = { map = "o" }, | ||
run_current_replace = { map = "C" }, | ||
run_replace = { map = "R" }, | ||
change_view_mode = { map = "v" }, | ||
resume_last_search = { map = "l" }, | ||
}, | ||
} | ||
end, | ||
opts = function() | ||
return { | ||
mapping = { | ||
send_to_qf = { map = "q" }, | ||
replace_cmd = { map = "c" }, | ||
show_option_menu = { map = "o" }, | ||
run_current_replace = { map = "C" }, | ||
run_replace = { map = "R" }, | ||
change_view_mode = { map = "v" }, | ||
resume_last_search = { map = "l" }, | ||
}, | ||
} | ||
end, | ||
}, | ||
{ | ||
"folke/edgy.nvim", | ||
optional = true, | ||
opts = function(_, opts) | ||
if not opts.bottom then opts.bottom = {} end | ||
table.insert(opts.bottom, { ft = "spectre_panel", title = "Search/Replace", size = { height = 0.4 } }) | ||
end, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# edgy.nvim | ||
|
||
Easily create and manage predefined window layouts, bringing a new edge to your workflow | ||
|
||
**Repository:** <https://github.com/folke/edgy.nvim> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
return { | ||
{ | ||
"nvim-neo-tree/neo-tree.nvim", | ||
opts = { | ||
source_selector = { | ||
winbar = false, | ||
statusline = false, | ||
}, | ||
}, | ||
}, | ||
{ | ||
"folke/edgy.nvim", | ||
event = "VeryLazy", | ||
keys = { | ||
-- stylua: ignore | ||
{ "<leader>E", function() require("edgy").toggle() end, desc = "Toggle Sidebars" }, | ||
{ "<leader>F", function() require("edgy").select() end, desc = "Pick Sidebar" }, | ||
}, | ||
opts = { | ||
exit_when_last = true, | ||
bottom = { | ||
{ ft = "qf", title = "QuickFix" }, | ||
{ | ||
ft = "help", | ||
size = { height = 20 }, | ||
-- don't open help files in edgy that we're editing | ||
filter = function(buf) return vim.bo[buf].buftype == "help" end, | ||
}, | ||
}, | ||
left = { | ||
{ | ||
title = "Files", | ||
ft = "neo-tree", | ||
filter = function(buf) return vim.b[buf].neo_tree_source == "filesystem" end, | ||
pinned = true, | ||
open = "Neotree position=left filesystem", | ||
size = { height = 0.5 }, | ||
}, | ||
{ | ||
title = "Git Status", | ||
ft = "neo-tree", | ||
filter = function(buf) return vim.b[buf].neo_tree_source == "git_status" end, | ||
pinned = true, | ||
open = "Neotree position=right git_status", | ||
}, | ||
{ | ||
title = "Buffers", | ||
ft = "neo-tree", | ||
filter = function(buf) return vim.b[buf].neo_tree_source == "buffers" end, | ||
pinned = true, | ||
open = "Neotree position=top buffers", | ||
}, | ||
"neo-tree", | ||
}, | ||
right = { | ||
{ | ||
ft = "aerial", | ||
title = "Symbol Outline", | ||
pinned = true, | ||
open = function() require("aerial").open() end, | ||
}, | ||
}, | ||
keys = { | ||
-- increase width | ||
["<C-Right>"] = function(win) win:resize("width", 2) end, | ||
-- decrease width | ||
["<C-Left>"] = function(win) win:resize("width", -2) end, | ||
-- increase height | ||
["<C-Up>"] = function(win) win:resize("height", 2) end, | ||
-- decrease height | ||
["<C-Down>"] = function(win) win:resize("height", -2) end, | ||
}, | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters