This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-02-08
Channels
- # aleph (5)
- # announcements (3)
- # aws-lambda (24)
- # babashka (17)
- # beginners (59)
- # calva (168)
- # clerk (4)
- # clj-kondo (62)
- # clojure (77)
- # clojure-belgium (4)
- # clojure-brasil (10)
- # clojure-ecuador (3)
- # clojure-europe (41)
- # clojure-losangeles (2)
- # clojure-nl (2)
- # clojure-norway (24)
- # clojure-uk (2)
- # clojurescript (44)
- # clr (21)
- # community-development (7)
- # conjure (1)
- # cursive (6)
- # datalevin (15)
- # datomic (1)
- # deps-new (12)
- # emacs (45)
- # events (1)
- # fulcro (8)
- # funcool (7)
- # graphql (5)
- # hugsql (15)
- # jobs (2)
- # matcher-combinators (17)
- # meander (14)
- # membrane (31)
- # pathom (28)
- # pedestal (8)
- # practicalli (6)
- # re-frame (12)
- # releases (1)
- # remote-jobs (1)
- # shadow-cljs (32)
- # tools-deps (8)
- # vim (16)
Users of vim-fugitive...say I want to revert a particular diff hunk to the checked out version, I know that I can do Git diff %
to show the diffs in the file. Any magic incantation to go to a particular diff hunk and say "ignore all that, give me what it was originally" and thus revert that particular bit of the file?
If I understand correctly, you can open the status window with :Git
, expand the file of interest with =
, navigate to your hunk, do a visual line selection, and then use X
to revert it.
Nice! I wasn't aware you can do a visual select. I usually just type X and the hunk gets reverted. Also you can type I and then split the hunk in case you want
I use https://github.com/airblade/vim-gitgutter#getting-started for what I think you are describing - <leader>hu
hs stages
I don't use vim-fugitive, but just to offer an alternative:
• Use git add --patch
(or if fugitive lets you do something similar, you can use that) to stage all the parts that you do want to keep.
• Make a commit to ensure you don't lose that part.
• Use git checkout path/to/the-file-in-question
to revert to the checked-out version of that file.