bigfile
This commit is contained in:
@ -1,9 +1,8 @@
|
||||
local use_google = require("utils").use_google
|
||||
local buf_too_large = require("utils").buf_too_large
|
||||
|
||||
return {
|
||||
"sindrets/diffview.nvim",
|
||||
{ "mizlan/iswap.nvim", event = "VeryLazy" },
|
||||
--{ "mizlan/iswap.nvim", event = "VeryLazy" },
|
||||
{ "folke/todo-comments.nvim", dependencies = { "nvim-lua/plenary.nvim" }, },
|
||||
{
|
||||
"folke/flash.nvim",
|
||||
@ -79,27 +78,7 @@ return {
|
||||
vim.ui.select = require("dropbar.utils.menu").select
|
||||
end,
|
||||
},
|
||||
{
|
||||
"RRethy/vim-illuminate",
|
||||
config = function()
|
||||
local aug = vim.api.nvim_create_augroup("buf_large", { clear = true })
|
||||
vim.api.nvim_create_autocmd({ "BufReadPre" }, {
|
||||
callback = function()
|
||||
if buf_too_large() then
|
||||
vim.b.large_buf = true
|
||||
vim.cmd("syntax off")
|
||||
vim.cmd("IlluminatePauseBuf") -- disable vim-illuminate
|
||||
vim.opt_local.foldmethod = "manual"
|
||||
vim.opt_local.spell = false
|
||||
else
|
||||
vim.b.large_buf = false
|
||||
end
|
||||
end,
|
||||
group = aug,
|
||||
pattern = "*",
|
||||
})
|
||||
end,
|
||||
},
|
||||
"RRethy/vim-illuminate",
|
||||
"kdheepak/lazygit.nvim",
|
||||
"flwyd/vim-conjoin",
|
||||
"rafcamlet/nvim-luapad",
|
||||
|
14
vim/.vim/lua/plugins/bigfile.lua
Normal file
14
vim/.vim/lua/plugins/bigfile.lua
Normal file
@ -0,0 +1,14 @@
|
||||
require("bigfile").setup {
|
||||
filesize = 2, -- size of the file in MiB, the plugin round file sizes to the closest MiB
|
||||
pattern = { "*" }, -- autocmd pattern or function see <### Overriding the detection of big files>
|
||||
features = { -- features to disable
|
||||
"indent_blankline",
|
||||
"illuminate",
|
||||
"lsp",
|
||||
"treesitter",
|
||||
"syntax",
|
||||
"matchparen",
|
||||
"vimopts",
|
||||
"filetype",
|
||||
},
|
||||
}
|
@ -47,9 +47,10 @@ return {
|
||||
-- return { "<C-n>.", ":Neotree toggle reveal_force_cwd<CR>", desc = "Open NeoTree CWD float" }
|
||||
return { "<C-n>m", ":Neotree float git_status<CR>", desc = "Open NeoTree CWD float" }
|
||||
end)(),
|
||||
{ "<C-n>b", ":Neotree float buffers<CR>" },
|
||||
{ "<C-n>", ":Neotree float dir=%:p:h<cr>" },
|
||||
{ "<C-n>.", ":Neotree reveal_force_cwd<CR>", desc = "Open NeoTree CWD float" },
|
||||
-- { "<C-n>b", ":Neotree float buffers<CR>" },
|
||||
-- { "<C-n>", ":Neotree float dir=%:p:h<cr>" },
|
||||
{ "<C-n>", ":Neotree toggle dir=%:p:h<cr>" },
|
||||
-- { "<C-n>.", ":Neotree reveal_force_cwd<CR>", desc = "Open NeoTree CWD float" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ function M.map(mode, lhs, rhs, opts)
|
||||
end
|
||||
|
||||
function M.file_too_large(filename)
|
||||
local max_filesize = 100 * 1024 -- 100 KB
|
||||
local max_filesize = 2000 * 1024 -- 2MB
|
||||
local ok, stats = pcall(vim.loop.fs_stat, filename)
|
||||
if ok and stats and stats.size > max_filesize then
|
||||
return true
|
||||
@ -31,10 +31,6 @@ function M.file_too_large(filename)
|
||||
return false
|
||||
end
|
||||
|
||||
function M.buf_too_large()
|
||||
return M.file_too_large(vim.api.nvim_buf_get_name(vim.api.nvim_get_current_buf()))
|
||||
end
|
||||
|
||||
function M.use_google()
|
||||
if M.use_google_cache == nil then
|
||||
M.use_google_cache = M.file_exists(os.getenv("HOME") .. "/use_google")
|
||||
|
@ -4,7 +4,6 @@
|
||||
# ---------------
|
||||
export PATH=$PATH:/google/src/head/depot/google3/experimental/users/cnieves/util
|
||||
export PATH="${HOME}/.config/lsp/lua-language-server/bin:${PATH}"
|
||||
export XAUTHORITY=~/.Xauthority
|
||||
export GOROOT=/usr/lib/google-golang
|
||||
export PATH=$GOROOT/bin:$PATH
|
||||
export JAVA_HOME=$(readlink -ne /usr/local/buildtools/java/jdk)
|
||||
@ -24,7 +23,6 @@ function gcert() {
|
||||
source /google/bin/releases/knock/knock.sh
|
||||
}
|
||||
|
||||
|
||||
FORTUNES=/google/data/ro/users/di/diamondm/engfortunes/fortune.sh
|
||||
if [ -f "$FORTUNES" ]; then
|
||||
prodcertstatus &> /dev/null && $FORTUNES
|
||||
@ -52,6 +50,8 @@ alias jadep=/google/data/ro/teams/jade/jadep
|
||||
alias replace_string=/google/src/head/depot/google3/devtools/scripts/replace_string
|
||||
alias safergcp=/google/bin/releases/safer-gcp/tools/safergcp
|
||||
alias add_deps_to_usages='/google/src/head/depot/google3/apps/framework/tools/add_deps_to_usages.sh'
|
||||
alias bloaty=/google/bin/releases/protobuf-team/bloaty/bloaty
|
||||
alias bloaty-google3-diff=/google/bin/releases/protobuf-team/bloaty/bloaty-google3-diff
|
||||
alias plxutil='/google/data/ro/teams/plx/plxutil'
|
||||
export HGSHORT_CMDS="cat head tail mv cp rm chmod g4 diff merge patch meld trim less more nvim"
|
||||
export HGSHORT_DIR='/google/src/head/depot/google3/experimental/fig_contrib/hgshort' # default
|
||||
|
@ -1,6 +1,8 @@
|
||||
# set -xv
|
||||
HISTSIZE=10000000
|
||||
SAVEHIST=10000000
|
||||
CASE_SENSITIVE="true" # speeds up tab autocomplete
|
||||
zstyle ':completion:*:hosts' hosts
|
||||
|
||||
alias cd pushd
|
||||
|
||||
@ -34,7 +36,6 @@ zplug "mafredri/zsh-async", from:"github", use:"async.zsh"
|
||||
zplug "zsh-users/zsh-autosuggestions"
|
||||
zplug "zsh-users/zsh-history-substring-search"
|
||||
zplug "modules/command-not-found", from:prezto
|
||||
zplug "modules/completion", from:prezto
|
||||
zplug "romkatv/powerlevel10k", as:theme, depth:1
|
||||
|
||||
# Install plugins if there are plugins that have not been installed
|
||||
|
Reference in New Issue
Block a user