From 3fa3c62ab3439bffacea380631e5e2e4c5a67fcb Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Sun, 21 Jul 2024 19:42:12 +0800 Subject: Update --- vim/mini.lua | 143 +++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 96 insertions(+), 47 deletions(-) (limited to 'vim/mini.lua') diff --git a/vim/mini.lua b/vim/mini.lua index 7b44fc0..f550440 100644 --- a/vim/mini.lua +++ b/vim/mini.lua @@ -12,47 +12,9 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then end vim.opt.rtp:prepend(lazypath) -- }}} +vim.g.base46_cache = vim.fn.stdpath "data" .. "/nvchad/base46/" require("lazy").setup ({ "tpope/vim-sleuth", - -- bufferline {{{ - { - "akinsho/bufferline.nvim", - dependencies = { - 'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons - "tiagovla/scope.nvim", - }, - config = function() - require("bufferline").setup{ - options = { - tab_size = 14, - separator_style = { '', '' }, - themable = true, - buffer_close_icon = '', - close_icon = '', - groups = { - items = { - require('bufferline.groups').builtin.pinned:with({ icon = "󰐃" }) - } - } - }, - } - require("scope").setup{} - -- keymaps {{{ - for i = 1, 9, 1 do - vim.keymap.set("n", string.format("", i), function() - vim.cmd("BufferLineGoToBuffer "..i) - end, {silent = true}) - end - local opts = { noremap = true, silent = true } - vim.keymap.set('n', '', 'BufferLineCyclePrev', opts) - vim.keymap.set('n', '', 'BufferLineCycleNext', opts) - vim.keymap.set('n', '', 'BufferLineMovePrev', opts) - vim.keymap.set('n', '', 'BufferLineMoveNext', opts) - vim.keymap.set('n', '', 'BufferLineTogglePin', opts) - end, - -- }}} - }, - -- }}} -- conform {{{ { "stevearc/conform.nvim", @@ -67,16 +29,15 @@ require("lazy").setup ({ }, -- }}} -- Telescope {{{ - { - "nvim-telescope/telescope-fzf-native.nvim", - build = "make", - }, { "nvim-telescope/telescope.nvim", lazy = false, dependencies = { 'nvim-lua/plenary.nvim', - "nvim-telescope/telescope-fzf-native.nvim", + { + "nvim-telescope/telescope-fzf-native.nvim", + build = "make", + }, }, config = function() -- extensions {{{ @@ -387,6 +348,50 @@ require("lazy").setup ({ end, }, --}}} +-- Nvchad {{{ + { + "NvChad/NvChad", + lazy = false, + branch = "v2.5", + dependencies = { + "Nvchad/base46", + "Nvchad/ui", + } + }, +-- }}} +-- nvim-cmp {{{ + { + "hrsh7th/nvim-cmp", + event = "InsertEnter", + dependencies = { + { + -- snippet plugin + "L3MON4D3/LuaSnip", + dependencies = "rafamadriz/friendly-snippets", + opts = { history = true, updateevents = "TextChanged,TextChangedI" }, + config = function(_, opts) + require("luasnip").config.set_config(opts) + require "nvchad.configs.luasnip" + end, + }, + + -- cmp sources plugins + { + "saadparwaiz1/cmp_luasnip", + "hrsh7th/cmp-nvim-lua", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + }, + }, + opts = function() + return require "nvchad.configs.cmp" + end, + config = function(_, opts) + require("cmp").setup(opts) + end, + }, +-- }}} }) -- Install mini.nvim {{{ @@ -564,6 +569,13 @@ require('mini.diff').setup({ priority = 199, }, }) + +vim.keymap.set( 'n', '\\gh', function() + MiniDiff.toggle_overlay() + end, + { buffer = bufnr, desc = 'Toggle diff' } +) + -- }}} -- mini.map {{{ require('mini.map').setup() @@ -577,9 +589,6 @@ end, { buffer = bufnr, desc = '' } ) -- }}} --- mini.completion {{{ -require('mini.completion').setup() --- }}} -- mini.surround {{{ require('mini.surround').setup { mappings = { @@ -617,6 +626,9 @@ vim.keymap.set( 'n', 'hi', function()MiniHipatterns.toggle() end -- mini.pairs {{{ require('mini.pairs').setup() -- }}} +-- -- mini.completion {{{ +-- require('mini.completion').setup() +-- -- }}} -- -- mini.tabline {{{ -- -- require('mini.tabline').setup { @@ -694,3 +706,40 @@ add { } vim.keymap.set("n", "z", ":TZAtaraxis") -- }}} +-- bufferline {{{ +add { + source = "akinsho/bufferline.nvim", + depends = { + 'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons + "tiagovla/scope.nvim", + }, +} +require("bufferline").setup{ + options = { + tab_size = 14, + separator_style = { '', '' }, + themable = true, + buffer_close_icon = '', + close_icon = '', + groups = { + items = { + require('bufferline.groups').builtin.pinned:with({ icon = "󰐃" }) + } + } + }, +} +require("scope").setup{} +-- keymaps {{{ +for i = 1, 9, 1 do + vim.keymap.set("n", string.format("", i), function() + vim.cmd("BufferLineGoToBuffer "..i) + end, {silent = true}) +end +local opts = { noremap = true, silent = true } +vim.keymap.set('n', '', 'BufferLineCyclePrev', opts) +vim.keymap.set('n', '', 'BufferLineCycleNext', opts) +vim.keymap.set('n', '', 'BufferLineMovePrev', opts) +vim.keymap.set('n', '', 'BufferLineMoveNext', opts) +vim.keymap.set('n', '', 'BufferLineTogglePin', opts) +-- }}} +-- }}} -- cgit v1.2.3-70-g09d2