LoginSignup
14
15

More than 5 years have passed since last update.

Vimで0埋めされた数値をインクリメントしたい

Last updated at Posted at 2013-10-09

下のようなリスト結構ありますよね。

001 hoge
002 fuga
...
007 piyo

で、これをマクロで一番下の行をコピーして、インクリメントしたいこととか結構ありますよね。で、007の上でC-aを押すと010になってびっくりするわけですよ。

...
007 piyo
010 piyo

こうなる。何故こうなるかというと8進数として扱われるからなんですが、これを防ぐには、nfを空にすれば良いとのことです。

set nf=

すると、ちゃんと下のようになります。

...
007 piyo
008 piyo
14
15
5

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
14
15