-
-
Notifications
You must be signed in to change notification settings - Fork 242
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(utility): adding snacks.nvim #1264
base: main
Are you sure you want to change the base?
Conversation
Review ChecklistDoes this PR follow the [Contribution Guidelines](development guidelines)? Following is a partial checklist: Proper conventional commit scoping:
|
maps.n["<c-_>"] = { function() Snacks.terminal() end, desc = "which_key_ignore" } | ||
maps.n["]]"] = { function() Snacks.words.jump(vim.v.count1) end, desc = "Next Reference" } | ||
maps.n["[["] = { function() Snacks.words.jump(-vim.v.count1) end, desc = "Prev Reference" } | ||
maps.n["<leader>N"] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesnt this override an existing binding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah i need some time to convert the toggleterm stuff to snacks
https://github.com/AstroNvim/AstroNvim/blob/main/lua/astronvim/plugins/toggleterm.lua
i think this News |
Agreed. |
Co-authored-by: Uzair Aftab <[email protected]>
should not toggleterm be fully replaced with that? @mehalter |
Yeah I think it should, I think you mentioned above you were gonna do it 😂 |
It should probably be default override toggleterm but if the user manually re-enables it then it should go back to the defaults in AstroNvim |
if i wait long enough, hopefully it will fix by itself :-D |
Ready for review? |
There still needs to be work done to replace toggleterm stuff |
i checked snacks, dunno how to do a float without a cmd |
I peeked into source code, this snippet works for me maps.n["<Leader>tf"] = {
function() Snacks.terminal(nil, { win = { position = "float" } }) end,
desc = "Toggle Terminal Float",
} |
maps.n["<Leader>cR"] = { function() Snacks.rename() end, desc = "Rename File" } | ||
maps.n["<Leader>th"] = { function() Snacks.terminal() end, desc = "Toggle Terminal" } | ||
maps.n["<Leader>tf"] = { function() Snacks.terminal() end, desc = "Toggle Terminal Float" } | ||
maps.n["<Leader>to"] = { function() Snacks.terminal "<Cmd>execute v:count ." end, desc = "Toggle Terminal" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems incorrect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why/How?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm using it wrong, but if I press the keymap, then I get error, and if I understand the Snacks.terminal
api correctly, use supposed to provide shell command, not vim command
---@param opts snacks.Config | ||
opts = function(_, opts) | ||
local astrocore = require "astrocore" | ||
return astrocore.extend_tbl(opts, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think those options would make snacks fall in line with astronvim float windows style
return astrocore.extend_tbl(opts, { | |
return astrocore.extend_tbl(opts, { | |
win = { | |
border = "rounded", | |
backdrop = false, | |
}, |
adding snacks from our friend folke. i just copied the install instruction and modified it a little to make them fit into astrocommunity, i'm sure im missing something and collide with some keybindings