mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-09 12:20:05 +08:00
Compare commits
No commits in common. "eacd71c78477902883845ddaf367ada49fdaf6dc" and "a0b86e67e879ada18c28f9d953114568f702c116" have entirely different histories.
eacd71c784
...
a0b86e67e8
@ -6,6 +6,8 @@
|
||||
|
||||
[![twitter](https://img.spacevim.org/twitter.svg)](https://twitter.com/SpaceVim)
|
||||
[![GPLv3 License](https://img.spacevim.org/license-GPLv3-blue.svg)](development/#license)
|
||||
[![reddit](https://img.spacevim.org/reddit.svg)](https://www.reddit.com/r/SpaceVim/)
|
||||
[![matrix](https://img.spacevim.org/spacevim-matrix.svg)](https://app.element.io/#/room/#spacevim:matrix.org)
|
||||
|
||||
![work-flow](https://img.spacevim.org/workflow.png)
|
||||
|
||||
|
@ -2872,6 +2872,10 @@ endfunction
|
||||
" send email to spacevim@googlegroups.com
|
||||
"
|
||||
" To subscribe the maillist, send anything to:spacevim+subscribe@googlegroups.com
|
||||
"
|
||||
" @subsection Forum
|
||||
"
|
||||
" - Reddit: https://www.reddit.com/r/SpaceVim/
|
||||
|
||||
""
|
||||
" @section Roadmap, roadmap
|
||||
|
@ -1,26 +1,3 @@
|
||||
"=============================================================================
|
||||
" fetch.vim --- Git fetch command
|
||||
" Copyright 2021 Eric Wong
|
||||
" Author: Eric Wong < wsdjeg@outlook.com >
|
||||
" URL: https://spacevim.org
|
||||
" License: GPLv3
|
||||
"=============================================================================
|
||||
|
||||
|
||||
if has('nvim-0.9.0')
|
||||
function! git#fetch#complete(ArgLead, CmdLine, CursorPos) abort
|
||||
return luaeval('require("git.command.fetch").complete(vim.api.nvim_eval("a:ArgLead"), vim.api.nvim_eval("a:CmdLine"), vim.api.nvim_eval("a:CursorPos"))')
|
||||
endfunction
|
||||
else
|
||||
|
||||
""
|
||||
" @section git-fetch, fetch
|
||||
" @parentsection commands
|
||||
" This commands is to fetch remote repo.
|
||||
" >
|
||||
" :Git fetch --all
|
||||
" <
|
||||
|
||||
let s:JOB = SpaceVim#api#import('job')
|
||||
|
||||
function! git#fetch#run(args)
|
||||
@ -68,4 +45,3 @@ else
|
||||
\ '--multiple',
|
||||
\ ], "\n")
|
||||
endfunction
|
||||
endif
|
||||
|
@ -1,16 +1,3 @@
|
||||
"=============================================================================
|
||||
" reset.vim --- git reset command
|
||||
" Copyright (c) 2016-2019 Wang Shidong & Contributors
|
||||
" Author: Wang Shidong < wsdjeg@outlook.com >
|
||||
" URL: https://spacevim.org
|
||||
" License: GPLv3
|
||||
"=============================================================================
|
||||
|
||||
if has('nvim-0.9.0')
|
||||
function! git#reset#complete(ArgLead, CmdLine, CursorPos) abort
|
||||
return luaeval('require("git.command.reset").complete(vim.api.nvim_eval("a:ArgLead"), vim.api.nvim_eval("a:CmdLine"), vim.api.nvim_eval("a:CursorPos"))')
|
||||
endfunction
|
||||
else
|
||||
let s:JOB = SpaceVim#api#import('job')
|
||||
|
||||
|
||||
@ -47,4 +34,4 @@ else
|
||||
return "%\n" . join(getcompletion(a:ArgLead, 'file'), "\n")
|
||||
|
||||
endfunction
|
||||
endif
|
||||
|
||||
|
@ -7,11 +7,6 @@
|
||||
" :Git rm %
|
||||
" <
|
||||
|
||||
if has('nvim-0.9.0')
|
||||
function! git#rm#complete(ArgLead, CmdLine, CursorPos) abort
|
||||
return luaeval('require("git.command.rm").complete(vim.api.nvim_eval("a:ArgLead"), vim.api.nvim_eval("a:CmdLine"), vim.api.nvim_eval("a:CursorPos"))')
|
||||
endfunction
|
||||
else
|
||||
let s:JOB = SpaceVim#api#import('job')
|
||||
|
||||
function! git#rm#run(files) abort
|
||||
@ -47,4 +42,3 @@ else
|
||||
return "%\n" . join(getcompletion(a:ArgLead, 'file'), "\n")
|
||||
|
||||
endfunction
|
||||
endif
|
||||
|
@ -6,11 +6,6 @@
|
||||
" :Git stash list
|
||||
" <
|
||||
|
||||
if has('nvim-0.9.0')
|
||||
function! git#stash#complete(ArgLead, CmdLine, CursorPos) abort
|
||||
return luaeval('require("git.command.stash").complete(vim.api.nvim_eval("a:ArgLead"), vim.api.nvim_eval("a:CmdLine"), vim.api.nvim_eval("a:CursorPos"))')
|
||||
endfunction
|
||||
else
|
||||
let s:JOB = SpaceVim#api#import('job')
|
||||
let s:NOTI = SpaceVim#api#import('notify')
|
||||
let s:BUFFER = SpaceVim#api#import('vim#buffer')
|
||||
@ -146,4 +141,3 @@ else
|
||||
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
@ -6,11 +6,6 @@
|
||||
" :Git tag --list
|
||||
" <
|
||||
|
||||
if has('nvim-0.9.0')
|
||||
function! git#tag#complete(ArgLead, CmdLine, CursorPos) abort
|
||||
return luaeval('require("git.command.tag").complete(vim.api.nvim_eval("a:ArgLead"), vim.api.nvim_eval("a:CmdLine"), vim.api.nvim_eval("a:CursorPos"))')
|
||||
endfunction
|
||||
else
|
||||
let s:JOB = SpaceVim#api#import('job')
|
||||
let s:NT = SpaceVim#api#import('notify')
|
||||
let s:jobid = -1
|
||||
@ -96,4 +91,3 @@ else
|
||||
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
@ -10,12 +10,11 @@ CONTENTS *git-contents*
|
||||
3. git-checkout............................................ |git-checkout|
|
||||
4. git-cherry-pick...................................... |git-cherry-pick|
|
||||
5. git-clean.................................................. |git-clean|
|
||||
6. git-fetch.................................................. |git-fetch|
|
||||
7. git-mv........................................................ |git-mv|
|
||||
8. git-reflog................................................ |git-reflog|
|
||||
9. git-rm........................................................ |git-rm|
|
||||
10. git-stash................................................. |git-stash|
|
||||
11. git-tag..................................................... |git-tag|
|
||||
6. git-mv........................................................ |git-mv|
|
||||
7. git-reflog................................................ |git-reflog|
|
||||
8. git-rm........................................................ |git-rm|
|
||||
9. git-stash.................................................. |git-stash|
|
||||
10. git-tag..................................................... |git-tag|
|
||||
3. Functions.................................................. |git-functions|
|
||||
|
||||
==============================================================================
|
||||
@ -71,14 +70,6 @@ This commands is to run `git clean`.
|
||||
:Git clean -f
|
||||
<
|
||||
|
||||
==============================================================================
|
||||
GIT-FETCH *git-fetch*
|
||||
|
||||
This commands is to fetch remote repo.
|
||||
>
|
||||
:Git fetch --all
|
||||
<
|
||||
|
||||
==============================================================================
|
||||
GIT-MV *git-mv*
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
--=============================================================================
|
||||
-- fetch.lua --- Git fetch
|
||||
-- Copyright 2023 Eric Wong
|
||||
-- Author: Eric Wong < wsdjeg@outlook.com >
|
||||
-- fetch.lua --- :Git fetch
|
||||
-- Copyright (c) 2016-2022 Wang Shidong & Contributors
|
||||
-- Author: Wang Shidong < wsdjeg@outlook.com >
|
||||
-- URL: https://spacevim.org
|
||||
-- License: GPLv3
|
||||
--=============================================================================
|
||||
|
||||
local M = {}
|
||||
local m = {}
|
||||
|
||||
local job = require('spacevim.api.job')
|
||||
local nt = require('spacevim.api.notify')
|
||||
@ -28,7 +28,7 @@ local function on_std(id, data)
|
||||
end
|
||||
end
|
||||
|
||||
function M.run(argv)
|
||||
function m.run(argv)
|
||||
local cmd = { 'git', 'fetch' }
|
||||
for _, v in ipairs(argv) do
|
||||
table.insert(cmd, v)
|
||||
@ -38,27 +38,8 @@ function M.run(argv)
|
||||
job.start(cmd, {
|
||||
on_exit = on_exit,
|
||||
on_stdout = on_std,
|
||||
on_stderr = on_std,
|
||||
on_stderr = on_std
|
||||
})
|
||||
end
|
||||
|
||||
local function get_remotes()
|
||||
return vim.tbl_map(function(t)
|
||||
return vim.fn.trim(t)
|
||||
end, vim.fn.systemlist('git remote'))
|
||||
end
|
||||
|
||||
function M.complete(ArgLead, CmdLine, CursorPos)
|
||||
if vim.startswith(ArgLead, '-') then
|
||||
return table.concat({ '--all', '--multiple' }, '\n')
|
||||
end
|
||||
|
||||
local str = string.sub(CmdLine, 1, CursorPos)
|
||||
if vim.regex([[^Git\s\+fetch\s\+[^ ]*$]]):match_str(str) then
|
||||
return table.concat(get_remotes(), '\n')
|
||||
else
|
||||
return ''
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
return m
|
||||
|
@ -5,7 +5,7 @@
|
||||
-- URL: https://spacevim.org
|
||||
-- License: GPLv3
|
||||
--=============================================================================
|
||||
local M = {}
|
||||
local m = {}
|
||||
|
||||
local job = require('spacevim.api.job')
|
||||
local nt = require('spacevim.api.notify')
|
||||
@ -23,7 +23,7 @@ local function on_exit(id, code, single)
|
||||
end
|
||||
end
|
||||
|
||||
function M.run(argv)
|
||||
function m.run(argv)
|
||||
local cmd = { 'git', 'reset' }
|
||||
if #argv == 1 and argv[1] == '%' then
|
||||
cmd = { 'git', 'reset', 'HEAD', vim.fn.expand('%') }
|
||||
@ -38,9 +38,4 @@ function M.run(argv)
|
||||
})
|
||||
end
|
||||
|
||||
function M.complete(ArgLead, CmdLine, CursorPos)
|
||||
local rst = vim.fn.getcompletion(ArgLead, 'file')
|
||||
return table.concat(rst, '\n')
|
||||
end
|
||||
|
||||
return M
|
||||
return m
|
||||
|
@ -47,9 +47,4 @@ function m.run(argv)
|
||||
})
|
||||
end
|
||||
|
||||
function M.complete(ArgLead, CmdLine, CursorPos)
|
||||
local rst = vim.fn.getcompletion(ArgLead, 'file')
|
||||
return table.concat(rst, '\n')
|
||||
end
|
||||
|
||||
return m
|
||||
|
@ -97,27 +97,4 @@ function M.run(argv)
|
||||
end
|
||||
end
|
||||
|
||||
local function sub_commands()
|
||||
return {
|
||||
'list',
|
||||
'show',
|
||||
'drop',
|
||||
'pop',
|
||||
'apply',
|
||||
'branch',
|
||||
'clear',
|
||||
'save',
|
||||
'push',
|
||||
}
|
||||
end
|
||||
|
||||
function M.complete(ArgLead, CmdLine, CursorPos)
|
||||
local str = string.sub(CmdLine, 1, CursorPos)
|
||||
if vim.regex([[^Git\s\+stash\s\+[a-z]\+$]]):match_str(str) then
|
||||
return table.concat(sub_commands(), '\n')
|
||||
else
|
||||
return ''
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
@ -72,14 +72,7 @@ function M.run(argv)
|
||||
end
|
||||
end
|
||||
|
||||
function M.complete(ArgLead, CmdLine, CursorPos)
|
||||
local str = string.sub(CmdLine, 1, CursorPos)
|
||||
if vim.regex([[^Git\s\+tag\s\+-\+$]]):match_str(str) then
|
||||
return table.concat({'--list'}, '\n')
|
||||
else
|
||||
return ''
|
||||
end
|
||||
end
|
||||
function M.complete(ArgLead, CmdLine, CursorPos) end
|
||||
|
||||
return M
|
||||
|
||||
|
@ -8465,6 +8465,10 @@ send email to spacevim@googlegroups.com
|
||||
To subscribe the maillist, send anything
|
||||
to:spacevim+subscribe@googlegroups.com
|
||||
|
||||
FORUM
|
||||
|
||||
Reddit: https://www.reddit.com/r/SpaceVim/
|
||||
|
||||
==============================================================================
|
||||
FAQ *SpaceVim-faq*
|
||||
|
||||
|
@ -6,6 +6,8 @@ lang: zh
|
||||
|
||||
[![twitter](https://img.spacevim.org/twitter.svg)](https://twitter.com/SpaceVim)
|
||||
[![GPLv3 License](https://img.spacevim.org/license-GPLv3-blue.svg)](development/#证书)
|
||||
[![reddit](https://img.spacevim.org/reddit.svg)](https://www.reddit.com/r/SpaceVim/)
|
||||
-[![matrix](https://img.spacevim.org/spacevim-cn-matrix.svg)](https://app.element.io/#/room/#spacevim-cn:matrix.org)
|
||||
|
||||
![work-flow](https://img.spacevim.org/workflow.png)
|
||||
|
||||
|
@ -5,6 +5,8 @@ description: "SpaceVim is a modular Vim/Neovim configuration that seeks to provi
|
||||
|
||||
[![twitter](https://img.spacevim.org/twitter.svg)](https://twitter.com/SpaceVim)
|
||||
[![GPLv3 License](https://img.spacevim.org/license-GPLv3-blue.svg)](development/#license)
|
||||
[![reddit](https://img.spacevim.org/reddit.svg)](https://www.reddit.com/r/SpaceVim/)
|
||||
[![matrix](https://img.spacevim.org/spacevim-matrix.svg)](https://app.element.io/#/room/#spacevim:matrix.org)
|
||||
|
||||
![work-flow](https://img.spacevim.org/workflow.png)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user