more git
This commit is contained in:
@ -3,26 +3,28 @@ return {
|
|||||||
opts = {
|
opts = {
|
||||||
filesize = 2, -- size of the file in MiB, the plugin round file sizes to the closest MiB
|
filesize = 2, -- size of the file in MiB, the plugin round file sizes to the closest MiB
|
||||||
pattern = function(bufnr, filesize_mib)
|
pattern = function(bufnr, filesize_mib)
|
||||||
vim.b.codefmt_formatt= ""
|
|
||||||
vim.cmd(":FormatDisable")
|
|
||||||
-- you can't use `nvim_buf_line_count` because this runs on BufReadPre
|
-- you can't use `nvim_buf_line_count` because this runs on BufReadPre
|
||||||
local file_contents = vim.fn.readfile(vim.api.nvim_buf_get_name(bufnr))
|
local file_contents = vim.fn.readfile(vim.api.nvim_buf_get_name(bufnr))
|
||||||
local file_lines = #file_contents
|
local file_lines = #file_contents
|
||||||
local filetype = vim.filetype.match({ buf = bufnr })
|
local filetype = vim.filetype.match({ buf = bufnr })
|
||||||
if file_lines > 1000 and (filetype == "c" or filetype == "cpp") then
|
if filetype == "c" or filetype == "cpp" then
|
||||||
|
if file_lines > 1000 then
|
||||||
|
vim.b.codefmt_formatt = "" -- disable codefmt
|
||||||
|
vim.cmd(":FormatDisable") -- disable conform
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
end
|
||||||
return filesize_mib > 1
|
return filesize_mib > 1
|
||||||
end,
|
end,
|
||||||
features = { -- features to disable
|
features = { -- features to disable
|
||||||
"indent_blankline",
|
"indent_blankline",
|
||||||
-- "illuminate",
|
"illuminate",
|
||||||
"lsp",
|
"lsp",
|
||||||
"treesitter",
|
"treesitter",
|
||||||
-- "syntax",
|
-- "syntax",
|
||||||
-- "matchparen",
|
"matchparen",
|
||||||
-- "vimopts",
|
-- "vimopts",
|
||||||
"filetype",
|
-- "filetype",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,30 +1,33 @@
|
|||||||
local use_google = require("utils").use_google
|
local use_google = require("utils").use_google
|
||||||
|
|
||||||
local function change_diffbase(hg_revision, git_revision)
|
local function change_diffbase(hg_revision, git_revision)
|
||||||
local git_cmd = "git diff --no-color --no-ext-diff -U0 " .. git_revision .. " -- %f"
|
vim.g.signify_vcs_cmds = {
|
||||||
local rcs_cmd = "rcsdiff -U0 %f 2>%n"
|
git = "git diff --no-color --diff-algorithm=histogram --no-ext-diff -U0 " .. git_revision .. " -- %f",
|
||||||
local svn_cmd = "svn diff --diff-cmd %d -x -U0 -- %f"
|
yadm = 'yadm diff --no-color --no-ext-diff -U0 -- %f',
|
||||||
local hg_diff = hg_revision .. " --color=never config aliases.diff= --nodates -U0 -- %f"
|
hg = 'chg --config alias.diff=diff diff --color=never --nodates -U0 -- %f',
|
||||||
local hg_cat = hg_revision .. " -- %f"
|
svn = 'svn diff --diff-cmd %d -x -U0 -- %f',
|
||||||
|
bzr = 'bzr diff --using %d --diff-options=-U0 -- %f',
|
||||||
vim.cmd(string.format(
|
darcs = 'darcs diff --no-pause-for-gui --no-unified --diff-opts=-U0 -- %f',
|
||||||
[[
|
fossil = 'fossil diff --unified -c 0 -- %f',
|
||||||
let g:signify_vcs_cmds = {
|
cvs = 'cvs diff -U0 -- %f',
|
||||||
\ 'git': '%s',
|
rcs = 'rcsdiff -U0 %f 2>%n',
|
||||||
\ 'rcs': '%s',
|
accurev = 'accurev diff %f -- -U0',
|
||||||
\ 'svn': '%s',
|
tfs = 'tf diff -version=W -noprompt -format=Unified %f'
|
||||||
\ 'hg': 'chg diff %s',
|
}
|
||||||
\ }
|
vim.g.signify_vcs_cmds_diffmode = {
|
||||||
let g:signify_vcs_cmds_diffmode = {
|
git = "git show " .. git_revision .. ":./%f",
|
||||||
\ 'hg': 'chg cat %s',
|
hg = "chg cat " .. hg_revision .. " -- %f",
|
||||||
\ }
|
yadm = 'yadm show HEAD:./%f',
|
||||||
]],
|
svn = 'svn cat %f',
|
||||||
git_cmd,
|
bzr = 'bzr cat %f',
|
||||||
rcs_cmd,
|
darcs = 'darcs show contents -- %f',
|
||||||
svn_cmd,
|
fossil = 'fossil cat %f',
|
||||||
hg_diff,
|
cvs = 'cvs up -p -- %f 2>%n',
|
||||||
hg_cat
|
rcs = 'co -q -p %f',
|
||||||
))
|
accurev = 'accurev cat %f',
|
||||||
|
perforce = 'p4 print %f',
|
||||||
|
tfs = 'tf view -version:W -noprompt %f',
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
_G.signify_dtup = function()
|
_G.signify_dtup = function()
|
||||||
@ -40,7 +43,7 @@ _G.signify_normal = function()
|
|||||||
end
|
end
|
||||||
|
|
||||||
_G.signify_dtp4 = function()
|
_G.signify_dtp4 = function()
|
||||||
change_diffbase("-r p4head", "HEAD^")
|
change_diffbase("-r p4head", "main")
|
||||||
vim.cmd([[:SignifyEnable]])
|
vim.cmd([[:SignifyEnable]])
|
||||||
vim.cmd([[:SignifyRefresh]])
|
vim.cmd([[:SignifyRefresh]])
|
||||||
end
|
end
|
||||||
@ -62,6 +65,7 @@ return {
|
|||||||
{ "<leader>sup", ":lua signify_dtup()<CR>" },
|
{ "<leader>sup", ":lua signify_dtup()<CR>" },
|
||||||
{ "<leader>sex", ":lua signify_dtex()<CR>" },
|
{ "<leader>sex", ":lua signify_dtex()<CR>" },
|
||||||
{ "<leader>sp4", ":lua signify_dtp4()<CR>" },
|
{ "<leader>sp4", ":lua signify_dtp4()<CR>" },
|
||||||
|
{ "<leader>sb", ":lua signify_dtp4()<CR>" },
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
vim.g.signify_vcs_list = { "hg", "git" }
|
vim.g.signify_vcs_list = { "hg", "git" }
|
||||||
|
@ -32,14 +32,10 @@ return {
|
|||||||
gitsigns = true,
|
gitsigns = true,
|
||||||
-- hop = false,
|
-- hop = false,
|
||||||
illuminate = true,
|
illuminate = true,
|
||||||
-- leap = false,
|
leap = false,
|
||||||
-- lightspeed = false,
|
-- lightspeed = false,
|
||||||
-- lsp_saga = false,
|
-- lsp_saga = false,
|
||||||
lsp_trouble = true,
|
lsp_trouble = true,
|
||||||
illuminate = {
|
|
||||||
enabled = true,
|
|
||||||
-- lsp = false
|
|
||||||
},
|
|
||||||
mason = true,
|
mason = true,
|
||||||
markdown = true,
|
markdown = true,
|
||||||
-- neogit = false,
|
-- neogit = false,
|
||||||
|
Reference in New Issue
Block a user