GeanyはGTK+上の軽量なクロスプラットフォームのテキストエディタであり、Scintillaと基本的な統合開発環境 (IDE) 機能をベースとしている。他のパッケージにあまり依存せず、立ち上げ時間が短い設計になっている。Windows、Linux、macOS、BSD、Solarisなど、様々なオペレーティングシステムで動作する。サポートするプログラミング言語としては、C言語、Java、JavaScript、PHP、HTML、CSS、Python、Perl、Ruby、Pascal、Haskell、Lua などがある。
スニペット(英語: snippet)とは、「断片」という意味である。情報処理の分野ではよく使う短いプログラムコードを統合開発環境から呼び出す機能の事である。また、呼び出される短いコードの事をスニペットと呼ぶ場合もある。
設定
ツール(T) → 設定ファイル(O) → filetype_extensions.conf
# Filetype extension configuration file for Geany
# Insert as many items as you want, separate them with a ";".
# See Geany's main documentation for details.
[Extensions]
### 省略 ###
Pascal=*.pas;*.pp;*.inc;*.dpr;*.dpk;
Perl=*.pl;*.perl;*.pm;*.agi;*.pod;
PHP=*.php;*.php3;*.php4;*.php5;*.phtml; # ← phtml の p を削除して保存
Po=*.po;*.pot;
Python=*.py;*.pyw;SConstruct;SConscript;wscript;
### 以下略 ###
HTML=*.htm;*.html;*.shtml;*.hta;*.htd;*.htt;*.cfm;*.php; # ← 追記して保存
適用
ツール(T) → 設定ファイル(O) → snippets.conf https://gist.github.com/DOlDNa/4b62f9d7dcd8dfc7a225ae69492a6401 を [PHP] にコピペ。チートシート
| 入力 | 出力 |
|---|---|
| if | if ( ) |
| else | else |
| for | for ($i=0, $c=count( ); $i < ; ++$i) |
| func | function ( ) |
| while | while ( ) |
| do | do |
| switch | switch ( ) |
| try | try |
| fil | filter_input(INPUT_POST, ' ', FILTER_SANITIZE_STRING) |
| filv | filter_has_var(INPUT_POST, ' ') |
| var | var_dump( ); |
| log | console.log(' '); |
| a | <a href=" "> </a> |
| abbr | <abbr title=" "> </abbr> |
| absolute | <div class="position-absolute"> </div> |
| acco | <div class="accordion" id="a "> |
| addr | <address> </address> |
| alert | <div class="alert alert-danger "><a href=" " class="alert-link"> </a> </div> |
| baseline | <span class="align-baseline"> </span> |
| bdg | <span class="badge badge-secondary "> </span> |
| bgda | <div class="p-3 mb-2 bg-danger text-white"> </div> |
| bgdk | <div class="p-3 mb-2 bg-dark text-white"> </div> |
| bgin | <div class="p-3 mb-2 bg-info text-white"> </div> |
| bgli | <div class="p-3 mb-2 bg-light text-dark"> </div> |
| bgpr | <div class="p-3 mb-2 bg-primary text-white"> </div> |
| bgse | <div class="p-3 mb-2 bg-secondary text-white"> </div> |
| bgsu | <div class="p-3 mb-2 bg-success text-white"> </div> |
| bgwa | <div class="p-3 mb-2 bg-warning text-white"> </div> |
| bgwh | <div class="p-3 mb-2 bg-white text-dark"> </div> |
| bold | <p class="font-weight-bold"> </p> |
| bottom | <span class="align-bottom"> </span> |
| br | <br> |
| btn | <button type="button" class="btn btn-primary "> </button> |
| btng | <div class="btn-group "> |
| cap | <p class="text-capitalize"> </p> |
| card | <div class="card"> |
| caro | <div id=" " class="carousel slide" data-ride="carousel"> |
| center | <p class="text-center"> </p> |
| cite | <cite> </cite> |
| clear | <div class="clearfix "> </div> |
| close | <button type="button" class="close" aria-label="Close"><span aria-hidden="true">×</span></button> |
| code | <code> </code> |
| d1 | <h1 class="display-1"> </h1> |
| d2 | <h1 class="display-2"> </h1> |
| d3 | <h1 class="display-3"> </h1> |
| d4 | <h1 class="display-4"> </h1> |
| dd | <dd> </dd> |
| del | <del> </del> |
| div | <div class=" "> </div> |
| dl | <dl class=" "> |
| dt | <dt> </dt> |
| em | <em> </em> |
| emb | <div class="embed-responsive embed-responsive-16by9 "> </div> |
| fig | <figure class="figure"> |
| fixed | <div class="position-fixed"> </div> |
| fixedb | <div class="fixed-bottom"> </div> |
| fixedt | <div class="fixed-top"> </div> |
| fl | <div class="float-left"> </div> |
| flex | <div class="d-flex justify-content-between "> |
| fr | <div class="float-right"> </div> |
| h1 | <h1> </h1> |
| h2 | <h2> </h2> |
| h3 | <h3> </h3> |
| h4 | <h4> </h4> |
| h5 | <h5> </h5> |
| h6 | <h6> </h6> |
| h50 | <div class="h-50"></div> |
| hr | <hr> |
| img | <img class="img-fluid" src=" " alt=" "> |
| imgr | <img class="rounded" src=" " alt=" "> |
| imgt | <img class="img-thumbnail" src=" " alt=" "> |
| ins | <ins> </ins> |
| inv | <div class="invisible"> </div> |
| italic | <p class="font-italic"> </p> |
| jumbo | <div class="jumbotron "> </div> |
| kbd | <kbd> </kbd> |
| lead | <p class="lead"> </p> |
| left | <p class="text-left"> </p> |
| li | <li> </li> |
| lig | <ul class="list-group"> |
| light | <p class="font-weight-light"> </p> |
| liin | <ul class="list-inline"> |
| lower | <p class="text-lowercase"> </p> |
| mark | <mark> </mark> |
| media | <div class="media"> |
| mh | <div class="mh-100"> </div> |
| middle | <span class="align-middle"> </span> |
| mono | <p class="text-monospace"> </p> |
| mvh | <div class="min-vh-100"> </div> |
| mvw | <div class="min-vw-100"> </div> |
| mw | <div class="mw-100"> </div> |
| nomal | <p class="font-weight-normal"> </p> |
| ol | <ol class=" "> |
| p | <p> </p> |
| pill | <span class="badge badge-pill badge-primary "> </span> |
| pop | <button type="button" class="btn btn-lg btn-danger " data-toggle="popover" data-placement="top " title=" " data-content=" "> </button> |
| pre | <pre> |
| prec | <pre><code> </code></pre> |
| prog | <div class="progress"> |
| qt | <blockquote class="blockquote nowrap"> |
| relative | <div class="position-relative"> </div> |
| right | <p class="text-right"> </p> |
| row | <div class="row"> |
| s | <s> </s> |
| samp | <samp> </samp> |
| shadow | <div class="shadow p-3 mb-5 bg-white rounded"> </div> |
| small | <small> </small> |
| span | <span> </span> |
| spin | <div class="spinner-grow text-primary " role="status"> |
| static | <div class="position-static"> </div> |
| sticky | <div class="position-sticky"> </div> |
| strong | <strong> </strong> |
| tab | <nav class="nowrap"> |
| table | <table class="table table-dark"> |
| tb | <span class="align-text-bottom"> </span> |
| text | <p class="text-primary "> </p> |
| tip | <button type="button" class="btn btn-secondary " data-toggle="tooltip" data-placement="top " data-html="true" title=" "> </button> |
| top | <span class="align-top"> </span> |
| ttop | <span class="align-text-top"> </span> |
| u | <u> </u> |
| ul | <ul class=" "> |
| upper | <p class="text-uppercase"> </p> |
| vh | <div class="vh-100"> </div> |
| visible | <div class="visible"> </div> |
| vw | <div class="vw-100"> </div> |
| w50 | <div class="w-50"> </div> |