0

I am using the plugin ag.vim in Vim, and I want to do a simple re-mapping.

When I run ag with :Ag I want remap it to :ag so I don't have to use shift.
example: :ag string_to_find instead of :Ag string_to_find

How can I do this?

timss
  • 9,982
  • 4
  • 34
  • 56
nothing-special-here
  • 11,230
  • 13
  • 64
  • 94
  • 1
    possible duplicate of [vim change :x function to delete buffer instead of save & quit](http://stackoverflow.com/questions/7513380/vim-change-x-function-to-delete-buffer-instead-of-save-quit) – Ingo Karkat Jun 10 '13 at 14:02

3 Answers3

2

You shouldn't. Lowercase commands are reserved for built-in commands, and the norm/rules are to start custom commands with an uppercase character (just like with functions).

See Is it possible to remap an Ex command in Vim (remap :Ack to :ack)?

Community
  • 1
  • 1
timss
  • 9,982
  • 4
  • 34
  • 56
0

This isn't exactly what you asked for, but dding the following will allow you to just type 'ag' to search:

map ag :Ag
Dave
  • 1
  • Welcome to SO! If this is not what the OP asked for, and the post is 2 years old, I wonder why this would be posted as an answer? See the [how to answer page](http://stackoverflow.com/help/how-to-answer) for help understanding what an answer is. – Madness Aug 27 '15 at 15:36
  • This should be a comment rather than an answer. – toesslab Aug 27 '15 at 15:43
-2

EDIT: The downvoters are right and this is a bad answer. I'll leave it here so future searchers know it's wrong.

Try:

command: Ag ag

See :help command for more.

cms_mgr
  • 1,977
  • 2
  • 17
  • 31