What does HackerNews think of vim-fugitive?

fugitive.vim: A Git wrapper so awesome, it should be illegal

Language: Vim Script

Did you try fugitive as a Magic replacement?

https://github.com/tpope/vim-fugitive

If you use the vim fugitive plugin[1], The `:Gbrowse` command [2] will open your browser to github on the correct file/commit. It also works on visually selected ranges, automatically linking to the range in github

[1] https://github.com/tpope/vim-fugitive

[2] https://github.com/tpope/vim-fugitive/blob/master/doc/fugiti...

>> Using the git CLI is much better for version control than the Jetbrains GUI wrapper

> For some things. But for reviewing activity in git, and tracking changes across time, doing it in the terminal is unproductive and sucks. (e.g.: 10 levels deep of git blame)

Magit[1] in Emacs is quite okay. It doesn’t feel duct-taped. I haven’t used fugitive[2] in Vim but that’s a thing that exists too.

[1] https://magit.vc/

[2] https://github.com/tpope/vim-fugitive

I haven't, but I don't use emacs. Crash course:

`mkdir -p ~/.vim/pack/git/start`

`git clone https://github.com/tpope/vim-fugitive ~/.vim/pack/git/start/vim-fugitive`

Open a file under version control and `:Git blame`

The commit shas, author, and date appear in a window to the left. `Ctrl+w Ctrl+w` to switch windows. Both windows scroll up and down together.

Pressing `o` on a commit sha opens the full commit log and patch in a window below. Close this with `:q`

Pressing `~` on a commit sha re-blames on parent (git's ~)

Pressing `P` on a commit sha re-blames on parent (git's ^)

There's also a set of (old and a bit outdated) Vimcasts on fugitive, episodes 31-35 http://vimcasts.org/episodes/archive/

Having gone from a stock vim to a highly modified vim and back again, here are some plugins that I find really boost my productivity:

- neoterm, for opening a REPL in a split buffer and quickly sending chunks of lines to the REPL (https://github.com/kassio/neoterm)

- fzf for faster buffer and file navigation (https://github.com/junegunn/fzf.vim)

- vim fugitive for good git integration (https://github.com/tpope/vim-fugitive)

- some other tpope plugins (surround, unimpared, commentary, vinegar)

1) I just use fugitive[0] for that. `git status` in vim is now just the `:G`, command, though I map it to `gs` so it's even quicker.

2) I can't really help you there, at least not in vanilla vim. I make heavy use of tmux and never work on my more than one repo in the same vim instance, nor is my vim's current working directory every anything other than the root of the repo I'm in. So if I do need to open a file in another repo and want to see two repos side-by-side (which is rare but it happens), I make a tmux split.

3) gutentags [1] can help with this. Though nothing is better than using a language server for your given language. That said, I still just have gutentags and mostly just grep/search for `def func` like you currently do.

[0] https://github.com/tpope/vim-fugitive

[1] https://github.com/ludovicchabant/vim-gutentags

I use lazygit[0] to essentially do the same thing. (or even vim-fugitive[1])

Previously I avoided creating messy commits simply because it was "tedious" to reorganize commits. And making overly atomic commits and typing out git commands more frequently didn't appeal to me either.

Once I got used to the above tools, life got so much easier. Lazygit makes it super easy to amend, reword, and even re-position commits in a TUI environment. Real life-changer for me. I can stage hunks super easily too, though that's even easier in neovim.

The only issue I face is my C-j/C-k keys are already bound to tmux, but are needed by lazygit to reposition commits.

[0]: https://github.com/jesseduffield/lazygit [1]: https://github.com/tpope/vim-fugitive

There's also the criminally-underrated fugitive.vim. Not lua though.

https://github.com/tpope/vim-fugitive