Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
49
Help us understand the problem. What is going on with this article?
@hktt

Atomエディタで改行コードを含めて置換する方法

More than 5 years have passed since last update.

改行を含めて置換するには、検索viewを正規表現モードにして\nを入れることで可能になります。

例えば以下の様な行があるとします。

{hoge: 1, fuga: 2, fuba: 3}

この行をカンマの後に改行を入れたい場合の手順は以下になります。

  1. Cmd+Fで検索Viewを表示
    untitled_-__Users_hakutoitoi__ghq_github_com_spacemarket_spmkt_web_-_Atom_と_Atom_Advent_Calendar_2014_-_Qiita_と_1__screen__ruby_.png

  2. Cmd+Option+/を押して正規表現モードを有効にする
    untitled_-__Users_hakutoitoi__ghq_github_com_spacemarket_spmkt_web_-_Atom.png

  3. 置換対象文字列に,を入力
    untitled_-__Users_hakutoitoi__ghq_github_com_spacemarket_spmkt_web_-_Atom_と_Atom_Advent_Calendar_2014_-_Qiita.png

  4. 置換後文字列に,\nを入力する
    untitled_-__Users_hakutoitoi__ghq_github_com_spacemarket_spmkt_web_-_Atom_と_Atom_Advent_Calendar_2014_-_Qiita 2.png

  5. Replace NextまたはReplace Allボタンを押すと改行が入ります。

{hoge: 1,
 fuga: 2,
 fuba: 3}

※正規表現モードにしないと\nが普通に入力されてしまいます。

49
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
49
Help us understand the problem. What is going on with this article?