Vim6スクリプトお勉強スレat UNIX
Vim6スクリプトお勉強スレ - 暇つぶし2ch310:羊
02/12/30 00:17
HTML で困るものをエスケープするスクリプトを書いたんですが、
範囲選択の後に :'<,'>call HtmlEscape と入力しなければならないです。
そうじゃなくて、:'<,'>HtmlEscape にするにはどうすればいいの?
# command あたりがあやしかったがわからなかった...

if exists("loaded_html_escape")
finish
endif
let loaded_html_escape = 1
function HtmlEscape() range
let index = a:firstline
while index <= a:lastline
let line = getline(index)
let line = substitute(line, "&", "\\&", "g")
let line = substitute(line, "<", "\\<", "g")
let line = substitute(line, ">", "\\>", "g")
call setline(index, line)
let index = index + 1
endwhile
endfunction


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch