Dave
Dave

Reputation: 8091

Vim delete a command

How do I delete a command that I created using the :command command?

I mis-typed:

:command Bigfon guifont=Monospace\ 12 

So now I have a Bigfon command that doesn't work correctly; I'd like to just have a Bigfont command that does (:command Bigfont set guifont=Monospace\ 12)

Searches that involve both "Vim" and "delete" seem to only return pages that describe the various commands to delete text.

Upvotes: 0

Views: 378

Answers (1)

dNitro
dNitro

Reputation: 5345

delc Bigfon or delcommand Bigfon.

Documentation :h delc:

:delc[ommand] {cmd}             *:delc* *:delcommand* *E184*
            Delete the user-defined command {cmd}.

Although there is a much better way to change font size quickly ( from tpope's .vimrc ):

" Quickly change gui font size with + and - in normal mode
command! -bar -nargs=0 Bigger  :let &guifont = substitute(&guifont,'\d\+$','\=submatch(0)+1','')
command! -bar -nargs=0 Smaller :let &guifont = substitute(&guifont,'\d\+$','\=submatch(0)-1','')
nnoremap - :Smaller<CR>
nnoremap + :Bigger<CR>

Upvotes: 4

Related Questions