From 76e7e9cb64ecbe265300e3fa714124f16738aba5 Mon Sep 17 00:00:00 2001 From: Hoang Nguyen Date: Mon, 3 Jul 2023 00:00:00 +0700 Subject: [PATCH] nvim: add tabpage for nvim-cokeline --- roles/config/files/nvim/lazy-lock.json | 20 ++++++------- .../nvim/lua/user/plugins/ui/cokeline.lua | 30 ++++++++++++++----- .../files/nvim/lua/user/plugins/util/init.lua | 2 +- roles/config/files/vifm/vifmrc | 2 +- 4 files changed, 35 insertions(+), 19 deletions(-) diff --git a/roles/config/files/nvim/lazy-lock.json b/roles/config/files/nvim/lazy-lock.json index 9288ba1..0890e9d 100644 --- a/roles/config/files/nvim/lazy-lock.json +++ b/roles/config/files/nvim/lazy-lock.json @@ -18,7 +18,7 @@ "dressing.nvim": { "branch": "master", "commit": "e6eff7a5a950a853c3903d906dbcea03f778db5f" }, "emmylua-nvim": { "branch": "master", "commit": "5cff703eefbd210399e76709bc4bbd8f2e64e932" }, "flit.nvim": { "branch": "main", "commit": "5c9a78b97f7f4301473ea5e37501b5b1d4da167b" }, - "friendly-snippets": { "branch": "main", "commit": "1723ae01d83f3b3ac1530f1ae22b7b9d5da7749b" }, + "friendly-snippets": { "branch": "main", "commit": "c85153a188b260b908bc35ffedff64810a930b64" }, "git-conflict.nvim": { "branch": "main", "commit": "3c89812a83ac749b8851a473863958325a1cd57c" }, "gitsigns.nvim": { "branch": "main", "commit": "a36bc3360d584d39b4fb076d855c4180842d4444" }, "headlines.nvim": { "branch": "master", "commit": "ddef41b2664f0ce25fe76520d708e2dc9dfebd70" }, @@ -27,7 +27,7 @@ "indent-blankline.nvim": { "branch": "master", "commit": "7075d7861f7a6bbf0de0298c83f8a13195e6ec01" }, "iswap.nvim": { "branch": "master", "commit": "8213a12857de8d757311b7edc0bf1578e9a58b27" }, "lazy.nvim": { "branch": "main", "commit": "0d61488b89a570415177f75a36ef93616aac6c77" }, - "leap.nvim": { "branch": "main", "commit": "f41de5c1cfeb146e4b8c5ed20e5b32230457ff25" }, + "leap.nvim": { "branch": "main", "commit": "aadf42e0ab97b38715e6233f253cd571dd3bb96c" }, "lsp_lines.nvim": { "branch": "main", "commit": "f53af96d4789eef39a082dbcce078d2bfc384ece" }, "markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" }, "mini.ai": { "branch": "main", "commit": "5218ea75e635df78a807bc9d5a7162594fb76d02" }, @@ -40,15 +40,15 @@ "mini.surround": { "branch": "main", "commit": "9d1956b576d7051da3a483b251dfc778121c60db" }, "neoconf.nvim": { "branch": "main", "commit": "08f146d53e075055500dca35e93281faff95716b" }, "neogen": { "branch": "main", "commit": "1dd0319ccf41b2498f45a3c7607f2ee325ffc6a0" }, - "neogit": { "branch": "master", "commit": "68a3e90e9d1ed9e362317817851d0f34b19e426b" }, + "neogit": { "branch": "master", "commit": "497f65529a8f3ebc0fa17cc12d678e2600a9f4fb" }, "neotest": { "branch": "master", "commit": "e46eae5739c470aa011ee43108ea8a730736174e" }, - "neotest-go": { "branch": "main", "commit": "4e7a87967e45f2b357fd546b0b7877774191772e" }, + "neotest-go": { "branch": "main", "commit": "05535cb2cfe3ce5c960f65784896d40109572f89" }, "neotest-python": { "branch": "master", "commit": "6c06041cfb45f45e276068020baa06c06fe20d5c" }, "noice.nvim": { "branch": "main", "commit": "6c87c1d11c38180fb72bf8f45518a0a3e081afc1" }, "nui.nvim": { "branch": "main", "commit": "d146966a423e60699b084eeb28489fe3b6427599" }, "null-ls.nvim": { "branch": "main", "commit": "aac27a1fa550de3d0b2c651168167cc0d5366a9a" }, "nvim-cmp": { "branch": "main", "commit": "2743dd989e9b932e1b4813a4927d7b84272a14e2" }, - "nvim-cokeline": { "branch": "main", "commit": "8e8f9f9c4d4fa756b3f7f116e10df8756c8177a9" }, + "nvim-cokeline": { "branch": "main", "commit": "a7efa64386467114e386a0f19f4a6086a5650010" }, "nvim-coverage": { "branch": "main", "commit": "8fcc71e01e93f305e334b59f902e545a70d0050f" }, "nvim-dap": { "branch": "master", "commit": "bb1ddce6cd951ef3c1319e4fd8596131113163c3" }, "nvim-dap-ui": { "branch": "master", "commit": "c020f660b02772f9f3d11f599fefad3268628a9e" }, @@ -56,9 +56,9 @@ "nvim-navic": { "branch": "master", "commit": "32cff45f1c84bec5e2a7bf15c0f3c6739b64c85d" }, "nvim-notify": { "branch": "master", "commit": "ea9c8ce7a37f2238f934e087c255758659948e0f" }, "nvim-scrollbar": { "branch": "main", "commit": "35f99d559041c7c0eff3a41f9093581ceea534e8" }, - "nvim-spectre": { "branch": "master", "commit": "6e9dfd6f0ad24074ba03fe420b2b5c59075bc205" }, - "nvim-tree.lua": { "branch": "master", "commit": "1fe32286db79719dd6e52236f82c5b52df3ccaa9" }, - "nvim-treesitter": { "branch": "master", "commit": "3fde1587d0850d46b5a1473e5d1e59254e947496" }, + "nvim-spectre": { "branch": "master", "commit": "dc3f0bd41e09148924ef04a4746cb708539d08db" }, + "nvim-tree.lua": { "branch": "master", "commit": "4af572246ce49883e2a52c49203a19984454f2e0" }, + "nvim-treesitter": { "branch": "master", "commit": "c42a8f96d37be82cf32934c4351150d7736f93f5" }, "nvim-treesitter-context": { "branch": "master", "commit": "63f3ffc50b0afc59be1015153d00922498085be8" }, "nvim-treesitter-refactor": { "branch": "master", "commit": "65ad2eca822dfaec2a3603119ec3cc8826a7859e" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "52f1f3280d9092bfaee5c45be5962fabee3d9654" }, @@ -77,11 +77,11 @@ "sniprun": { "branch": "master", "commit": "28d55eeb6786a7037fd3564ced8296a71f1cece7" }, "ssr.nvim": { "branch": "main", "commit": "e5768511518a397fa712f26389ba30d0404990de" }, "stickybuf.nvim": { "branch": "master", "commit": "771caf43582ecddef90a17f7a07f234cfee01005" }, - "telescope-file-browser.nvim": { "branch": "master", "commit": "721f716f7392284ded78b4867fa67cf4b0605945" }, + "telescope-file-browser.nvim": { "branch": "master", "commit": "e03ff55962417b69c85ef41424079bb0580546ba" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" }, "telescope-symbols.nvim": { "branch": "master", "commit": "f2060117d965df4a626f068a4ebbd8ee051aa076" }, "telescope-tabs": { "branch": "master", "commit": "4e5c56ad020f2204d39c5d0a4775cc1bd2897041" }, - "telescope.nvim": { "branch": "master", "commit": "c5b11f4fe780f4acd6ed0d58575d3cb7af3e893a" }, + "telescope.nvim": { "branch": "master", "commit": "0e0600908d1ad5ac4992fa0ab578e23e9d9d6f37" }, "todo-comments.nvim": { "branch": "main", "commit": "09b0b17d824d2d56f02ff15967e8a2499a89c731" }, "toggleterm.nvim": { "branch": "main", "commit": "4cac5c96445df3a97f162a0f810e38fde1eb525e" }, "treesj": { "branch": "main", "commit": "3203aa553217921fd4dcb79245f9df07278910b2" }, diff --git a/roles/config/files/nvim/lua/user/plugins/ui/cokeline.lua b/roles/config/files/nvim/lua/user/plugins/ui/cokeline.lua index 61df843..0884d5c 100644 --- a/roles/config/files/nvim/lua/user/plugins/ui/cokeline.lua +++ b/roles/config/files/nvim/lua/user/plugins/ui/cokeline.lua @@ -1,5 +1,4 @@ local colors = require('user.themes.' .. vim.g.colors_name .. '.colors') -local get_hex = require('cokeline.utils').get_hex local mappings = require('cokeline.mappings') local components = { @@ -7,7 +6,7 @@ local components = { text = function(buffer) return buffer.index ~= 1 and '┃' or '' end, - fg = colors.cyan, + fg = 'TabLineSel', truncation = { priority = 2 }, }, space = { text = ' ', truncation = { priority = 2 } }, @@ -33,7 +32,7 @@ local components = { text = function(buffer) return buffer.unique_prefix end, - fg = get_hex('Comment', 'fg'), + fg = 'Comment', style = 'italic', truncation = { priority = 4, direction = 'left' }, }, @@ -58,7 +57,7 @@ local components = { return buffer.is_modified and ' ' or ' ' end, fg = function(buffer) - return buffer.is_modified and colors.green or get_hex('Comment', 'fg') + return buffer.is_modified and colors.green or 'Comment' end, delete_buffer_on_left_click = true, truncation = { priority = 3 }, @@ -92,10 +91,11 @@ local right_padding = { return { default_hl = { fg = function(buffer) - return buffer.is_focused and get_hex('Normal', 'fg') or get_hex('Comment', 'fg') + return buffer.is_focused and 'Normal' or 'Comment' end, bg = 'NONE', }, + fill_hl = 'TabLineFill', rendering = { max_buffer_width = buffer_width }, components = { components.separator, @@ -108,11 +108,27 @@ return { right_padding, components.close_or_modified, }, + tabs = { + placement = 'left', + components = { + { + text = function(tabpage) + return string.format(" %s ", tabpage.number) + end, + on_click = function(_, _, _, _, tabpage) + tabpage:focus() + end, + highlight = function(tabpage) + return tabpage.is_active and 'TabLineSel' or 'TabLine' + end, + truncation = { priority = 2 }, + }, + }, + }, rhs = { { text = '  ' .. vim.fn.fnamemodify(vim.fn.getcwd(), ':t') .. ' ', - fg = get_hex('TabLineSel', 'fg'), - bg = get_hex('TabLineSel', 'bg'), + highlight = 'TabLineSel', truncation = { priority = 2 }, }, }, diff --git a/roles/config/files/nvim/lua/user/plugins/util/init.lua b/roles/config/files/nvim/lua/user/plugins/util/init.lua index 2b6f7c2..5eb8057 100644 --- a/roles/config/files/nvim/lua/user/plugins/util/init.lua +++ b/roles/config/files/nvim/lua/user/plugins/util/init.lua @@ -165,7 +165,7 @@ return { opts = { get_auto_pin = require('user.plugins.util.stickybuf') }, }, { - 'TimUntersberger/neogit', + 'NeogitOrg/neogit', cmd = 'Neogit', keys = { {'go', 'Neogit', desc = 'Neogit' }, diff --git a/roles/config/files/vifm/vifmrc b/roles/config/files/vifm/vifmrc index a08a7a7..d0891df 100644 --- a/roles/config/files/vifm/vifmrc +++ b/roles/config/files/vifm/vifmrc @@ -498,7 +498,7 @@ set classify+=' ::*.exs,,*.ex::' set classify+=' ::*.ai::' set classify+=' ::*.psb,,*.psd::' set classify+=' ::*.aac,,*.anx,,*.asf,,*.au,,*.axa,,*.flac,,*.m2a,,*.m4a,,*.mid,,*.midi,,*.mp3,,*.mpc,,*.oga,,*.ogg,,*.ogx,,*.ra,,*.ram,,*.rm,,*.spx,,*.wav,,*.wma,,*.ac3::' -set classify+=' ::*.avi,,*.flv,,*.mkv,,*.mov,,*.mp4,,*.mpeg,,*.mpg,,*.webm::' +set classify+=' ::*.avi,,*.flv,,*.mkv,,*.mov,,*.mp4,,*.mpeg,,*.mpg,,*.webm::' set classify+=' ::*.epub,,*.pdf,,*.fb2,,*.djvu::' set classify+=' ::*.7z,,*.apk,,*.bz2,,*.cab,,*.cpio,,*.deb,,*.gem,,*.gz,,*.gzip,,*.lh,,*.lzh,,*.lzma,,*.rar,,*.rpm,,*.tar,,*.tgz,,*.xz,,*.zip,,*.zst::' set classify+=' ::*.cbr,,*.cbz::'