Groups
Sign in
Groups
vim_jp
Conversations
Labels
About
Send feedback
Help
vim(ver8.2)での :read file
40 views
Skip to first unread message
tora
unread,
Feb 8, 2023, 8:10:18 PM
2/8/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to vim_jp
テキストファイルへ他のファイルを読み込もうとしています。
:-read e:/Myheader/txt.txt では成功しますが、
let s:filename='e:/Myheader/txt.txt'
:-read s:filename
では「ファイルを開けません」となり失敗します。
read という命令は変数が使えないのでしょうか。
Hiroyuki Yoshinaga
unread,
Feb 9, 2023, 2:58:31 AM
2/9/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to vim_jp
2023年2月9日木曜日 10:10:18 UTC+9 tora:
> read という命令は変数が使えないのでしょうか。
read に限らず、ただの文字列を指定できる文は、どれも変数は使えないと思います
これらの文でお手軽に変数を使いたい時は、
execute 'read ' .. s:filename
と execute 文を使えば良いと思います
Reply all
Reply to author
Forward
0 new messages