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
|
||||||
return true
|
if file_lines > 1000 then
|
||||||
|
vim.b.codefmt_formatt = "" -- disable codefmt
|
||||||
|
vim.cmd(":FormatDisable") -- disable conform
|
||||||
|
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" }
|
||||||
|
@ -1,97 +1,93 @@
|
|||||||
local use_google = require("utils").use_google
|
local use_google = require("utils").use_google
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"ful1e5/onedark.nvim",
|
"ful1e5/onedark.nvim",
|
||||||
priority = 1000, -- make sure to load this before all the other start plugins
|
priority = 1000, -- make sure to load this before all the other start plugins
|
||||||
lazy = not use_google(), -- make sure we load this during startup if it is your main colorscheme
|
lazy = not use_google(), -- make sure we load this during startup if it is your main colorscheme
|
||||||
cond = use_google(),
|
cond = use_google(),
|
||||||
config = function()
|
config = function()
|
||||||
-- require("onedark").setup()
|
-- require("onedark").setup()
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"catppuccin/nvim",
|
"catppuccin/nvim",
|
||||||
name = "catppuccin",
|
name = "catppuccin",
|
||||||
priority = 1000, -- make sure to load this before all the other start plugins
|
priority = 1000, -- make sure to load this before all the other start plugins
|
||||||
lazy = not use_google(), -- make sure we load this during startup if it is your main colorscheme
|
lazy = not use_google(), -- make sure we load this during startup if it is your main colorscheme
|
||||||
cond = use_google(),
|
cond = use_google(),
|
||||||
config = function()
|
config = function()
|
||||||
vim.g.catppuccin_flavour = "macchiato" -- latte, frappe, macchiato, mocha
|
vim.g.catppuccin_flavour = "macchiato" -- latte, frappe, macchiato, mocha
|
||||||
local colors = require("catppuccin.palettes").get_palette()
|
local colors = require("catppuccin.palettes").get_palette()
|
||||||
|
|
||||||
require("catppuccin").setup({
|
require("catppuccin").setup({
|
||||||
flavour = "mocha",
|
flavour = "mocha",
|
||||||
integrations = {
|
integrations = {
|
||||||
cmp = true,
|
cmp = true,
|
||||||
-- coc_nvim = false,
|
-- coc_nvim = false,
|
||||||
dashboard = true,
|
dashboard = true,
|
||||||
-- fern = false,
|
-- fern = false,
|
||||||
fidget = true,
|
fidget = true,
|
||||||
gitgutter = true,
|
gitgutter = true,
|
||||||
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 = {
|
mason = true,
|
||||||
enabled = true,
|
markdown = true,
|
||||||
-- lsp = false
|
-- neogit = false,
|
||||||
},
|
-- neotest = false,
|
||||||
mason = true,
|
neotree = true,
|
||||||
markdown = true,
|
notify = true,
|
||||||
-- neogit = false,
|
nvimtree = true,
|
||||||
-- neotest = false,
|
-- overseer = false,
|
||||||
neotree = true,
|
-- pounce = false,
|
||||||
notify = true,
|
symbols_outline = true,
|
||||||
nvimtree = true,
|
telescope = true,
|
||||||
-- overseer = false,
|
treesitter = true,
|
||||||
-- pounce = false,
|
treesitter_context = true,
|
||||||
symbols_outline = true,
|
-- ts_rainbow = false,
|
||||||
telescope = true,
|
-- vim_sneak = false,
|
||||||
treesitter = true,
|
-- vimwiki = false,
|
||||||
treesitter_context = true,
|
which_key = true,
|
||||||
-- ts_rainbow = false,
|
-- Special integrations, see https://github.com/catppuccin/nvim#special-integrations
|
||||||
-- vim_sneak = false,
|
dap = true,
|
||||||
-- vimwiki = false,
|
dap_ui = true,
|
||||||
which_key = true,
|
indent_blankline = {
|
||||||
-- Special integrations, see https://github.com/catppuccin/nvim#special-integrations
|
enabled = true,
|
||||||
dap = true,
|
colored_indent_levels = false,
|
||||||
dap_ui = true,
|
},
|
||||||
indent_blankline = {
|
},
|
||||||
enabled = true,
|
native_lsp = {
|
||||||
colored_indent_levels = false,
|
enabled = true,
|
||||||
},
|
virtual_text = {
|
||||||
},
|
errors = { "italic" },
|
||||||
native_lsp = {
|
hints = { "italic" },
|
||||||
enabled = true,
|
warnings = { "italic" },
|
||||||
virtual_text = {
|
information = { "italic" },
|
||||||
errors = { "italic" },
|
},
|
||||||
hints = { "italic" },
|
underlines = {
|
||||||
warnings = { "italic" },
|
errors = { "underline" },
|
||||||
information = { "italic" },
|
hints = { "underline" },
|
||||||
},
|
warnings = { "underline" },
|
||||||
underlines = {
|
information = { "underline" },
|
||||||
errors = { "underline" },
|
},
|
||||||
hints = { "underline" },
|
inlay_hints = {
|
||||||
warnings = { "underline" },
|
background = true,
|
||||||
information = { "underline" },
|
},
|
||||||
},
|
},
|
||||||
inlay_hints = {
|
custom_highlights = {
|
||||||
background = true,
|
-- Identifier = { fg = colors.lavender },
|
||||||
},
|
-- Statement = { fg = colors.rosewater },
|
||||||
},
|
-- Identifier = { fg = colors.sapphire },
|
||||||
custom_highlights = {
|
-- Function = { fg = colors.mauve },
|
||||||
-- Identifier = { fg = colors.lavender },
|
},
|
||||||
-- Statement = { fg = colors.rosewater },
|
})
|
||||||
-- Identifier = { fg = colors.sapphire },
|
|
||||||
-- Function = { fg = colors.mauve },
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.api.nvim_command("colorscheme catppuccin")
|
vim.api.nvim_command("colorscheme catppuccin")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user