Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(split-and-window): add edgy.nvim #306

Merged
merged 1 commit into from
Jun 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 24 additions & 14 deletions lua/astrocommunity/diagnostics/trouble-nvim/init.lua
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,
},
}
60 changes: 35 additions & 25 deletions lua/astrocommunity/project/nvim-spectre/init.lua
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,
},
}
5 changes: 5 additions & 0 deletions lua/astrocommunity/split-and-window/edgy-nvim/README.md
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>
75 changes: 75 additions & 0 deletions lua/astrocommunity/split-and-window/edgy-nvim/init.lua
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,
},
},
},
}
12 changes: 12 additions & 0 deletions lua/astrocommunity/utility/noice-nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,16 @@ return {
},
init = function() vim.g.lsp_handlers_enabled = false end,
},
{
"folke/edgy.nvim",
optional = true,
opts = function(_, opts)
if not opts.bottom then opts.bottom = {} end
table.insert(opts.bottom, {
ft = "noice",
size = { height = 0.4 },
filter = function(_, win) return vim.api.nvim_win_get_config(win).relative == "" end,
})
end,
},
}