Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私はファイルを持っていて、次のことをしたいです。
- copy every n lines starting from m (m,m+n,m+2n, ...) - copy line number 2, 5, 27, ... by specifying line numbers.
ありがとう
N 行ごとにコピーするに:globalは、行を選択する式を使用できます。
:global
:let @a = '' :g/^/if line('.') % 3 == 0 | yank A | endif
:yank明示的な行については、次のコマンドを順番に呼び出します。
:yank
2yank a | 5yank A | 27yank A
これは、大文字レジスタへのヤンクを使用して追加します。