首页 > 数据库 > 数据库开发技术 > vim下快速输入sql语句
vim下快速输入sql语句
最近没事干,看了《Hacking Vim》,自己总觉一下,写了一个快速输入sql的脚本abbr,通过别名以及字典建立快速输入sql:
(注意斜线被替换为全角的/).
abbreviate sqls select * from <+table+> where <+field+> = :<+value+> ;
abbreviate sqlu update <+table+> set <+field+> = :<+values+> where <+field+> = :<+values+> ;
abbreviate sqld delete from <+table+> where <+field+> = :<+values+> ;
nnoremap
inoremap
nnoremap
inoremap
set dictionary+=$VIMRUNTIME/dict/tables.txt
set dictionary+=$VIMRUNTIME/dict/fileds.txt
tables.txt 与fields.txt 可以从数据库获得。
ctrl+x ,ctrl+k 启动字典。
[@more@]来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/267265/viewspace-998745/ ,如需转载,请注明出处,否则将追究法律责任。