Hacker News new | ask | show | jobs
by tomodachi94 1199 days ago
This functionality is built-in to vim-fugitive and VS Code.

In Fugitive, open it with :Git , select the unstaged file then press = . Select the desired range with visual mode, then press s and commit as normal.

In VS Code, select a hunk, press Ctrl+P, then type "Stage Selected Range." Repeat this process and commit as normal.

Edit: formatting and typo.

1 comments

I commit small chunks so often that I have a keyboard shortcut set up for that "stage selected range" command in VSCode, definitely recommend it to get a more useful commit history.