FlagIt is a Vim plugin that prefixes lines with icons.
:FlagIt flagName [line number]
toggle a flag. If no line number is provided, the current line is used.:FlagList
list all avaible flags.:FlagDemo
just a way to draw all kind of flags (debug).
g:Fi_OnlyText
if1
, force text mode.g:Fi_ShowMenu
if1
and Gui avaible andg:Fi_OnlyText
is0
, a menu is added to the toolbar.g:Fi_Flags
a dictionnary of flag definitions.- A definition is declared as:
name : [path, fallback, isUniq, [optional] signArgs]`
name
a uniq identifier.path
path to the image. The image will be drawn as a pixmap (if GUI avaible andg:Fi_OnlyText
is0
).fallback
one or two character Drawn if text mode org:Fi_OnlyText
is1
.uniq
if1
, only one instance of this flag will be drawn (any other instance will be disabled). Useful to draw a cursor for example.signArgs
additional arguments to the sign definition (:sign define
; see:help sign
). Useful for theming.
map <F1> :FlagIt arrow<CR>
map <F2> :FlagIt function<CR>
map <F3> :FlagIt warning<CR>
map <F4> :FlagIt error<CR>
map <F5> :FlagIt step<CR>
let icons_path = "/home/paul/.vim/signs/tango/"
let g:Fi_Flags = { "arrow" : [icons_path."16.png", "> ", 1, "texthl=Title"],
\ "function" : [icons_path."17.png", "+ ", 0, "texthl=Comment"],
\ "warning" : [icons_path."8.png", "! ", 0, "texthl=StatusLine linehl=StatusLine"],
\ "error" : [icons_path."4.png", "XX", "true", "texthl=ErrorMsg linehl=ErrorMsg"],
\ "step" : [icons_path."5.png", "..", "true", ""] }
let g:Fi_OnlyText = 0
let g:Fi_ShowMenu = 0
Save flags (Modelines ? session ? dedicated file ?)