★全般的な注意点
設定ファイルなど、utf8ではなくsjisで保存しないと文字化けしたり正しく動作しない場合がある。
・ScanRule.ini(日本語のパスがスキャンされない)
★あふwで必要なもの
bregexp.dll/bregonig.dll
UNZIP32.DLL
あふwこまんど(AFXWCMD.EXE)
afxtools
※afxbkmk.mnu、afxbkmkl.mnuを以下のように修正する。(exeをフルパスで記載)
"add/delete" "$~\afxtools\bin\afxbkmk.exe" "$~\afxtools\bin\afxbkmk.mnu" "$P\\"
"add/delete" "$~\afxtools\bin\afxbkmk.exe" "$~\afxtools\bin\afxbkmkl.mnu" -1e "$P\$F"
※afxfind.iniを以下のように修正する。(keycodeをAFXW.KEYと合わせる)
keycode = 4070
★あふwの設定
☆AFXW.INI------------------------------------------------------------------------
[SCREEN]
POS_X=1642
POS_Y=313
SIZE_X=1227
SIZE_Y=822
VSPLIT=604
HSPLIT=102
[FILEBOX]
PATH_L=C:\
PATH_R=C:\
MASK_L=*.*
MASK_R=*.*
SORT_L=12
SORT_R=12
DIRUP_L=1
CAP_L=1
DIRUP_R=1
CAP_R=1
ICON_L=0
ICON_R=0
NMPM_L=1
NMPM_R=1
TNPM_L=4
TNPM_R=4
TNIS_L=128
TNIS_R=128
ICLS_L=0
ICLS_R=0
TNLS_L=0
TNLS_R=0
TNFS_L=9
TNFS_R=9
GVM_L=0
GVM_R=1
[FONT]
FL_SIZE=10
FL_LSPC=0
FR_SIZE=10
FR_LSPC=0
MB_SIZE=11
VW_SIZE=9
LWFS=7
RWFS=7
PT_NAME=MS ゴシック
PT_SIZE=12
VL_NAME=MS ゴシック
VL_SIZE=12
IF_NAME=MS ゴシック
IF_SIZE=12
FL_NAME=MS ゴシック
FR_NAME=MS ゴシック
MB_NAME=MS ゴシック
FK_NAME=MS ゴシック
FK_SIZE=9
SB_NAME=MS ゴシック
SB_SIZE=9
VW_NAME=MS ゴシック
[CFG]
GV_FIT=1
GV_FSIZE=10
GV_HT=1
GV_STS=0
GV_NUM=0
GV_SCR=0
F_CASE=0
BAVW=0
ZIP7=1
ARC_EXT=.ZIP
ARC_Z=6
ARC_G=6
ARC_B=9
ARC_C=1
ARC_7=1
ARC_X=6
ARC_M=6
DCOMP=0
ABBLOC=0
MIGEMODE=1
GV_EXT=.BMP
LEN_EXT=4
FBWIDTH=0
UBWIDTH=2
NOMARK_OP=0
THUMBW=1
MEDIT=0
FKEY_NUM=0
KEY_SLR=1
KEY_CLR=2
KEY_ALR=3
KEY_SUD=1
KEY_CUD=0
KEY_AUD=2
FB_DRAW=0
SORTC=0
ADMIN=1
MKDIR_IN=1
JPDIR_IN=1
NO_RECYCLE=0
NO_VOLINFO=1
NO_SYS=0
NO_HID=0
FTKEEP=1
NO_CPAT=0
SIZE_KM=1
COMMA=1
NO_SEC=0
SPLIT_CENTER=1
CLOOP=1
DMENU=0
DHIS=1
PFIND=1
INCPART=1
ADCOL=0
NXUSE=0
SXUSE=0
REM_VOLUME=0
BS_LOG=0
MINTRAY=0
LR_BS=1
BMCSR=0
VIEW_TAB=8
BLINES=0
COPY_BUF=4096
SCRL_N=8
SCRL_S=56
EWARN=20
INTVL=500
SHADE=60
HKEY=0
DIF_OVER=2000
DIF_COMP=2000
ARC_DLG=0
ARC_DLX=0
NO_MES=0
CFGNERR=0
ARC_MD=1
ARC_LMZIP=0
ARC_7ZIP=1
FULL_VIEW=0
SCRL_VIEW=1
LOG_TOP=1
LOG_MYD=1
LOG_VOL=0
Q_COPY=0
Q_MOVE=0
Q_EXTR=0
Q_EXIT=1
Q_REGI=1
NO_DOWN=1
ESORT=0
PSORT=1
TF_KEY=0
EN_KEY=0
FB_HSB=0
USE_TRASH=1
SYSTRASH=1
DIV_EXT=1
NO_SUSIE=0
SUFILE=0
FS_CUR=1
MASK_ALL=1
MASK_ARC=0
USE_XAC=0
GV_MRK=0
GV_DDB=0
GV_KEEP=0
HIS_DIR=1
V_SAVE=0
TPATH=1
Z_SAVE=0
LIM_PATH=0
TRASH7=0
ESC_END=0
FSTAT=1
TITLE=0
LINK=0
WALLG=0
WALLC=1
WALLB=0
FSCR_L=0
FSCR_R=0
AUTOTN=1
SAVETN=0
DELDEL=0
LNVW=1
TBVW=1
CRVW=1
ENEW=0
NNRN=0
TIT_HDD=1
SVIEW=0
IFBG_ONLY=0
IFBG_FG=1
IFBG_RS=0
TAB2=
TAB4=cpp c h
TAB8=
NOTTL=
READY=
CF_STR=_
LAYER=230
RAT=1
CPBUF=1
ARC_Z7=9
ARC_7_U=0
ARC_Z7_U=0
[AFXWCFG]
PAGE=7
TAB=0
[PROGRAM]
EDITOR="notepad.exe"
ED_V="$P\$F"
VIEWER=""
SUSIEPATH=""
VARCPATH=""
NXCMD=""
SXCMD=""
[COL]
NORMAL=16777215
SYSFILE=7368888
HIDDEN=16749973
READONLY=7470961
DIR=65535
SELECT=16744576
BAR=33023
WAKU=16711680
BGFL=2365440
PT=16777215
BGPT=2365440
MB=16777215
BGMB=2365440
VW=16777215
BGVW=2365440
STS_BAR=0
STS_BAR2=65535
LNVW=4521796
TBVW=12039936
CRVW=16755801
SELEGR=10485760
[AFXW]
VER=1.63
☆AFXW.DEF------------------------------------------------------------------------
[AFXW]
CFG=ON
[EXT_NORMAL]
E_000=xls
N_000=""$V"ProgramFiles"\Microsoft Office\root\Office16\EXCEL.EXE" "$P\$F""
S_000=""$V"ProgramFiles"\Microsoft Office\root\Office16\EXCEL.EXE" -r "$P\$F""
E_001=xlsx
N_001=""$V"ProgramFiles"\Microsoft Office\root\Office16\EXCEL.EXE" "$P\$F""
S_001=""$V"ProgramFiles"\Microsoft Office\root\Office16\EXCEL.EXE" -r "$P\$F""
E_002=doc
N_002=""$V"ProgramFiles"\Microsoft Office\root\Office16\WINWORD.EXE" "$P\$F""
S_002=""$V"ProgramFiles"\Microsoft Office\root\Office16\WINWORD.EXE" /f "$P\$F""
E_003=docx
N_003=""$V"ProgramFiles"\Microsoft Office\root\Office16\WINWORD.EXE" "$P\$F""
E_004=ppt
N_004=""$V"ProgramFiles"\Microsoft Office\root\Office16\POWERPNT.EXE" "$P\$F""
S_004=""$V"ProgramFiles"\Microsoft Office\root\Office16\POWERPNT.EXE" "$P\$F""
E_005=pptx
N_005=""$V"ProgramFiles"\Microsoft Office\root\Office16\POWERPNT.EXE" "$P\$F""
S_005=""$V"ProgramFiles"\Microsoft Office\root\Office16\POWERPNT.EXE" "$P\$F""
E_006=pdf
N_006=""C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe" "$P\$F""
E_007=lnk
N_007="&SCRIPT shortcut.afx.js -P "$P\$F""
S_007="&SCRIPT shortcut.afx.js -O "$P\$F""
E_008=xlsm
N_008=""$V"ProgramFiles"\Microsoft Office\root\Office16\EXCEL.EXE" "$P\$F""
S_008=""$V"ProgramFiles"\Microsoft Office\root\Office16\EXCEL.EXE" -r "$P\$F""
[KEY_DEF]
KEY_00="&CD $~\"
KEY_01=""$V"ProgramFiles"\Microsoft Office\root\Office16\EXCEL.EXE" /p "$P\""
KEY_02="explorer "$P\""
KEY_03="cmd.exe $P"
KEY_12="&CLIP $QN$JD$MS"
KEY_13="&CLIP $QN$JD$MF"
KEY_14="&CLIP $P\"
KEY_36="&CLIP $QN$JD$MS"
KEY_37="&CLIP $QN$JD$MF"
KEY_38="&CLIP $P\"
[REG_DIR]
PRT_00="おためし"
DIR_00=C:\
[REG_COL]
COL_00=255
EXT_00=exe
COL_01=33023
EXT_01=lnk
COL_02=65535
EXT_02=lzh zip cab rar tgz
COL_03=16711935
EXT_03=bmp jpg jpeg gif tif ico png
COL_04=8388863
EXT_04=ifo mp2 mpa m1a m2p m2a mpg mpeg m1v m2v mp2v mp4 divx mov qt ra rm ram rmvb rpm smi avi wmv asf mkv
COL_05=8454016
EXT_05=mp3 wav
COL_06=32768
EXT_06=m3u xls xlsx
COL_07=16776960
EXT_07=txt hlp csv mac
COL_08=65280
EXT_08=chm
COL_09=16711680
EXT_09=htm html url
COL_10=12615808
EXT_10=ini cfg dat bkp def key
COL_11=8388736
EXT_11=dll sys reg inf
COL_12=128
EXT_12=bak old tmp
COL_13=8421631
EXT_13=img iso
COL_14=16736866
EXT_14=doc docx
COL_15=5197823
EXT_15=ppt pptx pdf
☆AFXW.KEY------------------------------------------------------------------------
[KEYCUST]
ON=1
[NORMAL]
K0000="4037:3037"
K0001="4039:3039"
K0002="0074&MENU "$~\menu\jump.txt""
K0003="0192©TO !"
K0004="0186&MOVETO !"
K0005="0078:0040"
K0006="2186&MASK $IT"$K"*$I"部分一致ファイルマスク"*"
K0007="0089"$~\afxtools\bin\afxfazzy.exe""
K0008="1089&MENU "$~\afxtools\bin\afxfazzy.mnu""
K0009="0054&MENU "$~\afxtools\bin\afxfazzy4.mnu""
K0010="0055&MENU "$~\menu\jump2.txt""
K0011="0056&MENU "$~\afxtools\bin\afxbkmk.mnu""
K0012="0057&MENU "$~\afxtools\bin\afxbkmkl.mnu""
K0013="1083"$V"ProgramFiles"\sakura\sakura.exe" "$P\$F""
K0014="0049"$~\afxtools\bin\afxpopd.exe" -n 1""
K0015="0050"$~\afxtools\bin\afxpopd.exe" -n 2""
K0016="0051"$~\afxtools\bin\afxpopd.exe" -n 3""
K0017="0052"$~\afxtools\bin\afxpopd.exe" -n 4""
K0018="0053"$~\afxtools\bin\afxpopd.exe" -n 5""
K0019="1049"$~\afxtools\bin\afxpushd.exe" -n 1 "$L\\" "$R\\" "
K0020="1050"$~\afxtools\bin\afxpushd.exe" -n 2 "$L\\" "$R\\" "
K0021="1051"$~\afxtools\bin\afxpushd.exe" -n 3 "$L\\" "$R\\" "
K0022="1052"$~\afxtools\bin\afxpushd.exe" -n 4 "$L\\" "$R\\" "
K0023="1053"$~\afxtools\bin\afxpushd.exe" -n 5 "$L\\" "$R\\" "
K0024="2070"$~\afxtools\bin\afxfind.exe" *$I4"あいまい検索"*"
K0025="3070"$~\afxtools\bin\afxfind.exe" $I4"完全一致検索""
K0026="4070&PLUGIN "$~\afxtools\bin\afxflist.dll" $~\afxtools\bin\afxfind.mnu"
K0027="1067"C:\tools\FastCopy\FastCopy.exe" /cmd=force_copy $MS "/to="$O""
K0028="1068"C:\tools\FastCopy\FastCopy.exe" /cmd=delete /no_ui $MS"
K0029="1077"C:\tools\FastCopy\FastCopy.exe" /cmd=move $MS "/to="$O""
★jump.txt
afx メニュー
"M: あふメニュー編集" &EDIT $V"afxw"\menu\jump.txt
"T: tools" &CD C:\tools\
"P: Program Files(x86)" &CD $V"ProgramFiles"\
"P: Program Files(x64)" &CD $V"ProgramW6432"\
"S: System32" &CD C:\Windows\System32\
"H: hosts" &CD C:\Windows\System32\drivers\etc\hosts
"L: AppData" &CD $V"LOCALAPPDATA"\
"D: Downloads" &CD $V"USERPROFILE"\Downloads\
"Q: QuickLaunch" &CD $V"APPDATA"\Microsoft\Internet Explorer\Quick Launch\
"S: StartUp" &CD $V"APPDATA"\Microsoft\Windows\Start Menu\Programs\Startup\
★xyzzyで必要なもの
paren.l
migemo.l
※site-lispフォルダに置く
★xyzzyの設定
☆siteinit.l
;;インクリメンタルサーチ
(require "isearch")
;;migemo
(require "migemo")
(migemo-toggle t)
;;対応する括弧を強調表示
(require "paren")
(turn-on-global-paren)
;;対応する括弧に飛ばない
(setq *show-matched-parenthesis* nil)
;;C-x C-v時にファイル名も表示させる
(setq *find-other-file-requires-file-name* t)
;;バッファ移動
(setq *next-buffer-in-tab-order* t) ; バッファ移動をタブ順に
(global-set-key #\M-Right 'next-buffer) ; 前のバッファに移動
(global-set-key #\M-Left 'previous-buffer) ; 後のバッファに移動
;;カレントバッファを削除
(defun kill-current-buffer ()
(interactive)
(kill-buffer (selected-buffer))
)
(global-set-key #\M-- 'kill-current-buffer)
;;IMEのステータスを表示
(setq-default mode-line-format "--%*- %b (%M) [%k:%l] %P %f [%i]")
;;最近使ったファイルリスト(C-/)
(defun list-file ()
(interactive)
(let ((hist (subseq *minibuffer-file-name-history* 0 19)))
(multiple-value-bind (result data)
(dialog-box '(dialog 0 0 262 158
(:caption "最近使ったファイル")
(:font 9 "MS Pゴシック")
(:control
(:listbox files nil #x50b10101 7 7 248 135)
(:button IDOK "OK" #x50010001 148 143 50 14)
(:button IDCANCEL "cancel" #x50010000 205 143 50 14)))
(list (cons 'files hist))
'((files :must-match t :enable (IDOK))))
(when result
(let ((file (cdar data)))
; ファイルを開く
(when (file-exist-p file)
(find-file file)
(add-history file '*minibuffer-file-name-history*)))))))
(global-set-key #\C-/ 'list-file)
;;ファイラのデフォルトのマスクを全ファイルに
(setq *filer-primary-file-mask* '("*"))
(setq *filer-secondary-file-mask* '("*"))
;;マウスだけでコピー・ペースト
;右クリックでペースト
(defun mouse-right-up-process ()
(interactive "*")
(mouse-left-press)
(paste-from-clipboard)
)
;左クリックでコピー&Set Mark
(defun mouse-left-up-process ()
(interactive)
(selection-start-end (Start End)
(progn
(copy-region-to-clipboard Start End)
(set-mark End);どっしぇーなんでEndなんだ
)
)
)
(global-set-key #\LBtnUp 'mouse-left-up-process)
(global-set-key #\RBtnUp 'mouse-right-up-process)
(global-set-key #\MBtnUp 'mouse-menu-popup)
;;kill-line
(defun kill-line-CR (&optional lines)
(interactive "*p")
(kill-region (point)
(progn
(cond ((null lines)
(cond ((eolp) (forward-line 1))
((bolp) (goto-eol)(forward-char))
(t (goto-eol))))
((zerop lines) (if(bolp)(forward-line -1)(goto-bol)))
(t (forward-line lines)))
(point)
)
))
(global-set-key #\C-k 'kill-line-CR)
;;デフォルトのモード
(setq *default-buffer-mode* 'text-mode)
;;siteinit.lのバイトコンパイル+ダンプファイル削除
(defun compile-and-delete-dump-file ()
(interactive)
(and (find-buffer "siteinit.l")
(eval-buffer "siteinit.l"))
(byte-compile-file
(concat (si:system-root) "site-lisp/siteinit.l"))
(let ((dumpfile
(concat (si:system-root) "xyzzy.w"
(case (os-platform)
(whistler "xp")
((whistler windows-xp) "xp")
(windows-2000 "2k")
(windows-nt "nt")
(windows-me "me")
(windows-98 "98")
(windows-95 "95")
(t "nt")))))
(and (file-exist-p dumpfile)
(delete-file dumpfile))))
(global-set-key '(#\C-c #\b) 'compile-and-delete-dump-file)
;;find-file(C-x C-f)の後F7で.xyzzy、F8でsiteinit.l、F9でリファレンス、F10でfavorite-filesをロード
(define-key minibuffer-local-completion-map #\F7
#'(lambda () (interactive)
(delete-region (point-min) (point-max))
(insert (concat
(merge-pathnames ".xyzzy" (user-homedir-pathname))))))
(define-key minibuffer-local-completion-map #\F8
#'(lambda () (interactive)
(delete-region (point-min) (point-max))
(insert (concat
(merge-pathnames "site-lisp" (si:system-root)) "/siteinit.l"))))
(define-key minibuffer-local-completion-map #\F9
#'(lambda () (interactive)
(delete-region (point-min) (point-max))
(insert (concat
(merge-pathnames "etc" (si:system-root)) "/reference.txt"))))
(define-key minibuffer-local-completion-map #\F10
#'(lambda () (interactive)
(delete-region (point-min) (point-max))
(insert (concat
(merge-pathnames "." (si:system-root)) "/memo.txt"))))
;;*scratch* を終了時に保存
(add-hook '*kill-xyzzy-hook*
#'(lambda ()
(save-excursion
(set-buffer (find-buffer "*scratch*"))
(write-file "~/scratch")
)))
;;*scratch* を起動時にロード
(add-hook '*post-startup-hook*
#'(lambda ()
(save-excursion
(set-buffer (find-buffer "*scratch*"))
(insert-file-contents "~/scratch" t))))
;;*scratch* な場合は nil を返してkillさせない
(add-hook '*query-kill-buffer-hook*
#'(lambda ()
(if (and (not *kill-buffer-kills-scratch*)
(equal (buffer-name (selected-buffer))
"*scratch*"))
nil
t)))
;;選択した文字数をステータスバーに表示
(add-hook '*post-command-hook*
#'(lambda ()
(when (eql (get-selection-type) 2)
(message "Selected chars: ~D"
(- (abs (- (selection-point)
(selection-mark)))
(abs (- (save-excursion (goto-char (selection-point)) (current-line-number))
(save-excursion (goto-char (selection-mark)) (current-line-number)))))))))
;;javaのインデント
(setq ed::java-indent-level 4)
;;ファイル名をコピー(\区切り) C-c n
(defun my-file-name-copy-backslash ()
(interactive)
(unless (equal (get-buffer-file-name) nil)
(copy-to-clipboard
(map-slash-to-backslash (get-buffer-file-name)))))
(define-key spec-map #\n 'my-file-name-copy-backslash)
;;Buffer Listの操作とヘルプ
(defun buffer-menu-help ()
(interactive)
(message "s: Save / d,k: Delete(close) / x: eXecute / u:Unmark / o:Otherwindow / f: this-window / q,1:1-window / ~~:not modified / C-d: delet-back")
)
(defun my-buffer-menu-lisp ()
(define-key ed::*buffer-menu-mode-map* #\h 'buffer-menu-help)
(define-key ed::*buffer-menu-mode-map* #\! 'buffer-menu-help)
(define-key ed::*buffer-menu-mode-map* #\n 'next-line)
(define-key ed::*buffer-menu-mode-map* #\p 'previous-line)
)
(add-hook 'ed::*buffer-menu-mode-hook* 'my-buffer-menu-lisp)
;;エディタからエクスプローラを開く(M-e)
(defun open-explorer (fn)
(flet ((get-arg ()
(if fn (concat "/e,/select," (map-slash-to-backslash fn))
(concat "/e," (map-slash-to-backslash (si:system-root))))))
(call-process
(concat (get-windows-directory) "explorer " (get-arg)))))
(defun my-open-explorer ()
(interactive)
(let ((fn (get-buffer-file-name)))
(cond ((null fn) (open-explorer nil))
((file-exist-p fn) (open-explorer fn))
(t (message "not exist ~A" fn)))))
(define-key *global-keymap* #\M-e 'my-open-explorer )
;;C-x hで全行選択
(global-set-key '(#\C-x #\h) 'selection-whole-buffer)
;;C-,で補完
(global-set-key '(#\C-\,) 'dabbrev-expand)
;;インデントに半角スペースを使う
(setq indent-tabs-mode nil)
;;リージョン行頭に指定文字挿入 M-SPC
(defun insert-string-bol-region()
(interactive "*")
(setq insert-str (read-string "リージョン行頭に挿入 : "))
(if (mark)
(insert-string-bol insert-str (region-beginning) (region-end))))
(defun insert-string-bol(insert-str from to)
(let ((*quotation-prefix* insert-str))
(quote-region from to)))
(global-set-key #\M-SPC 'insert-string-bol-region)
;;他ウィンドウを上にスクロールする
(global-set-key '#\M-C-z #'(lambda () (interactive "p")
(scroll-other-window t)))
;;ウィンドウ移動をC-Left C-Rightにも割り当てる
;;※当キーはC-a C-eと同じ動作をしていたため、上書きしても問題ない
(global-set-key '#\C-Left 'move-previous-window)
(global-set-key '#\C-Right 'other-window)
;;バッファを検索して選択する(F3)
; ミニバッファより選択したいバッファを入力する。
; 一致するものが複数見つかった場合、バッファ選択ダイアログを開いて選択させる。
(defun my-selector (lst title)
(multiple-value-bind (result data)
(dialog-box
`(dialog 0 0 165 110
(:caption ,title)
(:font 9 "MS Pゴシック")
(:control
(:listbox list nil #x50b10111 7 7 150 82)
(:button IDOK "Open" #x50010001 7 93 25 14)
(:button IDCANCEL "Cancel" #x50010000 35 93 25 14)))
(list (cons 'list lst))
'((list :column (40))))
(cond ((eql 'IDOK result) (cddr (assoc 'list data)))
((eql 'IDCANCEL result) nil)
(t nil))))
(defun my-search-buffer-or-file (sn)
(interactive"sbuffer: ")
(let ((lst (buffer-list)))
(setq lst (delete-if-not #'(lambda (x) (string-matchp sn (buffer-name x))) lst))
(setq lst (pairlis (mapcar #'buffer-name lst) lst))
(case (length lst)
(0)
(1 (switch-to-buffer (cdar lst)))
(t (set-buffer (my-selector lst "検索結果"))))))
(global-set-key #\F3 'my-search-buffer-or-file)
;;tips/lisp 書いてるときは保存したらすぐに再ロードしてほしい。
(defun lisp-save-and-load-buffer ()
(interactive "*")
(let* ((filename-l
(get-buffer-file-name (selected-buffer)))
(filename-lc
(concat filename-l "c")))
(save-buffer)
(cond
((file-exist-p filename-lc)
(byte-compile-file filename-l)
(load-file filename-lc))
(t
(load-file filename-l))
)))
(add-hook '*lisp-mode-hook*
'(lambda ()
(local-set-key '(#\C-x #\C-s) 'lisp-save-and-load-buffer)))
(require "wip/winapi")
(in-package "winapi")
(unless (fboundp 'GetForegroundWindow)
(c:*define-dll-entry HWND GetForegroundWindow () "user32"))
(unless (fboundp 'FindWindowEx)
(c:*define-dll-entry winapi::HWND FindWindowEx
(winapi::DWORD winapi::DWORD winapi::LPCSTR winapi::LPCSTR)
"user32" "FindWindowExA"))
(in-package "user")
;; find-file 時にディレクトリが作れるように
(defun make-directory-unless-directory-exists (filename)
(unless (valid-path-p filename)
(let ((d (directory-namestring filename)))
(when (yes-or-no-p "~a~%ディレクトリがないけど作る?" d)
(create-directory d))))
nil)
;;カーソル行をクリップボードにコピー (M-Insert)
(defun my-copy-cursor-string (type)
(let (beg end str (column (current-virtual-column)))
(case type
(1
(setq beg (progn (skip-syntax-spec-forward "w_") (point)))
(setq end (progn (skip-syntax-spec-backward "w_") (point))))
((2 3)
(setq beg (progn (goto-bol) (point)))
(setq end (progn (goto-eol) (1+ (point)))))
)
(goto-column column)
(setq str (buffer-substring beg end))
(when (= type 3)
(setq str (string-trim " \n" str)))
(copy-to-clipboard str)))
(defvar *my-copy-cursor-string-menu* nil)
(define-key *global-keymap* #\M-Insert
#'(lambda ()
(interactive)
(unless *my-copy-cursor-string-menu*
(setq *my-copy-cursor-string-menu*
(define-popup-menu
(:item nil "単語をコピー(&W)"
#'(lambda () (interactive) (my-copy-cursor-string 1)))
(:item nil "行をコピー(&L)"
#'(lambda () (interactive) (my-copy-cursor-string 2)))
(:item nil "行をトリムしてコピー(&T)"
#'(lambda () (interactive) (my-copy-cursor-string 3)))
)))
(track-popup-menu *my-copy-cursor-string-menu*)))
(in-package "editor")
(defvar *lisp-keyword-hash-table* nil)
(defun use-lisp-keyword ()
"キーワード色付け"
(if (null *lisp-keyword-hash-table*)
(setq *lisp-keyword-hash-table*
(load-keyword-file "lisp")))
(when *lisp-keyword-hash-table*
(make-local-variable 'keyword-hash-table)
(setq keyword-hash-table *lisp-keyword-hash-table*)))
;C-F1でキーヘルプを表示
(add-hook '*lisp-mode-hook*
#'(lambda ()
(use-lisp-keyword)
(define-key *lisp-mode-map* #\C-F1 'lisp-complete-symbol)))
(add-hook '*lisp-interaction-mode-hook*
#'(lambda ()
(use-lisp-keyword)
(define-key *lisp-interaction-mode-map* #\C-F1 'lisp-complete-symbol)))
;;リファレンスの検索 (F1)
(require "info-modoki-mode")
(define-key ed::*lisp-mode-map* #\F1 'imm-refer-selection)
(define-key ed::*lisp-interaction-mode-map* #\F1 'imm-refer-selection)
;;ウィンドウ 2 分割時に、縦分割<->横分割
(defun window-toggle-division ()
(interactive)
(unless (= (count-windows 1) 2)
(error "ウィンドウが 2 分割されていません。"))
(let ((other-buf (window-buffer (next-window (selected-window) nil)))
(primary (eq (cadr (current-window-configuration))
(car (caaddr (current-window-configuration))))))
(delete-other-windows)
;スクリーンと分割Windowの幅の比率から分割方向を決める
(if (< (float (/ (window-width) (screen-width))) 0.9)
(split-window)
(split-window-vertically))
(if primary
(switch-to-buffer-other-window other-buf)
(switch-to-buffer other-buf))
(other-window -1)))
(global-set-key '(#\C-x #\3) 'window-toggle-division)
;;ウィンドウ 2 分割時に、バッファをスワップ
(defun my-window-swap ()
(interactive)
(unless (= (count-windows 1) 2)
(error "ウィンドウが 2 分割されていません。"))
(let ((buff1 (selected-buffer))
(buff2 (window-buffer (next-window (selected-window) nil))))
(set-buffer buff2)
(other-window)
(set-buffer buff1)))
(global-set-key '(#\C-x #\7) 'my-window-swap)
☆xyzzy.ini
[Font]
Ascii=19,"FixedSys",128
Japanese=18,"FixedSys",128
Latin=18,"Courier New",0
Cyrillic=18,"Courier New",0
Greek=18,"Courier New",0
GB2312=18,"MS Hei",0
BIG5=18,"MingLiu",0
KSC5601=18,"GulimChe",0
Georgian=18,"BPG Courier New U",0
lineSpacing=0
backslash=0
recommendSize=0
sizePixel=0
[Colors]
textColor=#d0d0d0
backColor=#3c2800
ctlColor=#8080
selectionTextColor=#0
selectionBackColor=#f0caa6
kwdColor1=#98fb98
kwdColor2=#82ddee
kwdColor3=#ffff00
stringColor=#7aa0ff
commentColor=#45ff
tagColor=#face87
cursorColor=#800080
caretColor=#e8cc80
imeCaretColor=#d4eefc
linenum=#f0caa6
reverse=#fcf8
unselectedModeLineFg=#13000000
unselectedModeLineBg=#10e8e8e8
modeLineFg=#d0d0d0
modeLineBg=#13000000
fg1=#ff
bg1=#ff
fg2=#ff00
bg2=#ff00
fg3=#ffff
bg3=#ffff
fg4=#ff0000
bg4=#ff0000
fg5=#ff00ff
bg5=#ff00ff
fg6=#ffff00
bg6=#ffff00
fg7=#ffffff
bg7=#ffffff
fg8=#0
bg8=#0
fg9=#80
bg9=#80
fg10=#8000
bg10=#8000
fg11=#8080
bg11=#8080
fg12=#800000
bg12=#800000
fg13=#800080
bg13=#800080
fg14=#808000
bg14=#808000
fg15=#808080
bg15=#808080
buftabSelFg=#13000000
buftabSelBg=#10f0f0f0
buftabDispFg=#13000000
buftabDispBg=#10f0f0f0
buftabFg=#13000000
buftabBg=#10f0f0f0
tabSelFg=#13000000
tabSelBg=#10f0f0f0
tabFg=#13000000
tabBg=#10f0f0f0
custColor0=#feeecd
custColor1=#ffffff
custColor2=#ffffff
custColor3=#ffffff
custColor4=#ffffff
custColor5=#ffffff
custColor6=#ffffff
custColor7=#ffffff
custColor8=#ffffff
custColor9=#ffffff
custColor10=#ffffff
custColor11=#ffffff
custColor12=#ffffff
custColor13=#ffffff
custColor14=#ffffff
custColor15=#ffffff
[Misc]
1366x768=(176,175)-(1201,701),3
saveWindowSize=1
saveWindowPosition=1
restoreWindowSize=1
restoreWindowPosition=1
windowFlags=#8d7f
fnkeyLabels=0
foldMode=-1
foldLinenumMode=1
1920x1080=(17,13)-(1039,739),3
saveWindowSnapSize=0
3440x1440=(368,89)-(1633,1218),1
[Filer]
columnLeft=121,65,116,44
columnRight=121,65,116,44
1366x768=(201,84)-(1117,665),1
sortRight=2
sortLeft=2
textColor=#9000000
backColor=#6ffffff
highlightTextColor=#fffffff
highlightBackColor=#eff9933
cursorColor=#c000c0
1920x1080=(386,188)-(1141,658),1
column=121,65,116,44
s1920x1080=(500,168)-(912,698),1
sort=0
[BufferSelector]
column=117,65,100,320
1366x768=(264,139)-(830,443),1
1920x1080=(449,243)-(1015,548),1
★fenrirの設定
★必要なもの
bregexp.dll
☆ScanRule.ini
C:\Program Files, *.exe,*.mp4,*.avi,*.ppt,*.pptx,*.doc,*.docx,*.xls,*.xlsx,*.txt,*.pdf,*.ini,*.bat,*.zip,*.def,*.py,*.xml,*.log,*.properties,*.jsp,*.lnk,
C:\Program Files (x86), *.exe,*.mp4,*.avi,*.ppt,*.pptx,*.doc,*.docx,*.xls,*.xlsx,*.txt,*.pdf,*.ini,*.bat,*.zip,*.def,*.py,*.xml,*.log,*.properties,*.jsp,*.lnk,
C:\tools, *.exe,*.mp4,*.avi,*.ppt,*.pptx,*.doc,*.docx,*.xls,*.xlsx,*.txt,*.pdf,*.ini,*.bat,*.zip,*.def,*.py,*.xml,*.log,*.properties,*.jsp,*.lnk,
C:\work, *.exe,*.mp4,*.avi,*.ppt,*.pptx,*.doc,*.docx,*.xls,*.xlsx,*.txt,*.pdf,*.ini,*.bat,*.zip,*.def,*.py,*.xml,*.log,*.properties,*.jsp,*.lnk,
C:\Users\????\Downloads, *.exe,*.mp4,*.avi,*.ppt,*.pptx,*.doc,*.docx,*.xls,*.xlsx,*.txt,*.pdf,*.ini,*.bat,*.zip,*.def,*.py,*.xml,*.log,*.properties,*.jsp,*.lnk,
C:\Users\????\Desktop, *.exe,*.mp4,*.avi,*.ppt,*.pptx,*.doc,*.docx,*.xls,*.xlsx,*.txt,*.pdf,*.ini,*.bat,*.zip,*.def,*.py,*.xml,*.log,*.properties,*.jsp,*.lnk,
C:\Users\????\Documents, *.exe,*.mp4,*.avi,*.ppt,*.pptx,*.doc,*.docx,*.xls,*.xlsx,*.txt,*.pdf,*.ini,*.bat,*.zip,*.def,*.py,*.xml,*.log,*.properties,*.jsp,*.lnk,
C:\Users\Public\Desktop, *.exe,*.mp4,*.avi,*.ppt,*.pptx,*.doc,*.docx,*.xls,*.xlsx,*.txt,*.pdf,*.ini,*.bat,*.zip,*.def,*.py,*.xml,*.log,*.properties,*.jsp,*.lnk,
*C:\Windows, *exe
*C:\Windows\System32, *exe
☆instant.ini
/c=calc
/x="C:\xyzzy\xyzzycli.exe"
/a="C:\tools\afxw\AFXW.EXE" -s
/g=""C:\tools\cute\cuteExec.exe" "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe""
/s="".\fenrirScan.exe""
☆cmd
2e.txt
[.***;
oedit|"C:\tools\xyzzy\xyzzycli.exe" "%P"
]
4enter.txt
[.***;
あふ|C:\tools\afxw\AFXWCMD.EXE -p"%P"
]
0wclick.txt
[.***;
ShellExecute|"%P"
]
0rclick.txt
[.***;
ParentDirectory|"%D"
0enter.txt
[.***;
ShellExecute|"%P"
]
2c.txt
[.***;
CopyPath|%W\clip.exe %P
]
2l.txt
[.***;
あふ左|C:\tools\afxw\AFXWCMD.EXE -l"%P"
]
2r.txt
[.***;
あふ右|C:\tools\afxw\AFXWCMD.EXE -r"%P"
]
★cluch
☆clnch.ini
[GEOMETRY]
width = 18
height = 1
topmost = 2
monitor = 0
x = -355
y = -10
[COMMANDLINE]
history_0 =
history_1 = Google
history_2 = s
history_3 = Config
history_4 = afxw
history_5 = igi
history_6 = GgQG
history_7 = Hgg
history_8 = calc
history_9 = About
history_10 = 269*2
history_11 = \a
history_12 = sS
history_13 = x
history_14 = v
history_15 = /$Recycle.Bin\
history_16 = Reload
history_17 = History
[CONSOLE]
x = 2588
y = 1011
width = 80
height = 32
[MUSIC]
restore = 0
[HOTKEY]
activate_vk = 240
activate_mod = 0
[MISC]
hotkey_behavior = activate
inactive_behavior = hide
default_keymap = 106
[FONT]
size = 12
name = MS ゴシック
[THEME]
name = black
[COMMANDLIST]
command_0 = ('afxw', 'afxw.exe', '-s', 'c:\\tools\\afxw')
command_1 = ('calc', 'calc', '', '')
command_2 = ('notepad', 'notepad', '', '')
command_3 = ('cmd', 'cmd', '', '')
☆extension\open_folder.py
# coding:utf-8
r"""
フォルダを開くコマンド群
コマンド:
・command_OpenExplorer
第一引数のフォルダをエクスプローラーで開きます。
・command_OpenCommandPrompt
第一引数のフォルダをコマンド プロンプトで開きます。
・command_OpenPowerShell
第一引数のフォルダを PowerShell で開きます。
・command_EditCommand
第一引数のコマンドを編集します。
定義例:
# config.py の configure() 関数に次のように記載します
import open_folder
window.cmd_keymap[ "S-Return" ] = open_folder.command_OpenExplorer
window.cmd_keymap[ "C-Return" ] = open_folder.command_OpenCommandPrompt
window.cmd_keymap[ "A-Return" ] = open_folder.command_EditCommand(window)
使用例:
・"memochou" + Shift - Enter
メモ帳をドラッグ&ドロップで memochou として登録していれば、
メモ帳がインストールされたフォルダをエクスプローラーで開く。
・"memochou" + Ctrl - Enter
メモ帳をドラッグ&ドロップで memochou として登録していれば、
メモ帳がインストールされたフォルダをコマンド プロンプトで開く。
・"memochou" + Alt - Enter
メモ帳をドラッグ&ドロップで memochou として登録していれば、
memochou コマンドを編集する。
・"~" + Ctrl - Enter
マイドキュメントをドラッグ&ドロップで ~ として登録していれば、
コマンド プロンプトでマイドキュメント フォルダを開く。
・"~" + Alt - Enter
マイドキュメントをドラッグ&ドロップで ~ として登録していれば、
~ コマンドを編集する。
・"C:\Users" + Ctrl - Enter
C:\Users をコマンド プロンプトを開く。
"""
import os
from clnch import *
# --------------------------------------------------------------------
# コマンドのフォルダーをエクスプローラーで表示する
def command_OpenExplorer(args):
path = getCommandPath(args[0])
if path:
if os.path.isfile(path):
pyauto.shellExecute( None, "explorer.exe", '/select,"%s"' % path, "", None )
elif os.path.isdir(path):
pyauto.shellExecute( None, path, "", "", None )
else:
pyauto.shellExecute( None, os.path.split(path)[0], "", "", None )
# --------------------------------------------------------------------
# コマンドのフォルダーをコマンド プロンプトで表示する
def command_OpenCommandPrompt(args):
path = getCommandPath(args[0])
if path:
if os.path.isdir(path):
pyauto.shellExecute( None, "cmd.exe", "", path, None )
else:
pyauto.shellExecute( None, "cmd.exe", "", os.path.split(path)[0], None )
# --------------------------------------------------------------------
# コマンドのフォルダーを PowerShell で表示する
def command_OpenPowerShell(args):
path = getCommandPath(args[0])
if path:
if os.path.isdir(path):
pyauto.shellExecute( None, "powershell.exe", "", path, None )
else:
pyauto.shellExecute( None, "powershell.exe", "", os.path.split(path)[0], None )
# コマンドのフォルダーをあふで表示する
def command_OpenAfxw_L(args):
command_OpenAfxw(args, "-s -l\"%s\"")
def command_OpenAfxw_R(args):
command_OpenAfxw(args, "-s -r\"%s\"")
def command_OpenAfxw(args, afx_options):
afx_exe = "AFXW.EXE"
afx_path = "C:\\tools\\afxw"
path = getCommandPath(args[0])
if path:
if os.path.isdir(path):
pyauto.shellExecute( None, afx_exe, afx_options % path, afx_path, None )
else:
pyauto.shellExecute( None, afx_exe, afx_options % os.path.split(path)[0], afx_path, None )
# --------------------------------------------------------------------
# コマンドを編集する
def command_EditCommand(window):
def _command_EditCommand(args):
command_name = args[0].lower()
items = loadCommandListFromIniFile()
i = 0
for i in range(len(items)):
if command_name == items[i][0].lower():
# 編集ウインドウを表示する
edit_result = clnch_commandwindow.popCommandWindow( window, *items[i] )
# 編集した場合
if edit_result:
items[i] = edit_result
# iniファイルに反映させる
clnch_ini.remove_section("COMMANDLIST")
for i in range(len(items)):
clnch_ini.set( "COMMANDLIST", "command_%d"%(i,), str(tuple(items[i])) )
# 設定を再読み込みする
window.configure()
break
i += 1
return _command_EditCommand
# 処理対象のフォルダを取得する
def getCommandPath( text ):
# ファイルやディレクトリ パスならそのまま返す
if os.path.isfile(text) or os.path.isdir(text):
return text
# ini から取得
text = text.lower()
command_list = loadCommandListFromIniFile()
for command in command_list:
if text.lower() == command[0].lower():
return command[1]
# ini に保存されたコマンドを読み込む
def loadCommandListFromIniFile():
i=0
ret = []
while True:
try:
command_string = clnch_ini.get( "COMMANDLIST", "command_%d"%(i,) )
except:
break
ret.append(eval( command_string ))
i += 1
return ret
☆config.py
import os
import sys
from clnch import *
# 設定処理
def configure(window):
# --------------------------------------------------------------------
# F1 キーでヘルプファイルを起動する
def command_Help(info):
print( "Helpを起動 :" )
help_path = os.path.join( getAppExePath(), 'doc\\index.html' )
shellExecute( None, help_path, "", "" )
print( "Done.\n" )
window.cmd_keymap[ "F1" ] = command_Help
# --------------------------------------------------------------------
# Ctrl-E で、入力中のファイルパスを編集する
window.cmd_keymap[ "C-E" ] = window.command.Edit
# --------------------------------------------------------------------
# Spaceでfenrir_allを起動する
# Shift+Spaceでfenrir_dirを起動する
def command_Fenrir_All(info):
shellExecute( None, "C:/tools/fenrir/all/fenrir.exe" "", "/t", "C:/tools/fenrir/all" )
def command_Fenrir_Dir(info):
shellExecute( None, "C:/tools/fenrir/dir/fenrir.exe" "", "/t", "C:/tools/fenrir/dir" )
window.cmd_keymap[ "Space" ] = command_Fenrir_All
window.cmd_keymap[ "S-Space" ] = command_Fenrir_Dir
# Aであふを起動する
def command_Afxw(info):
shellExecute( None, "c:/tools/afxw/afxw.exe" "", "-s", "" )
window.cmd_keymap[ "S-A" ] = command_Afxw
# Xでxyzzyを起動する
def command_Xyzzy(info):
shellExecute( None, "C:/tools/xyzzy/xyzzycli.exe" "", "", "" )
window.cmd_keymap[ "S-X" ] = command_Xyzzy
# Vでvimを起動する
def command_Vim(info):
shellExecute( None, "C:/tools/vim81-kaoriya-win64/vim.exe" "", "", "" )
window.cmd_keymap[ "S-V" ] = command_Vim
# Nでメモ帳を起動する
def command_Notepad(info):
shellExecute( None, "notepad" "", "", "" )
window.cmd_keymap[ "S-N" ] = command_Notepad
# Cでコマンドプロンプトを起動する
def command_Cmd(info):
shellExecute( None, "cmd" "", "", "" )
window.cmd_keymap[ "S-C" ] = command_Cmd
# Sでサクラエディタを起動する
def command_Cmd(info):
shellExecute( None, "C:/Program Files (x86)/sakura/sakura.exe" "", "", "" )
window.cmd_keymap[ "S-S" ] = command_Cmd
# パスをあふで開く
import open_folder
window.cmd_keymap[ "S-Enter" ] = open_folder.command_OpenAfxw_L
window.cmd_keymap[ "S-C-Enter" ] = open_folder.command_OpenAfxw_R
# --------------------------------------------------------------------
# Alt-Space で、自動補完を一時的にOn/Offする
window.keymap[ "A-Space" ] = window.command.AutoCompleteToggle
# --------------------------------------------------------------------
# テキストエディタを設定する
window.editor = "C:/tools/vim81-kaoriya-win64/vim.exe"
# --------------------------------------------------------------------
# ファイルタイプごとの動作設定
window.association_list += [
( "*.mpg *.mpeg *.avi *.wmv", window.ShellExecuteCommand( None, "wmplayer.exe", "/prefetch:7 /Play %param%", "" ) ),
]
# --------------------------------------------------------------------
# 非アクティブ時の時計の形式
if 1:
# 年と秒を省略した短い形式
window.clock_format = "%m/%d(%a) %H:%M"
else:
# 年月日(曜日) 時分秒 の全てを表示する
window.clock_format = "%Y/%m/%d(%a) %H:%M:%S"
# --------------------------------------------------------------------
# 空欄コマンド
# コマンド名なしでEnterを押したときに実行されるコマンドです。
# この例では、ほかのアプリケーションをフォアグラウンド化するために使います。
def command_QuickActivate(info):
def callback( wnd, arg ):
process_name, class_name = arg[0], arg[1]
if (process_name==None or wnd.getProcessName()==process_name) and (class_name==None or wnd.getClassName()==class_name):
wnd = wnd.getLastActivePopup()
wnd.setForeground(True)
return False
return True
if info.mod==MODKEY_SHIFT:
pyauto.Window.enum( callback, ["cfiler.exe",None] )
elif info.mod==MODKEY_CTRL:
pyauto.Window.enum( callback, ["notepad.exe","Notepad"] )
elif info.mod==MODKEY_SHIFT|MODKEY_CTRL:
pyauto.Window.enum( callback, ["mintty.exe","MinTTY"] )
else:
pyauto.Window.enum( callback, ["AFXW.EXE",None] )
window.launcher.command_list += [ ( "", command_QuickActivate ) ]
# --------------------------------------------------------------------
# "NetDrive" コマンド
# ネットワークドライブを割り当てるか解除を行います。
# NetDrive;L;\\server\share : \\machine\public を Lドライブに割り当てます
# NetDrive;L : Lドライブの割り当てを解除します
def command_NetDrive(info):
if len(info.args)>=1:
drive_letter = info.args[0]
if len(info.args)>=2:
path = info.args[1]
checkNetConnection(path)
if window.subProcessCall( [ "net", "use", drive_letter+":", os.path.normpath(path), "/yes" ], cwd=None, env=None, enable_cancel=False )==0:
print( "%s に %sドライブを割り当てました。" % ( path, drive_letter ) )
else:
if window.subProcessCall( [ "net", "use", drive_letter+":", "/D" ], cwd=None, env=None, enable_cancel=False )==0:
print( "%sドライブの割り当てを解除しました。" % ( drive_letter ) )
else:
print( "ドライブの割り当て : NetDrive;<ドライブ名>;<パス>" )
print( "ドライブの解除 : NetDrive;<ドライブ名>" )
# --------------------------------------------------------------------
# コマンドを登録する
window.launcher.command_list += [
( "NetDrive", command_NetDrive ),
( "Cfiler", window.ShellExecuteCommand( None, "C:/ols/cfiler/cfiler.exe", "", "" ) ),
( "Peggy", window.ShellExecuteCommand( None, "C:/ols/anchor/peggy/peggypro.exe", "", "" ) ),
( "Becky", window.ShellExecuteCommand( None, "C:/ols/becky/B2.exe", "", "" ) ),
( "FireFox", window.ShellExecuteCommand( None, "C:/Program Files/Mozilla Firefox/firefox.exe", "", "C:/Program Files/Mozilla Firefox" ) ),
( "Google", window.UrlCommand( "http://www.google.com/search?ie=utf8&q=%param%", encoding="utf8" ) ),
( "Eijiro", window.UrlCommand( "http://eow.alc.co.jp/%param%/UTF-8/", encoding="utf8" ) ),
]
# リストウインドウの設定処理
def configure_ListWindow(window):
# --------------------------------------------------------------------
# F1 キーでヘルプファイルを表示する
def command_Help(info):
print( "Helpを起動 :" )
help_path = os.path.join( getAppExePath(), 'doc\\index.html' )
shellExecute( None, help_path, "", "" )
print( "Done.\n" )
window.keymap[ "F1" ] = command_Help
More than 3 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme