vim - Using abbreviation to insert comment -
i’m trying set abbreviation in .vimrc
insert comment template heading-level comments in css files.
the comment want insert is:
/* ========================================================================== # ========================================================================== */
i jump #
, add title there (e.g. buttons
).
the abbreviation have attempted set looks this:
iab comsec· \/* ========================================================================== \<cr># \<cr>========================================================================== */
(where ·
represents trailing space.)
right away feels pretty crude, specific problem if try , drop comsec
in css, starts wrapping in more comments. output looks this:
/* ========================================================================== * # * ========================================================================== */
notice 2 *
@ beginnings of lines 2 , 3?
is there way tell vim not try , clever , drop in i’ve told it? way prevent vim trying wrap comments around comment?
i’m not particularly hardcore vim user, there’s every chance i’m overcomplicating things, or missing obvious, or using wrong tool job.
thanks!
if type of person can keep track of personal utilities, isn't fancy works. can import output of external command buffer, put mapping in .vimrc file:
"bc = block comment map ,bc :read! python ~/my_personal_utils/insert_css_comment.py
so, have type ",bc" add comment. on mac @ least, leaves me hanging in command mode, cursor after '.py' , can type argument buttons (i.e. python script takes optional argument).
Comments
Post a Comment