@@ -1722,6 +1722,22 @@ function M.clean()
17221722 end )()
17231723end
17241724
1725+ function M .remove (plugin )
1726+ local path = vim .fs .joinpath (OPT_DIR , plugin )
1727+ if not isdir (path ) then
1728+ path = vim .fs .joinpath (START_DIR , plugin )
1729+ if not isdir (path ) then
1730+ return
1731+ end
1732+ end
1733+
1734+ local ok , result = pcall (vim .fn .delete , path , ' rf' )
1735+ if not ok or result ~= 0 then
1736+ return M .log (' Info' , ' Failed to remove' )
1737+ end
1738+ M .log (' warn' , (' Plugin %s removed successful' ):format (plugin ))
1739+ end
1740+
17251741-- use uv instead of calling clock_time with ffi
17261742local function startuptime ()
17271743 if vim .g .strive_startup_time ~= nil then
@@ -1772,10 +1788,14 @@ api.nvim_create_autocmd('UIEnter', {
17721788 end ,
17731789})
17741790
1775- local t = { install = 1 , update = 2 , clean = 3 }
1791+ local t = { install = 1 , update = 2 , clean = 3 , remove = 4 }
17761792api .nvim_create_user_command (' Strive' , function (args )
1777- if t [args .args ] then
1778- M [args .args ]()
1793+ if # args .fargs == 0 then
1794+ return
1795+ end
1796+
1797+ if t [args .fargs [1 ]] then
1798+ M [args .fargs [1 ]](args .fargs [2 ])
17791799 end
17801800end , {
17811801 desc = ' Install plugins' ,
0 commit comments