2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

vimにて文字列ブロックを右にペーストする

Last updated at Posted at 2021-01-30

Summary

vimにて文字列ブロックを右にペーストする

したいこと

before

分割前
--------------------------------
{
  支払日   = 2021/01/30 0:00:00
  支払者   = "callmekohei"
  カテゴリ = "おやつ"
  購入品   = "牧のうどん肉入り"
  価格     = 350
}


分割後
--------------------------------
{
  支払日 = 2021/01/30 0:00:00
  支払者 = "callmekohei"
  Category = {
    カテゴリ = "おやつ"
    購入品 = "牧のうどん肉入り"
    価格 = 350
  }
}

after

 分割前                             分割後
 --------------------------------   --------------------------------
 {                                  {
   支払日   = 2021/01/30 0:00:00      支払日 = 2021/01/30 0:00:00
   支払者   = "callmekohei"           支払者 = "callmekohei"
   カテゴリ = "おやつ"                Category = {
   購入品   = "牧のうどん肉入り"        カテゴリ = "おやつ"
   価格     = 350                       購入品 = "牧のうどん肉入り"
 }                                      価格 = 350
                                      }
                                    }

方法

ポイント:左文字列ブロック、右文字列ブロックともに矩形にする


1. 左側の文字列を矩形にする(行末にスペースを詰め込む)

set virtualedit=all
visual mode で行末から選択して矩形選択
カット
ペースト

2. 右側の文字列を矩形にする

3. ペースト

see also

Neovimでclipboardにunnamedを設定してるとペーストした際にレイアウトが崩れるのを回避する方法
行末を適切な数のスペースで埋めて行の幅を整える

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?