ohtorii / ya_hidemaru_snippet Goto Github PK
View Code? Open in Web Editor NEW秀丸エディタの動的スニペット
Home Page: http://d.hatena.ne.jp/ohtorii/
License: MIT License
秀丸エディタの動的スニペット
Home Page: http://d.hatena.ne.jp/ohtorii/
License: MIT License
ディレクトリ階層を以下のように変更する。
ユーザーにキーアサインして欲しいマクロは「秀丸マクロディレクトリ」以下へ配置し、ya_hidemaru_snippetディレクトリ以下に内部利用のマクロ、スニペットファイルを配置する。
├─ya_config_menu.mac
├─ya_hidemaru_snippet.mac
└─ya_hidemaru_snippet
├─doc
├─internal
└─snippet
└─text-mode
├─c-mode
│ └─cpp-mode
└─fx-mode
C#のスニペットである cs-mode から c-mode の for.txt を参照したい。
現状で同じファイルのコピーを保持するしかない、保守に手間がかかるので何とかしたい。
スニペットファイルの構文を拡張して(例えばinclude命令)、外部ファイルを取り込めるようにするといった案が考えられる。
(問題)
現状の入力方法
Command Arg1 Arg2...
こういう場面で使えない
foo := Command Arg1 Arg2...
fooをコマンドとして認識するのでスニペットが誤発するか動作しない。
(課題)
コマンドより前に文字がある場合でも、スニペットが正常に発動するように。
(案1)
メニューからコマンドを選ぶと ダイアログが起動するようにして、そのダイアログで引数を入力する。
→ダイアログ中では単語補完と秀丸エディタのマクロが効かない。(引数も効率よく作りたい)
(案2)
カール位置付近からコマンド文字列を見つけてくる。
引数にコマンドと同じ文字列が含まれていると誤発動する恐れあり。
class name class arg2
(問題点)
コメントの記述方法はスニペットを処理する言語依存する。
(追加でやりたいこと)
コメントだけでなくヘルプも埋め込みたい。
(例)TXTの場合。(yasnippetまんま)
スニペット本体はこの行から始まる。
snippetsディレクトリ直下にある下記ファイルを internalディレクトリ へ移動する、
スニペットのディレクトリにあるのは間違い。
このようなコマンドを実装したいが、*:/?はファイル名として使えない。
【展開前】
(案1)
全角文字(*:/¥)でファイル名を付ける。
*.%.%.txt
コマンド中の「半角*」はファイル名を検索するときには「全角*」として扱うと何とかなりそう。
コマンドを除いた文字列をスニペットへ渡せるようにする、markdownのスニペットで必要となった。
下記例では、"引数1 引数2" がスニペットへ渡される。
コマンド 引数1 引数2
対応が必要なマクロ。
ya_hidemaru_snippet_bat.mac
ya_hidemaru_snippet_js.mac
ya_hidemaru_snippet_mac.mac
ya_hidemaru_snippet_py.mac
ya_hidemaru_snippet_txt.mac
ya_hidemaru_snippet_vbs.mac
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.