From 9bbbb65888293f6d6a4da55bc8b0d8907ba779d4 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sun, 16 Feb 2020 13:49:00 -0500 Subject: [PATCH] Add capitalized versions of non-standard commands The long term goal is to use :Gsomecommand for commands that wrap Vim built-ins (e.g., :Gedit for :edit), :Git some-command for commands that wrap Git built-ins, and :GSomeCommand for everything else. For :GRemove, :GDelete, :GMove, and :GRename, this gives us symmetry with eunuch.vim, and for :GBrowse, this gives us symmetry with a hypothetical :Browse command that I've long wanted to make a plugin for but probably never will. :GcLog and :GlLog get their names because they match Vim's :c and :l prefixes but bring their own custom suffix. This is rather unsatisfying and I may change it if something better comes along. --- plugin/fugitive.vim | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index a1e66fb..0c362ef 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -443,7 +443,9 @@ exe 'command! -bang -nargs=? -range=-1' s:addr_wins '-complete=customlist,fugiti exe 'command! -bang -nargs=? -range=-1 -complete=customlist,fugitive#LogComplete Glog :exe fugitive#LogCommand(,,+"",0,"",, "")' exe 'command! -bang -nargs=? -range=-1 -complete=customlist,fugitive#LogComplete Gclog :exe fugitive#LogCommand(,,+"",0,"",, "c")' +exe 'command! -bang -nargs=? -range=-1 -complete=customlist,fugitive#LogComplete GcLog :exe fugitive#LogCommand(,,+"",0,"",, "c")' exe 'command! -bang -nargs=? -range=-1 -complete=customlist,fugitive#LogComplete Gllog :exe fugitive#LogCommand(,,+"",0,"",, "l")' +exe 'command! -bang -nargs=? -range=-1 -complete=customlist,fugitive#LogComplete GlLog :exe fugitive#LogCommand(,,+"",0,"",, "l")' exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Ge exe fugitive#Open("edit", 0, "", , [])' exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Gedit exe fugitive#Open("edit", 0, "", , [])' @@ -466,11 +468,16 @@ exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Gwr exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Gwq exe fugitive#WqCommand( , , +"", 0, "", , [])' exe 'command! -bar -bang -nargs=0 -complete=customlist,fugitive#CompleteObject Gremove exe fugitive#RemoveCommand(, , +"", 0, "", , [])' +exe 'command! -bar -bang -nargs=0 -complete=customlist,fugitive#CompleteObject GRemove exe fugitive#RemoveCommand(, , +"", 0, "", , [])' exe 'command! -bar -bang -nargs=0 -complete=customlist,fugitive#CompleteObject Gdelete exe fugitive#DeleteCommand(, , +"", 0, "", , [])' +exe 'command! -bar -bang -nargs=0 -complete=customlist,fugitive#CompleteObject GDelete exe fugitive#DeleteCommand(, , +"", 0, "", , [])' exe 'command! -bar -bang -nargs=1 -complete=customlist,fugitive#CompleteObject Gmove exe fugitive#MoveCommand( , , +"", 0, "", , [])' +exe 'command! -bar -bang -nargs=1 -complete=customlist,fugitive#CompleteObject GMove exe fugitive#MoveCommand( , , +"", 0, "", , [])' exe 'command! -bar -bang -nargs=1 -complete=customlist,fugitive#RenameComplete Grename exe fugitive#RenameCommand(, , +"", 0, "", , [])' +exe 'command! -bar -bang -nargs=1 -complete=customlist,fugitive#RenameComplete GRename exe fugitive#RenameCommand(, , +"", 0, "", , [])' exe 'command! -bar -bang -range=-1 -nargs=* -complete=customlist,fugitive#CompleteObject Gbrowse exe fugitive#BrowseCommand(, , +"", 0, "", , [])' +exe 'command! -bar -bang -range=-1 -nargs=* -complete=customlist,fugitive#CompleteObject GBrowse exe fugitive#BrowseCommand(, , +"", 0, "", , [])' if get(g:, 'fugitive_no_maps') finish