0
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.

【メモ】【サクラエディタ】意外と使うマクロ

Last updated at Posted at 2021-06-15

はじめに

個人的に好きなサクラエディタ
意外と使うマクロを忘備録的な意味合いで記述しようと思ったのでついでに記事にしてみました。

マクロの登録方法

以下のように検索すればたくさん出てくるので、
「サクラエディタ マクロ」で検索!

参考

・[サクラエディタでキーマクロやjsマクロを新規作成する方法とその使い方]
(https://proengineer.internous.co.jp/content/columnfeature/5479)
・[サクラエディタでのマクロの設定方法・使い方]
(https://web.plus-idea.net/2016/09/use-sakura-editor-macro/)


ハイライト

単語をダブルクリックしたらエディタ内の同じ単語をハイライトにするマクロ
よくあるやつなので、検索したらすぐ出てくるやつ。

S_SelectWord(0);
S_SearchClearMark(0);

Jsonデータ整形

Jsonデータ整形とは言うものの、単純にカンマを改行させるだけ。
ログとかからちょっとしたJsonデータを見たい時に便利なのでよく使います。

S_ReplaceAll(',', ',¥¥r¥¥n', 44); // 全て置換
S_ReDraw(0);	                  // 再描画

スネークケースからキャメル式へ変換

変数名の変換など。
今はあまり使うことはないが、一応。
VScode等あればそれで対応すれば良い!

S_ReplaceAll('(_|^)(.)', ',¥¥u$2', 172); // 全て置換
S_ReDraw(0);	                         // 再描画
S_ReplaceAll('(^.)', ',¥¥l$1', 172);     // 全て置換
S_ReDraw(0);	                         // 再描画

おわりに

記事になるかと思いましたが、
あんまり汎用的で使用できるものがなかったので残念。。
今後も勉強がてら何か作成して追記していきたいです。

0
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
0
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?