Comments (53)
Can we support :Git commit -m "foo bar"
?
from mini.nvim.
Can we support
:Git -m "foo bar"
?
What is it supposed to do? As :Git commit -m "foo bar"
? If yes, then I don't think it is worthwhile to add this special behavior.
from mini.nvim.
Yes, sorry. It should behave exactly like git commit -m "foo bar"
. (After all, "if it works with git
, it should work with :Git
"...)
from mini.nvim.
After all, "if it works with
git
, it should work with:Git
"...
This is indeed the goal. But git -m "foo bar"
does not work for me from CLI. It says unknown option: -m
. And :Git
behaves the same.
Can we support :Git commit -m "foo bar"?
Yes, of course this works. With slight caveat: :Git commit -m foo\ bar
.
from mini.nvim.
Yes. I am explicitly referring to that; I would prefer not to need a special syntax.
from mini.nvim.
Yes. I am explicitly referring to that; I would prefer not to need a special syntax.
Ah, I see now. No, I don't think it will be added, as the current approach feels more like how Vim user commands work.
from mini.nvim.
Ok. Then I'll just leave two more suggestions here for the record; no need to respond:
- I would suggest making the fugitive behavior (split +
scrollbind
) the default forGit blame
- Consider mapping
show_at_cursor
formini.git
buffers, e.g., toK
.
from mini.nvim.
Ok. Then I'll just leave two more suggestions here for the record; no need to respond:
Thanks!
In case other people miss it in help file.
* I would suggest making the fugitive behavior (split + `scrollbind`) the default for `Git blame`
There is an example of customizing blame
subcommand (preferably be used inside mapping with <Cmd>vert Git blame -- %<CR>
right hand side).
* Consider mapping `show_at_cursor` for `mini.git` buffers, e.g., to `K`.
I'd suggest mapping it some <Leader>
mapping as it can be used inside regular Git-tracked file to show range history. But making buffer-local mapping is also possible (albeit a bit verbose for the most robust behavior):
local map_local = vim.schedule_wrap(function(data)
if not vim.api.nvim_buf_is_valid(data.buf) then return end
local buf_name = vim.api.nvim_buf_get_name(data.buf)
if not vim.startswith(buf_name, 'minigit://') then return end
vim.keymap.set({ 'n', 'x' }, 'K', MiniGit.show_at_cursor, { buffer = data.buf })
end)
-- Alternative is to map for `User` `MiniGitCommandSplit` event, but
-- it would not trigger when buffer is created with `show_xxx()` functions
vim.api.nvim_create_autocmd('BufNew', { callback = map_local })
from mini.nvim.
Is there a way where i can navigate through diff changes in all the files(not just current buffer) like I can using :Git command in vim-fugitive. Also stage and unstage hunks like I can in vim-fugitive.
from mini.nvim.
The 'mini.git' module is not meant as a full Git client, so do not expect full feature parity with 'vim-fugitive'. Here is a comparison to 'vim-fugitive'.
Is there a way where i can navigate through diff changes in all the files(not just current buffer) like I can using :Git command in vim-fugitive.
Not like in 'vim-fugitive', but you can use plain :Git diff
with enabled folding. Ideally, you'd be able to navigate to diff source with show_at_cursor()
, but show_diff_source()
(and hence show_at_cursor()
) does not work in that output (needs explicit commit). I'll look at how it can resolved.
Also stage and unstage hunks like I can in vim-fugitive.
The suggested way is to use 'mini.diff' for staging hunks when inside a buffer. Interactive unstaging is not supported, only with what git
CLI through :Git
can offer.
from mini.nvim.
@echasnovski Thanks for your amazing work. This fits really nice within my workflow since I don't need the full feature set of fugitive (for that I use lazygit).
I just have one question so asking here to not create an issue, what's the purpose of setting foldlevel ?
Line 1120 in e949451
I have a modified commit message that shows for commits, and I use folds for some parts which I'd rather start closed, for that I have vim.opt.foldlevel = 0
in after/ftplugin/gitcommit.lua
. It works fine when doing it from the command line git commit
but if I do it inside neovim (:Git commit
) then foldlevel is set to 999. So really my question is, is there anyway that options in after/ftplugin/gitcommit.lua
are not overwritten ?
from mini.nvim.
I just have one question so asking here to not create an issue, what's the purpose of setting foldlevel ?
I am using foldmethod=indent
(and recommending it to everyone). So output of :Git
command in split tended to be folded when I did not expect it to (like after :Git help commit
). As that foldlevel is set before manually setting filetype in output of :Git
command, it works in most cases. It just doesn't work in GIT_EDITOR
(like for commit). I'll fix this (probably tomorrow), as setting vim.wo.foldlevel = 0
in 'after/ftplugin/gitcommit.lua' should work.
from mini.nvim.
Hey @echasnovski, this is great! It covers most of what I wanted from Fugitive without its complexity, and for the rest I can create my own mappings :)
Regarding the split behavior, I miss an option to use the current window by default, without touching the tab layout at all, and without creating a new tab
from mini.nvim.
Hey @echasnovski, this is great! It covers most of what I wanted from Fugitive without its complexity, and for the rest I can create my own mappings :)
That's great to hear!
Regarding the split behavior, I miss an option to use the current window, without touching the tab layout at all, and without creating a new tab
Yeah, I've thought about this one. In early prototypes it even preferred reusing window if it already showed a buffer from 'mini.git'.
There are two main reasons (aside from a convenient for implementation "there is always a new window" invariant) for not including something like split = 'none'
:
- The buffers from 'mini.git' are cleaned up after window is closed. If not done, they will be accumulating in buffer list, which is not nice. The usual approach of setting
buftype=wipeout
so that buffer is wiped out when it is not visible is not great here, because it prevents exploring other buffers in the same window. - There is no good user command modifier to force it. Unlike "horizontal", "vertical", and "tab". So having only one not enforceable split direction ("auto") felt more appropriate.
I'll have this mind, but not sure if this is a good idea. I do wonder about supporting split = 'float'
for floating windows, but that would require exposing a config.window.config
option, which is also not great. Maybe some time later.
from mini.nvim.
Related Issues (20)
- add skip_confirm_for_simple_edits similar to oil.nvim HOT 2
- mini.files: '\' is treated as current directory HOT 2
- `s` seems bound even after remapping HOT 2
- Idea for mini.cloak HOT 2
- mini.files: multiple mappings per action HOT 1
- "i" key has been remapped, "k" remap to "i", inside = "k" HOT 1
- Configure Mini Animate to not Halt Cursor Movement if Animation is not Done HOT 1
- mini.completion defautl keymaps result with extra $0 at the end HOT 1
- Make the active column (where the cursor is) more easy to track HOT 1
- mini.starter: `buf_id` in `refresh()` is not an identifier of valid Starter buffer. HOT 6
- Completion errors with "'width' key must b e a positive Integer" HOT 3
- snippet support for mini.completion HOT 1
- Error when executing <C-w><C-d> HOT 5
- simplify custom sessions autoread HOT 5
- deps performs invalid envsubst invocation HOT 2
- Expose the rest of `H.builtin_textobjects` so users can assign them to a different key HOT 4
- mini.align does not take inlay hint into account. HOT 1
- Don't set terminal colors in base16 HOT 1
- mini.statusline: vim.diagnostic.is_enabled null reference HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mini.nvim.