vim을 사용하여 변수를 표시할 수 있지만 :let g:
그 안에서 검색할 수는 없습니다(키 바인딩이 매우 제한적인 것 같습니다). vim
이 콘텐츠를 내부 버퍼로 열거나 다른 명령으로 전달할 수 있습니까 ?
답변1
당신이 할 수 있는 일은 :redir
파일에 쓴 다음 편집하는 것입니다:
:redir > variables.vim
:let g:
:redir END
:n variables.vim
또는 variables.vim
다른 명령에 대한 입력으로 사용됩니다.
답변2
Vim 8.1.0495(2018년 10월 25일)
vim 패치 8.1.0495를 사용하면 이 :filter
명령이 지원됩니다.:let
:filter <pattern> let g:
:filt :filter
:filt[er][!] {pat} {command}
:filt[er][!] /{pat}/ {command}
Restrict the output of {command} to lines matching
with {pat}. For example, to list only xml files:
:filter /\.xml$/ oldfiles
If the [!] is given, restrict the output of {command}
to lines that do NOT match {pat}.
{pat} is a Vim search pattern. Instead of enclosing
it in / any non-ID character (see 'isident') can be
used, so long as it does not appear in {pat}. Without
the enclosing character the pattern cannot include the
bar character.
The pattern is matched against the relevant part of
the output, not necessarily the whole line. Only some
commands support filtering, try it out to check if it
works. Some of the commands that support filtering:
:# - filter whole line
:clist - filter by file name or module name
:command - filter by command name
:files - filter by file name
:highlight - filter by highlight group
:jumps - filter by file name
:let - filter by variable name
:list - filter whole line
:llist - filter by file name or module name
:marks - filter by text in the current file,
or file name for other files
:oldfiles - filter by file name
:set - filter by variable name
Only normal messages are filtered, error messages are
not.