Vim6スクリプトお勉強スレat UNIX
Vim6スクリプトお勉強スレ - 暇つぶし2ch370:367
03/05/17 22:00
>>369
ありがとうございました。すごく勉強になります。
しかし、行の最後にいるときにうまくいきません。
場合分けしたのですが、最後の\<Right>がうまく機能しません。
function! InsertSpace(chr)
let left = getline(".")[col(".")-2]
let right = getline(".")[col(".")-1]
if strlen(getline(".")) == col(".")
if right == ' '
execute "normal a\<C-V>".a:chr." \<Right>"
else
execute "normal a \<C-V>".a:chr." \<Right>"
endif
else
if left == ' ' && right == ' '
execute "normal i\<C-V>".a:chr."\<Right>"
elseif left != ' ' && right != ' '
execute "normal i \<C-V>".a:chr." \<Right>"
elseif left != ' '
execute "normal i \<C-V>".a:chr."\<Right>\<Right>"
elseif right != ' '
execute "normal i\<C-V>".a:chr." \<Right>"
endif
endif
endfunction


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