Skip to content

inotom/magtag

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
doc
 
 
 
 
 
 
 
 
 
 

magtag

Insert img tag with width and height property.

Installation

Put this plugin files into $HOME/.vim directory. This plugin is required ImageMagick.

Options

g:magtag_insert_pos

Insert img tag position. 0: after cursor (default), 1: before cursor

g:magtag_html_template

Template for html image tag

g:magtag_php_template

Template for php image tag

g:magtag_slim_template

Template for slim image tag

g:magtag_eruby_template

Template for eruby image tag

Sample configs

let g:magtag_html_template = '<img src="%s" width="%d" height="%d" alt="">'
let g:magtag_php_template = '<img src="<?php the_img( ''%s'' ); ?>" width="%d" height="%d" alt="">'
let g:magtag_slim_template = '= image_tag "%s", width: %d, height: %d, alt: ""'
let g:magtag_eruby_template = '<%%= image_tag "%s", width: %d, height: %d, alt: "" %%>'

Usage

:MagTag hoge.jpg

About

Vim script to insert <img> tag after cursor position with image width and height property.

Resources

License

Stars

Watchers

Forks

Packages

No packages published