git tag コマンドを実行すると less などの pager 経由してtagが表示されます.
この機能をデフォルトでoffにするには pager.tag を falseに設定します
$ git config --global pager.tag false
デフォルト設定はそのままで一時的に変更する場合は "-c" オプションを使います
git -c pager.tag=false tag
git tag コマンドを実行すると less などの pager 経由してtagが表示されます.
この機能をデフォルトでoffにするには pager.tag を falseに設定します
$ git config --global pager.tag false
デフォルト設定はそのままで一時的に変更する場合は "-c" オプションを使います
git -c pager.tag=false tag
Emacsで単語数を数える方法です
Emacsには標準で count-words という関数が用意されており,単語数がカウントできます.しかし count-wordsは 3.14 を2 wordsとして数える仕様です.
ここで wc-mode というpackageをつかうと,単語の数え方をカスタマイズできるようになります.これで 3.14 を 1 wordsとして数えるようにします.
wc-count-words-functionで単語の数を数える関数を定義します.以下の例はシンプルに,文字列をスペース区切りでtokenに分割して,1 token = 1 word として,word数を数えています.
(use-package wc-mode :ensure t :commands (wc wc-mode) :init (defun my-word-count-for-wc-mode (rstart rend) (let* ((text (buffer-substring-no-properties rstart rend)) (tokens (split-string text "[[:space:]\n\t]+" t))) (length tokens))) :config (setq wc-count-words-function #'my-word-count-for-wc-mode))
M-x wc-mode
wc-modeを有効にすると,バッファ中の単語数がモードライン上にリアルタイム表示されます
M-x wc
バッファ中,または選択中のリージョン内の単語数を数えます