gvim – VIMs %<-Variablensubstitutionsproblem
为情所困
为情所困 2017-05-16 16:39:25
0
4
840

Wie ersetze ich %<durch Dateiname.data?

Ersetzen Sie beispielsweise das obige %<.data durch den folgenden Dateinamen.data

为情所困
为情所困

Antworte allen(4)
小葫芦

:call append(line("."), expand('%') . ' and something append')

    %       current file name
    #       alternate file name
    #n      alternate file name n
    <cfile>     file name under the cursor
    <afile>     autocmd file name
    <abuf>      autocmd buffer number (as a String!)
    <amatch>    autocmd matched name
    <sfile>     sourced script file name
    <slnum>     sourced script file line number
    <cword>     word under the cursor
    <cWORD>     WORD under the cursor
    <client>    the {clientid} of the last received
            message |server2client()|

Modifiers:
    :p      expand to full path
    :h      head (last path component removed)
    :t      tail (last path component only)
    :r      root (one extension removed)
    :e      extension only
仅有的幸福

我觉得,网上能找到答案的,就不用来这里问了

PHPzhong

进入命令行模式

:%s/%<.data/.data/g
阿神

用这个命令:

Enter之后的结果:

Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage