diff options
Diffstat (limited to 'vim/mini.lua')
-rw-r--r-- | vim/mini.lua | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/vim/mini.lua b/vim/mini.lua index 799f638..d449bf7 100644 --- a/vim/mini.lua +++ b/vim/mini.lua | |||
@@ -429,6 +429,7 @@ require("lazy").setup({ | |||
429 | } | 429 | } |
430 | }, | 430 | }, |
431 | custom_filter = function (buf_number) | 431 | custom_filter = function (buf_number) |
432 | if vim.t.bufs == nil then return false end | ||
432 | for _, p in ipairs(vim.t.bufs) do | 433 | for _, p in ipairs(vim.t.bufs) do |
433 | if p == buf_number then | 434 | if p == buf_number then |
434 | return true | 435 | return true |
@@ -562,6 +563,13 @@ require("lazy").setup({ | |||
562 | -- config {{{ | 563 | -- config {{{ |
563 | require("telescope").setup({ | 564 | require("telescope").setup({ |
564 | defaults = { | 565 | defaults = { |
566 | preview = { | ||
567 | filesize_hook = function(filepath, bufnr, opts) | ||
568 | local max_bytes = 100000 | ||
569 | local cmd = {"head", "-c", max_bytes, filepath} | ||
570 | require('telescope.previewers.utils').job_maker(cmd, bufnr, opts) | ||
571 | end | ||
572 | }, | ||
565 | mappings = { | 573 | mappings = { |
566 | i = { | 574 | i = { |
567 | -- ["<c-j>"] = "move_selection_next", | 575 | -- ["<c-j>"] = "move_selection_next", |
@@ -1046,14 +1054,21 @@ require("lazy").setup({ | |||
1046 | ensure_installed = { "markdown", "markdown_inline", "lua", "luadoc", "printf", "vim", "vimdoc" }, | 1054 | ensure_installed = { "markdown", "markdown_inline", "lua", "luadoc", "printf", "vim", "vimdoc" }, |
1047 | 1055 | ||
1048 | highlight = { | 1056 | highlight = { |
1049 | enable = true, | 1057 | enable = false, |
1050 | use_languagetree = true, | ||
1051 | additional_vim_regex_highlighting = true, | 1058 | additional_vim_regex_highlighting = true, |
1059 | use_languagetree = true, | ||
1060 | disable = function(lang, buf) | ||
1061 | local max_filesize = 100 * 1024 -- 100 KB | ||
1062 | local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) | ||
1063 | if ok and stats and stats.size > max_filesize then | ||
1064 | return true | ||
1065 | end | ||
1066 | end, | ||
1052 | }, | 1067 | }, |
1053 | 1068 | ||
1054 | indent = { enable = true }, | 1069 | indent = { enable = true }, |
1055 | }) | 1070 | }) |
1056 | vim.cmd([[ | 1071 | vim.cmd([[ |
1057 | syn match MarkdownHtmlDetails '^<details>' conceal cchar=▶ | 1072 | syn match MarkdownHtmlDetails '^<details>' conceal cchar=▶ |
1058 | syn match MarkdownHtmlSummary '<summary>' conceal cchar= | 1073 | syn match MarkdownHtmlSummary '<summary>' conceal cchar= |
1059 | syn match MarkdownHtmlSummaryEnd '</summary>' conceal | 1074 | syn match MarkdownHtmlSummaryEnd '</summary>' conceal |