Vim
:let @a='' | g!/hello/normal "Ayy
, "hello" "a". "ap normal"
:let @*=@a
"Ctrl + V" Windows "Cmd + V" Mac Os " " Linux .
:
@a - Vim, , 'a'.
"ap, " bp, "cp,.. Vim, .
@* - Vim, .
let @* = @a 'a' System.
.vimrc .
function s:copy_unmathced_lines(pattern)
let result_lines = []
for line in getline(1, '$')
if line !~ a:pattern
call add(result_lines, line)
endif
endfor
let @* = join(result_lines, "\n")
endfunction
command -nargs=1 CopyUnmatchedLines call s:copy_unmathced_lines(<q-args>)
:
CopyUnmatchedLines hello
.