5
2

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で/Users/ユーザー名/*を/Users/user_name/*に置換する

Last updated at Posted at 2016-11-06

ブログを書く時などに、 /Users/ユーザー名/* 部分を匿名化したい。

置換コマンド

:%s/\(\/Users\/\)\w\+/\1user_name/g

コマンド化

command! ChangeUsersDirName :%s/\(\/Users\/\)\w\+/\1user_name/g

後は :ChangeUsersDirName で呼び出すだけ!!!

追記(2016/11/07 01:22):

簡略化しました

5
2
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
5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?