@username
を付けます 13 | function! PutInNew(cmd) abort
14 | let l:res = execute(a:cmd)
15 | new
16 | setlocal buftype=nofile
17 |
18 | put =l:res
19 | endfunction
29 | command! -nargs=* PutInNew :call PutInNew(<q-args>)
21 | function! s:PutLineInNew()
22 | let l:linenr = line('.')
23 | let l:line = get(getbufline('%', l:linenr), 0, '')
24 |
25 | call PutInNew(l:line)
26 | call histadd(':', "call PutInNew('" .. substitute(l:line, "'", "''", 'g') .. "')")
27 | endfunction
30 | command! PutLineInNew :call <SID>PutLineInNew()
string(l:line)
でよさそう