diff --git a/vim/.vim/lua/plugins/bigfile.lua b/vim/.vim/lua/plugins/bigfile.lua index a290256..f714a41 100644 --- a/vim/.vim/lua/plugins/bigfile.lua +++ b/vim/.vim/lua/plugins/bigfile.lua @@ -3,26 +3,28 @@ return { opts = { filesize = 2, -- size of the file in MiB, the plugin round file sizes to the closest 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 local file_contents = vim.fn.readfile(vim.api.nvim_buf_get_name(bufnr)) local file_lines = #file_contents local filetype = vim.filetype.match({ buf = bufnr }) - if file_lines > 1000 and (filetype == "c" or filetype == "cpp") then - return true + 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 + end end return filesize_mib > 1 end, features = { -- features to disable "indent_blankline", - -- "illuminate", + "illuminate", "lsp", "treesitter", -- "syntax", - -- "matchparen", + "matchparen", -- "vimopts", - "filetype", + -- "filetype", }, } } diff --git a/vim/.vim/lua/plugins/signify.lua b/vim/.vim/lua/plugins/signify.lua index 673bd42..2af9db9 100644 --- a/vim/.vim/lua/plugins/signify.lua +++ b/vim/.vim/lua/plugins/signify.lua @@ -1,30 +1,33 @@ local use_google = require("utils").use_google local function change_diffbase(hg_revision, git_revision) - local git_cmd = "git diff --no-color --no-ext-diff -U0 " .. git_revision .. " -- %f" - local rcs_cmd = "rcsdiff -U0 %f 2>%n" - local svn_cmd = "svn diff --diff-cmd %d -x -U0 -- %f" - local hg_diff = hg_revision .. " --color=never config aliases.diff= --nodates -U0 -- %f" - local hg_cat = hg_revision .. " -- %f" - - vim.cmd(string.format( - [[ -let g:signify_vcs_cmds = { - \ 'git': '%s', - \ 'rcs': '%s', - \ 'svn': '%s', - \ 'hg': 'chg diff %s', - \ } -let g:signify_vcs_cmds_diffmode = { - \ 'hg': 'chg cat %s', - \ } - ]], - git_cmd, - rcs_cmd, - svn_cmd, - hg_diff, - hg_cat - )) + vim.g.signify_vcs_cmds = { + git = "git diff --no-color --diff-algorithm=histogram --no-ext-diff -U0 " .. git_revision .. " -- %f", + yadm = 'yadm diff --no-color --no-ext-diff -U0 -- %f', + hg = 'chg --config alias.diff=diff diff --color=never --nodates -U0 -- %f', + svn = 'svn diff --diff-cmd %d -x -U0 -- %f', + bzr = 'bzr diff --using %d --diff-options=-U0 -- %f', + darcs = 'darcs diff --no-pause-for-gui --no-unified --diff-opts=-U0 -- %f', + fossil = 'fossil diff --unified -c 0 -- %f', + cvs = 'cvs diff -U0 -- %f', + rcs = 'rcsdiff -U0 %f 2>%n', + accurev = 'accurev diff %f -- -U0', + tfs = 'tf diff -version=W -noprompt -format=Unified %f' + } + vim.g.signify_vcs_cmds_diffmode = { + git = "git show " .. git_revision .. ":./%f", + hg = "chg cat " .. hg_revision .. " -- %f", + yadm = 'yadm show HEAD:./%f', + svn = 'svn cat %f', + bzr = 'bzr cat %f', + darcs = 'darcs show contents -- %f', + fossil = 'fossil cat %f', + cvs = 'cvs up -p -- %f 2>%n', + rcs = 'co -q -p %f', + accurev = 'accurev cat %f', + perforce = 'p4 print %f', + tfs = 'tf view -version:W -noprompt %f', + } end _G.signify_dtup = function() @@ -40,7 +43,7 @@ _G.signify_normal = function() end _G.signify_dtp4 = function() - change_diffbase("-r p4head", "HEAD^") + change_diffbase("-r p4head", "main") vim.cmd([[:SignifyEnable]]) vim.cmd([[:SignifyRefresh]]) end @@ -62,6 +65,7 @@ return { { "sup", ":lua signify_dtup()" }, { "sex", ":lua signify_dtex()" }, { "sp4", ":lua signify_dtp4()" }, + { "sb", ":lua signify_dtp4()" }, }, config = function() vim.g.signify_vcs_list = { "hg", "git" } diff --git a/vim/.vim/lua/plugins/themes-work.lua b/vim/.vim/lua/plugins/themes-work.lua index df33b29..c16c073 100644 --- a/vim/.vim/lua/plugins/themes-work.lua +++ b/vim/.vim/lua/plugins/themes-work.lua @@ -1,97 +1,93 @@ local use_google = require("utils").use_google return { - { - "ful1e5/onedark.nvim", - 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 - cond = use_google(), - config = function() - -- require("onedark").setup() - end, - }, - { - "catppuccin/nvim", - name = "catppuccin", - 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 - cond = use_google(), - config = function() - vim.g.catppuccin_flavour = "macchiato" -- latte, frappe, macchiato, mocha - local colors = require("catppuccin.palettes").get_palette() + { + "ful1e5/onedark.nvim", + 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 + cond = use_google(), + config = function() + -- require("onedark").setup() + end, + }, + { + "catppuccin/nvim", + name = "catppuccin", + 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 + cond = use_google(), + config = function() + vim.g.catppuccin_flavour = "macchiato" -- latte, frappe, macchiato, mocha + local colors = require("catppuccin.palettes").get_palette() - require("catppuccin").setup({ - flavour = "mocha", - integrations = { - cmp = true, - -- coc_nvim = false, - dashboard = true, - -- fern = false, - fidget = true, - gitgutter = true, - gitsigns = true, - -- hop = false, - illuminate = true, - -- leap = false, - -- lightspeed = false, - -- lsp_saga = false, - lsp_trouble = true, - illuminate = { - enabled = true, - -- lsp = false - }, - mason = true, - markdown = true, - -- neogit = false, - -- neotest = false, - neotree = true, - notify = true, - nvimtree = true, - -- overseer = false, - -- pounce = false, - symbols_outline = true, - telescope = true, - treesitter = true, - treesitter_context = true, - -- ts_rainbow = false, - -- vim_sneak = false, - -- vimwiki = false, - which_key = true, - -- Special integrations, see https://github.com/catppuccin/nvim#special-integrations - dap = true, - dap_ui = true, - indent_blankline = { - enabled = true, - colored_indent_levels = false, - }, - }, - native_lsp = { - enabled = true, - virtual_text = { - errors = { "italic" }, - hints = { "italic" }, - warnings = { "italic" }, - information = { "italic" }, - }, - underlines = { - errors = { "underline" }, - hints = { "underline" }, - warnings = { "underline" }, - information = { "underline" }, - }, - inlay_hints = { - background = true, - }, - }, - custom_highlights = { - -- Identifier = { fg = colors.lavender }, - -- Statement = { fg = colors.rosewater }, - -- Identifier = { fg = colors.sapphire }, - -- Function = { fg = colors.mauve }, - }, - }) + require("catppuccin").setup({ + flavour = "mocha", + integrations = { + cmp = true, + -- coc_nvim = false, + dashboard = true, + -- fern = false, + fidget = true, + gitgutter = true, + gitsigns = true, + -- hop = false, + illuminate = true, + leap = false, + -- lightspeed = false, + -- lsp_saga = false, + lsp_trouble = true, + mason = true, + markdown = true, + -- neogit = false, + -- neotest = false, + neotree = true, + notify = true, + nvimtree = true, + -- overseer = false, + -- pounce = false, + symbols_outline = true, + telescope = true, + treesitter = true, + treesitter_context = true, + -- ts_rainbow = false, + -- vim_sneak = false, + -- vimwiki = false, + which_key = true, + -- Special integrations, see https://github.com/catppuccin/nvim#special-integrations + dap = true, + dap_ui = true, + indent_blankline = { + enabled = true, + colored_indent_levels = false, + }, + }, + native_lsp = { + enabled = true, + virtual_text = { + errors = { "italic" }, + hints = { "italic" }, + warnings = { "italic" }, + information = { "italic" }, + }, + underlines = { + errors = { "underline" }, + hints = { "underline" }, + warnings = { "underline" }, + information = { "underline" }, + }, + inlay_hints = { + background = true, + }, + }, + custom_highlights = { + -- Identifier = { fg = colors.lavender }, + -- Statement = { fg = colors.rosewater }, + -- Identifier = { fg = colors.sapphire }, + -- Function = { fg = colors.mauve }, + }, + }) - vim.api.nvim_command("colorscheme catppuccin") - end, - }, + vim.api.nvim_command("colorscheme catppuccin") + end, + }, }