A Vim plugin providing functionality to make maintaining an XMLTV grabber configuration file easier and less error-prone.
This plugin provides:
- Automatic filetype detection
- Syntax highlighting
- Automatic folding
- Normal/visual mode support
The following filenames are automatically set to the 'xmltvconfig' filetype:
- tv_grab_*
- freeview*.conf
- freesat*.conf
- sky*.conf
- virgin*.conf
Other fixup files can be assigned the 'xmltvconfig' filetype automatically by adding the following to your .vimrc:
autocmd BufNewFile,BufRead */path/to/config/file set filetype=xmltvconfig
Highlighting of the 'xmltvconfig' filetype is used to distinguish the following elements in a grabber config file:
- Setting key
- Setting value
- Enabled channels
- Disabled channels
Settings and channel entries are automatically folded into separate folds when a config file is opened.
The plugin provides commands for both normal and visual modes that can be mapped. The default mappings can be disabled by setting g:xmltvconfig_no_mappings=1 in your .vimrc
Normal mode commands allow an entry on the current line to be toggled, enabled or disabled. Visual mode commands allow the same functionality but on the current selection.
By default, the following mappings are configured for the xmltvconfig filetype, and only for the current buffer:
Normal mode (work on current line):
- x ToggleLine
- e EnableLine
- d DisableLine
Visual mode (work over current selection):
- x Toggle
- e Enable
- d Disable
None. A working XMLTV installation makes this plugin useful.
Installing vim-xmltvconfig is straightforward. Use of a Vim plugin manager is recommended (I currently use vim-plug).
If you are using vim-plug you need to have the following line
in your .vimrc
:
Plug 'knowledgejunkie/vim-xmltvconfig'
To install the plugin from within Vim, run:
:PlugInstall vim-xmltvconfig
To install the plugin from the command line, run:
$ vim +PlugInstall vim-xmltvconfig +qall
For Vundle you need to make sure you have the following line in
your .vimrc
:
Bundle 'knowledgejunkie/vim-xmltvconfig'
To install the plugin from within Vim, run:
:PluginInstall
To install the plugin from the command line, run:
$ vim +PluginInstall +qall
For Pathogen, execute:
cd ~/.vim/bundle
git clone https://github.com/knowledgejunkie/vim-xmltvconfig
vim +Helptags +q
Filetype detection, toggling, syntax highlighting and folding should "just work" once the plugin is installed.
- Support more settings (e.g. encodings)
The framework for the normal/visual mode handling came directly from the awesome vim-commentary plugin (https://github.com/tpope/vim-commentary) by Tim Pope.
Copyright (c) 2016 Nick Morrott. Distributed under the same terms as Vim itself. See :help license
.