Git Product home page Git Product logo

pacdiffvim's Introduction

Overview

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.

###Audience Users of Linux distributions which uses pacman as the systems package manager (e.g. Arch Linux)

###Dependencies

  • Bash 4.x
  • Vim 7.x

###Installation You can put pacdiffvim to your $PATH and make the script executable or you can simply copy-paste the following code:

wget https://raw.github.com/jens-na/pacdiffvim/master/pacdiffvim -O /usr/local/bin/pacdiffvim; \
chmod +x /usr/local/bin/pacdiffvim

AUR Package: https://aur.archlinux.org/packages/pacdiffvim-git/

###Screenshot pacdiffvim

Usage

###Command line options If you start pacdiffvim without any parameters, the script tries to locate all pacnew/pacorig/pacsave files with find in the directory /etc and starts vim with the found diff candidates. If there is nothing to do the script will exit with return code 0.

  • -r, --root - You can update your configuration files in another directory if you specify an alternative root path with -r or --root. The default directory is /etc.
  • -V, --version - Shows the version and copyright info for pacdiffvim.
  • -h, --help - Shows the help for the script and exits.

Environment variables
If $VIMPROG is specified, the script uses this value to start vim. The default value is vim. For example if you like to use gvim to compare the files you can set VIMPROG to gvim.

Example:
# VIMPROG=gvim pacdiffvim

###Runtime pacdiffvim starts Vim with the special Vim command :OK to deal with the pacnew/pacorig/pacsave diff.

  • :OK - if you have finished the diff between the pacnew/pacorig/pacsave file and the configuration file you should invoke this command. This function specifically does:
    • saves the configuration file
    • tries to delete the .pacnew/.pacsave/.pacorig file
    • opens your next diff (if any)

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

Examples

Remove the .pacnew file (ignore):

:OK                  (diff finished)

Overwrite your configuration file with the latest .pacnew file:

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

Skip and go to the next diff:

:tabn                (next tab - standard vim command)

License and Copyright

Licensed under the GNU General Public License 3.

(C) Jens Nazarenus, 2013

pacdiffvim's People

Stargazers

 avatar Jiehan Zheng avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.