まつもとさんの日記にあった、Effective EmacsのItem3について。もしtransient-mark-modeを有効にしているなら、C-wはこうすればいいんじゃないかな。
| 1 2 3 4 5 6 7 | (defun kill-region-or-backward-kill-word (&optional arg)   "Kill a region or a word backward."   (interactive)   (if mark-active       (kill-region (mark) (point))     (backward-kill-word (or arg 1)))) (global-set-key "\C-w" 'kill-region-or-backward-kill-word) | 
zshで同じことをするならこう。
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |     tcsh-backward-delete-word () { 	local WORDCHARS="${WORDCHARS:s#/#}" 	zle backward-delete-word     }     zle -N tcsh-backward-delete-word     kill-region-or-tcsh-backward-delete-word () {         if [ $MARK -eq 0 ]; then             tcsh-backward-delete-word         else             zle kill-region             MARK=0         fi     }     zle -N kill-region-or-tcsh-backward-delete-word     bindkey '^W' kill-region-or-tcsh-backward-delete-word | 
zshにはtransient-mark-modeはないので、マーク位置がバッファの先頭だったらマークされていないと見なす。
けっこう便利。
※その後変数REGION_ACTIVEが導入されたので、今は以下でOK。(2013-10-21追記)
| 1 2 3 4 5 6 7 |     kill-region-or-tcsh-backward-delete-word () {         if ((REGION_ACTIVE)); then             zle kill-region         else             tcsh-backward-delete-word         fi     } | 
ピンバック: 工夫と趣向と分別と。
Thanks for sharing. I read many of your blog posts, cool, your blog is very good.
I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article. https://www.binance.com/en/register?ref=JHQQKNKN
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
Your article helped me a lot, is there any more related content? Thanks!
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.