Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vimの命令行で[[Ctrl]]+[[C]]などで離脱したさいに,その命令を履歴に残さない #14

Open
cmplstofB opened this issue Jan 12, 2023 · 0 comments
Assignees
Labels
機能拡張 新機能の設計・実装

Comments

@cmplstofB
Copy link
Owner

cmplstofB commented Jan 12, 2023

" <C-c>で離脱する際,履歴を残さない
" FIXME: これは不完全。
" ‘/’で検索した後<C-c>で離脱すると「histdel(...)」という語句を検索してしまう。
" やりたいのは‘/’で入力した値を消去すること。
" こ無ゾ
if 0 " ここから無効
cnoremap <silent> <C-c> <End><C-u>call<Space>{-><Space>if<Space>getcmdtype()==":"<Space><Bar><Space>histdel("cmd", -1)<Space><Bar><Space>endif}<Enter>
cnoremap <C-c> <C-\>eCmdHstDelX(getcmdtype())<Enter>
function! CmdHstDelX(cmdtype)
if a:cmdtype == ":"
return histdel("cmd", -1)
else
return call getcmdline()
endif
endfunction
endif " ここまで無効

思考はこちらで行う。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
機能拡張 新機能の設計・実装
Development

No branches or pull requests

1 participant