From 284d25e594cc6cd39547f3ee7e9f568b2017aabd Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Tue, 13 Oct 2020 18:58:15 +0200 Subject: vimrc: Replace `t` cabbrev with `T` command alias Alias `T` to `TComment` instead of using a cabbrev. The abbreviation would mess up commands with "t" in them, like turning `tjump` into `TCommentjump`. Replace the abbreviation with a new `T` command that acts as an alias for `TComment`. I didn't include argument completion because I don't use that. Otherwise, replicate the `TComment` command's definition and pass all parameters to it. This gives us a short alias for commenting, and `T` is the first completion with `:t`. --- plugin/abbreviations.vim | 1 - vimrc | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/plugin/abbreviations.vim b/plugin/abbreviations.vim index 58966be..0e4451e 100644 --- a/plugin/abbreviations.vim +++ b/plugin/abbreviations.vim @@ -1,2 +1 @@ -cabbrev t TComment cabbrev tb TBuffer diff --git a/vimrc b/vimrc index e8603ee..35394ba 100644 --- a/vimrc +++ b/vimrc @@ -470,6 +470,9 @@ " 2020.09.24: " * Add db to open buffers with Pick and :TBuffer. " +" 2020.10.13: +" * Add command alias `T` to `TComment`. +" " Pathogen @@ -715,6 +718,10 @@ nnoremap sm :call whitespace_method_chain#SplitMethodChainToMultipleLine nnoremap gS :ArgWrap +" TComment +command! -bar -bang -range -nargs=* T ,TComment + + " Mappings " ======== -- cgit v1.2.3