Add plist editing support to Vim
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
autoload Fixed error with small files Dec 23, 2014
plugin
.gitignore
LICENSE
README.md

README.md

vim-plist

Screenshot of vim-plist in action

This vim bundle adds complete support for property lists (plist) files on OS X.

The plugin uses the underlying plutil tool for manipulating property lists. It supports reading and writing in binary, xml and json formats.

Requirements

  • Vim 7.2 or later
  • plutil (bundled with OS X)

Installation

Use your favorite plugin manager.

  • NeoBundle

    NeoBundle 'darfink/vim-plist'
  • Vundle

    Bundle 'darfink/vim-plist'
  • Pathogen

    git clone git://github.com/darfink/vim-plist.git ~/.vim/bundle/vim-plist
  • vim-plug

    Plug 'darfink/vim-plist'

Usage

None! Just go ahead and edit plist files. Although there are some customization options availabe.

  • Change the display format used when editing property lists:

    let g:plist_display_format = 'xml'

    Available options for this command; json or xml. This does not only control the display format of binary property lists, but also for json and xml files. If the option is set to json, property lists in xml format will be displayed as json as well (but the format used when saving will be preserved).

  • Change the plist format used when saving property lists:

    let g:plist_save_format = ''

    By default, property lists are saved in the same format as they had when opened. If you want to override this and always save property lists in a specific format, you can use json, xml or binary format.

  • Change the filetype used for property lists in json format:

    let g:plist_json_filetype = 'javascript'

    Vim does not have inherent support for json files (it reverts to JavaScript syntax). If you do want a specific filetype for json property lists, when using a json plugin (such as vim-json), you can specify json as the filetype instead.

Notes

If you want syntax checking I highly recommend Syntastic since it has integrated support for property lists.

In case you use the sudo tee trick for writing to root owned files when using Vim, it will not work with plist files. This is because the tee trick uses the underlying Vim write function which bypasses the plugins BufWriteCmd and FileWriteCmd hooks.

This does not add plist as a new filetype, but merely conversion functionality between the different representible formats.

Todo

  • Add saving format options while editing (e.g. :PlistSaveAs json)

  • Change display format while editing (e.g. :PlistFormat xml)

License

MIT: License