Developing environments used for kernel development

Manuel Pégourié-Gonnard mpg at elzevir.fr
Tue Dec 29 04:50:28 EST 2015


On 29/12/2015 06:10, Daniel. wrote:
> Well I found something that I use frequently on emacs and can't find
> an alternative for vim. While visiting an .patch (or .diff) file from
> emacs I can jump to the position of file just by pressing enter. I
> just can't find something like this on vim.

I don't know how to do this with vim either. The ftplugin/diff.vim file
from the vim runtime distribution doesn't have any such magic.

> When developing I like to
> review my changes before commit, doing little tweaks like removing
> empty new lines and trailing whitespaces. On emacs I can get an diff
> from the version control with C-x v =, then doing the fixes for
> creating a nice patch, doing C-x v = will refresh the diff window, so
> I do this until I think that is good enough.

What I use for that purpose in vim is the :Gdiff command provided by the
fugitive plugin. It splits your window between the checked out version
of your file and the version in the git index.

In addition to reviewing changes, it's also extremely useful for partial
commits when you got carried away during your editing and made an
unrelated change: you can move just the part you want to the index, then
commit that, then commit the rest. Or if you made a change you want to
revert without losing your other changes.

The usual shortcuts from vimdiff mode are available to move things
between the index and the checkout: do, dp (diff other, diff push) and
]c [c for navigating the changes.

Manuel.



More information about the Kernelnewbies mailing list