sponsor Vim development Vim logo Vim Book Ad

html_FileCompletion : Base dir- and URL-aware file completion for HTML links.

 script karma  Rating 1/1, Downloaded by 246    Comments, bugs, improvements  Vim wiki

created by
Ingo Karkat
 
script type
ftplugin
 
description
DESCRIPTION
This plugin offers insert mode file completion for HTML links to local files,
taking into account a base directory (document root) and base URL (web server
location) to enable completion of absolute (/foo...) and fully qualified
(http://host/foo...) links.

USAGE
CTRL-X CTRL-F           Find matches for file names that start with the same
                        'isfname' characters as before the cursor. File names
                        are inserted in URL-escaped form (e.g. <Space> -> %20)
                        and always with forward slashes as path separator.
                        An absolute file path starting with "/" is interpreted
                        relative to b:basedir, and a base URL b:baseurl is
                        stripped off the front. This enables you to complete
                        file links even though they are specified as absolute
                        or fully qualified links in the HTML.
 
install details
INSTALLATION
This script is packaged as a vimball. If you have the "gunzip" decompressor
in your PATH, simply edit the *.vba.gz package in Vim; otherwise, decompress
the archive first, e.g. using WinZip. Inside Vim, install by sourcing the
vimball or via the :UseVimball command.
    vim html_FileCompletion.vba.gz
    :so %
To uninstall, use the :RmVimball command.

DEPENDENCIES
- Requires Vim 7.0 or higher.


CONFIGURATION
Set the following variables in autocmds, filetype plugins or a local vimrc:

Specifies the local directory that represents the document root of the edited
HTML file, i.e. where an absolute link starting with "/" points to.

Specifies the server location of the b:basedir document root; i.e. a fully
qualified link to the document root, including protocol and hostname.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
html_FileCompletion.vba.gz 1.11 2012-06-15 7.0 Ingo Karkat FIX: Do not clobber the global CWD when the buffer has a local CWD set.
html_FileCompletion.vba.gz 1.10 2012-05-21 7.0 Ingo Karkat ENH: Auto-discover b:basedir by traversing up the directories until one is found that contains no HTML files.
html_FileCompletion.vba.gz 1.00 2012-05-15 7.0 Ingo Karkat Initial upload
ip used for rating: 184.73.87.85

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
SourceForge.net Logo