radiant.vim
Intro
Radiant.vim is a little vim config file to let you edit radiant pages, parts, snippets and layout from vim. It is currently (20070318) in a usable state and I use it continuously. However, if you decide to use it, you do it at your own risk!
Usage
To test it download and put the radiant.vim file in your radiant applications' root directory, edit it with vim (with ruby bindings), do a :source % to load the file.
The script adds a Radiant command and its autocompletion. The Radiant command takes 2 arguments:
- the vim command you want to issue. Currently "edit", "split" or "vsplit" are autocompleted
-
- the path identifying what you want to edit. This is also autocompleted when you hit tab
-
The first "directory" in the path identitying what you want to edit determines the type of data you want to edit (pages, layouts or snippets):
- pages. Example:
:Radiant edit pages/Home Page/First Post/body
will let you edit the body part of the Fist Post. the prefix pages indicates to the script that we're going to look for a page's part by going through the whole hierarchy, identifying pages at each level by their title or their slug. Hitting tab completes your path.
- layouts. Example:
:Radiant edit layouts/normal
. The layout is identified by its name
- snippets.Example:
:Radiant edit snippets/footer
. The snippet is identified by its name
Cache is cleared when saving an edited object.
Requirements
- Vim with ruby support, tested with 7.0 and 6.4
Known Bugs
- There is a problem with the swapfile. If you simultaneously edit 2 parts named body, Vim will complain that the swapfile already exists. Currently I advise to turn swapfiles off (:set noswapfile).
Limitations
- environment to use is currently hard-coded as production
- no configuration at all to set the radiant home
- not yet made as a plugin
- no error handling
- I think you need to put the file in Radiant's root directory and source if from there. The path to the database.yml file is hard-coded as config/database.yml
- No creation of pages
- Changing the status or the markup used in a page is not possible.
Download
v0.0.3
v0.0.2
v0.0.1