エディタから本サイトを検索

提供:GizmoLabs - だいたい CAD LISP なサイト
2013年5月9日 (木) 09:41時点におけるGizmon (トーク | 投稿記録)による版 (→‎Notepad++ で検索)

秀丸から検索

秀丸エディタからの検索は下記のマクロを登録して使うといいかも。

//gzwiki.mac
//by gizmon
//2012.02.06
//
//範囲選択している文字列、カーソル位置にある単語、または任意の
//文字列を入力して gizmolabs wiki をブラウザ検索をします。
//Hidemernet Explorer をインストールしているときは秀丸エディタ
//上に検索結果を出すこともできます。

//以下設定
#fHmnetex = false;  //Hidemernet Explorerを使う場合true
//以上設定

if( selecting ) {
    $s = gettext(seltopx,seltopy,selendx,selendy);
} else {
    selectword;
    $s = gettext(seltopx,seltopy,selendx,selendy);
    $s = input( "GizmoLabsWiki検索",  $s );
}
if( $s == "" ) {
    endmacro;
}
$param = "";
if( #fHmnetex ) {
    $percent = "%";
    $and = "&";
} else {
    $percent = "^%%";
    $and = "^&";
}
#c = strlen( $s );
#i = 0;
while( #i < #c ) {
    $param = $param + $percent +
        leftstr( hex( ascii( midstr( $s, #i, 1 ) ) ), 2 );
    #i = #i + 1;
}
$param = "http://wiki.gz-labs.net/index.php?search=" + $param ;
if( #fHmnetex ) {
    openfile $param;
} else {
    run getenv("Comspec") + " /c start " + $param + " >nul";
}
endmacro;


xyzzy から検索

こちら http://sonic64.com/2005-09-06.html を参考に作り変えました。

下記を保存して .xyzzy ファイルに追加。 文字列を選択して、CTRL + C g を押す。

; GizmoLabsWiki を検索
(defun search-gzwiki (&optional str)
  (interactive)
  (unless str
    (setq str (read-string "GizmoLabs Wiki: ")))
  (long-operation
    (let ((url (concat "http://wiki.gz-labs.net/index.php?search="
                      (si:www-url-encode str))))
      ;─────────────────────
      ; 1. 標準ブラウザを使う場合
      (shell-execute url t)
      ; 2. browser.dll & browserex.l を使う場合
      ;(bx::navigate url)
      ; 3. www-mode を使う場合
      ;(www-open-url url)
      ;─────────────────────
      )))
 ; セレクションの文字列を検索
(defun search-gzwiki-selection ()
  (interactive)
  (search-gzwiki (if (pre-selection-p)
                    (selection-start-end (beg end)
                      (buffer-substring beg end))
                  nil)))
(global-set-key '(#\C-c #\g) 'search-gzwiki-selection)
  • xyzzy の右クリックメニューに「Google で検索」を追加するには下記も追加
; 右クリックメニューに「選択文字をGizmoLabs Wikiで検索」を追加
(add-hook '*post-startup-hook*
        #'(lambda()
            (add-menu-item *app-popup-menu* nil "選択文字をGizmoLabs Wikiで検索 (&G)"
                 'search-gzwiki-selection nil)))

Notepad++ で検索

プラグインマネージャから、 NppExec を追加して、 NppExec に以下用な感じで設定する。

"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" http://wiki.gz-labs.net/index.php?search=$(CURRENT_WORD)