diff options
Diffstat (limited to 'public/posts/2021-10-02/vim-swap-order-of-selected-lines/index.html')
| -rw-r--r-- | public/posts/2021-10-02/vim-swap-order-of-selected-lines/index.html | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/public/posts/2021-10-02/vim-swap-order-of-selected-lines/index.html b/public/posts/2021-10-02/vim-swap-order-of-selected-lines/index.html index 366912c..8dbea05 100644 --- a/public/posts/2021-10-02/vim-swap-order-of-selected-lines/index.html +++ b/public/posts/2021-10-02/vim-swap-order-of-selected-lines/index.html @@ -10,7 +10,7 @@ <link rel="icon" type="image/svg+xml" href="/favicon.svg"> <title>Vimで選択した行の順番を入れ替える | REPL: Rest-Eat-Program Loop</title> <link rel="stylesheet" href="/style.css?h=17cf97a767ec5fb6e64967729f40f30a"> - <link rel="stylesheet" href="/hl.css?h=208c52e3b7c9db1cad782c5d30b4698f"> + <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b"> </head> <body class="single"> <header class="header"> @@ -125,7 +125,7 @@ なお、<code>:g/^/m0</code>は全ての行を入れ替えるが、<code>:N,Mg/^/mN-1</code>とすることで N行目から M行目を処理範囲とするよう拡張できる。手でこれを入力するわけにはいかないので、次のようなコマンドを用意する。 </p> - <pre class="highlight" language="vim" linenumbering="unnumbered"><code>command! -bar -range=% + <pre class="highlight" language="vim" linenumbering="unnumbered"><code class="highlight">command! -bar -range=% \ Reverse \ <line1>,<line2>g/^/m<line1>-1</code></pre> @@ -160,7 +160,7 @@ 前述した<code>:Reverse</code>コマンドの定義を少し変えて、次のようにする: </p> - <pre class="highlight" language="vim" linenumbering="unnumbered"><code>function! s:reverse_lines(from, to) abort + <pre class="highlight" language="vim" linenumbering="unnumbered"><code class="highlight">function! s:reverse_lines(from, to) abort execute printf("%d,%dg/^/m%d", a:from, a:to, a:from - 1) endfunction @@ -217,7 +217,7 @@ </p> </blockquote> - <pre class="highlight" language="vim" linenumbering="unnumbered"><code>command! -bar -range=% + <pre class="highlight" language="vim" linenumbering="unnumbered"><code class="highlight">command! -bar -range=% \ Reverse \ keeppatterns <line1>,<line2>g/^/m<line1>-1</code></pre> @@ -234,7 +234,7 @@ <section id="section--_コピペ用再掲"> <h2><a href="#section--_コピペ用再掲">コピペ用再掲</a></h2> - <pre class="highlight" language="vim" linenumbering="unnumbered"><code>" License: Public Domain + <pre class="highlight" language="vim" linenumbering="unnumbered"><code class="highlight">" License: Public Domain command! -bar -range=% \ Reverse |
