Last active
December 30, 2019 14:11
-
-
Save shun-shobon/017f98c6ed8a8c7b22e74ba1eb6fd0e7 to your computer and use it in GitHub Desktop.
パターンにマッチするコマンドを保存しない
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " ヒストリーに保存しないコマンド | |
| let s:histignore = [ | |
| \ 'history', | |
| \ 'h\%[elp]', | |
| \ 'qa\?!\?', | |
| \ 'wq\?a\?!\?' | |
| \ ] | |
| function! s:delIgnoreHistory() abort | |
| let l:history = histget(':', -1) | |
| for l:ignore in s:histignore | |
| if l:history =~# '^' . l:ignore . '$' | |
| call histdel(':', -1) | |
| break | |
| endif | |
| endfor | |
| endfunction | |
| autocmd vimrc CmdlineEnter,CmdwinEnter : call s:delIgnoreHistory() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment