You are not logged in.

#1 2013-06-04 09:10:18

jens-na
Member
Registered: 2013-06-02
Posts: 2

pacdiffvim - a pacnew/pacsave/pacorig file updater for Vim enthusiasts

pacdiffvim is a pacnew/pacorig/pacsave file updater for Vim enthusiasts. The shell script locates all .pacnew, .pacorig, .pacsave files and opens a tab for each diff in Vim.
Furthermore the script defines a special Vim function to deal with the diff.

The script invokes Vim with a bunch of command line arguments so you can handle everything inside one Vim session with standard Vim functionality.

You can find the source code and more detailed information here: https://github.com/jens-na/pacdiffvim

Dependencies

  • Bash 4.x

  • Vim 7.x

Features

  • opens a tab for each diff candidate in Vim

  • provides a special Vim command :OK to a) save the configuration file buffer and 2) delete the .pac* file which you have merged

  • you can change the root directory to update configration files in other directories like /mnt/etc

  • use gvim instead of vim to update the configuration files

Screenshot
pacdiffvim screenshot

Comments and contributions are appreciated.

Last edited by jens-na (2013-07-23 11:26:45)

Offline

#2 2013-06-04 10:44:04

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: pacdiffvim - a pacnew/pacsave/pacorig file updater for Vim enthusiasts

Is the main difference between your pacdiffvim and pacdiff provided by pacman the existence of these special vim functions, like 'OK'?
pacdiff asks you what do you want to do when it finds e.g. pacnew files (view, skip etc.) and again after you've edited them (remove foo.pacnew, mv foo.pacnew to foo etc.).

Offline

#3 2013-06-04 15:59:48

jens-na
Member
Registered: 2013-06-02
Posts: 2

Re: pacdiffvim - a pacnew/pacsave/pacorig file updater for Vim enthusiasts

There is only one command named :OK, which tells pacdiffvim that you are finished with the current diff and deletes the .pacnew file.

If you want to throw away/ignore the latest .pacnew file you can do this with:

:OK                  (diff finished)

If you like to overwrite your configuration file with the latest .pacnew file, you can do this like that:

:%diffput            (standard vim command)
:OK                  (diff finished)

You can navigate between the diffs with standard Vim functions :tabn (next tab) or :tabp (previous tab)

There is no extra functionality, just another way of presentation, so basically you are right.

Offline

#4 2013-07-19 02:06:02

jiehanzheng
Member
Registered: 2013-03-02
Posts: 15

Re: pacdiffvim - a pacnew/pacsave/pacorig file updater for Vim enthusiasts

Cool.  Thanks!

Offline

Board footer

Powered by FluxBB