/vim-packageman

Ubuntu Package management through VIM

Primary LanguageVim scriptGNU General Public License v3.0GPL-3.0

VIM-PackageMan

Simple and lightweight Ubuntu/Debian package management from within VIM

This package provides an interface for selecting actions on packages which are either already installed or available to install

Features

  • Simple vimscript only implementation.
  • Requires only dpkg-query to retrieve package information, and dpkg to store changes.
  • Highlights package.
  • Understands the need to preserve essential packages, and highlights them appropriately
  • Supports previewing and saving the package selection
  • Saves the package selection change on write and will show the saved state on load
  • Uses bash, awk and sort under the covers to speed up text processing)

Installation

This plugin follows the standard runtime path structure, and as such it can be installed with a variety of plugin managers:

Plugin Manager Install with...
Pathogen git clone https://github.com/systemmonkey42/vim-packageman ~/.vim/bundle/vim-packageman
Remember to run :Helptags to generate help tags
NeoBundle NeoBundle 'systemmonkey42/vim-packageman'
Vundle Plugin 'systemmonkey42/vim-packageman'
Plug Plug 'systemmonkey42/vim-packageman'
VAM call vam#ActivateAddons([ 'vim-packageman' ])
Dein call dein#add('systemmonkey42/vim-packageman')
manual copy all of the files into your ~/.vim directory

Commands

The following commands are available:

  • PackageMan[!]

    Initiates the PackageMan plugin, loading all package information and displaying the package editor window. The default behaviour is to use the list of installed packages.

    Use Packageman! to use the list of available packages. This includes all installed, and not yet installed packages available to apt-get.

    WARNING: Packages are retrieved from the dpkg 'avail' list. To generate (or update) this list after apt-get update has been performed, use the PackageManRefresh command.

  • [m[,n]]PackageManInstall

    Mark package(s) on line m to n as "to be installed". This will show an 'i' next to the package name if the package is not already installed.

  • [m[,n]]PackageManRemove

    Mark package(s) on line m to n as "to be uninstalled". Once the uninstallation is complete, many packages leave their configuration behind, in case they are reinstalled. These show up marked with an 'r'. To completely purge these packages, use the Purge command below

  • [m[,n]]PackageManPurge

    Mark package(s) on line m to n as "to be purged".

    A package can be purged whether it is installed, or has been recently removed but left configuration files behind. Once purged, the package will no longer be visible in the package list. This will show an 'p' next to the package name.

  • [m[,n]]PackageManHold

    Mark package(s) on line m to n as "to be held".

    A package in the hold state will never upgrade automatically via apt-get dist-upgrade. This will show an 'h' next to the package name.

  • PackageManRepeat

    Repeat the last command. After executing PackageManInstall for example, pressing a key bound to PackageManRepeat will cause subsequent packages to be marked for installation. This will move to the next line after marking the package.

  • PackageManInfo

    Display detailed information about the package in the VIM preview window. Executing this a second time on the same package will close the preview window. Executing this on another package will update the preview window.

  • PackageManUndo

    Completely undo the last change. If a number of packages are marked for install, this will reset them to their original state. Note that if you commit the changes, the you will need to commit the undo for it to have any effect. When marking a package for install, dependencies are automatically marked for installation. Toggling the Install will only reset the package you toggle. Undo however, will reset the package and all dependencies.

  • PackageManPurgeAll

    Where packages are visible in the 'r' or removed state, this will mark all to be purged. You must commit this before it will take effect.

  • PackageManNextMark and PackageManPrevMark

    Navigate to the next or previous block of marked packages.

  • PackageManRefresh[!]

    Using the apt-get utility, this will retrieve the details of all known packages and import them. This allows PackageMan! to accurately display uninstalled packages.

    The use of '!' will force an 'apt-get update' as part of the refresh.

  • PackageManView

    Display a preview of all changes which are pending for the next commit.

  • PackageManExecute

    Commit all changes and execute the command apt-get dselect-upgrade to trigger the installation/removal of packages.

Key Bindings

Default key bindings are as follows:

Normal Mode Action
I PackageManInstall
R PackageManRemove
D PackageManRemove (mnemonic: delete package)
P PackageManPurge
H PackageManHold
V PackageManView
E PackageManExecute
U or u PackageManUndo
<Space> PackageManRepeat
]s or ]c PackageManNextMark
[s or [c PackageManPrevMark



Visual Mode Action
I PackageManInstall
R PackageManRemove
D PackageManRemove (mnemonic: delete package)
P PackageManPurge
H PackageManHold

Configuration

Find everything you need here;

:help packageman

By default, packages which are removed, but maintain their configuration files on disk, are marked 'removed', while a fully uninstalled package will simply disappear.

Use the following global to hide packages in the 'removed' state, as if they were completely gone.

let g:packageman_hide_removed = 1

FAQ

  • This is not much of an FAQ

Performance

When using PackageMan to manage installed packages, things should be nice and snappy with even a few thousand installed packages.

However... when using PackageMan! with the APT cache of all possible packages, things get a tad slow. The problem lies in how a complete APT cache currently has almost 50,000 packages, and PackageMan will be managing potentially thousands of signs.

Hopefully this can be resolved with performance tweaks.. Most of the issues occur during initial loading due to the overhead of parsing the package data.

License

GPLv3