From 55d2488635f81916d092c81e6ec79740f7b45461 Mon Sep 17 00:00:00 2001 From: Saumit Dinesan Date: Wed, 19 Jul 2023 02:14:31 +0530 Subject: nvim: bufferline config changes + options indentfix + keymap changes for nvimtree --- .config/nvim/lua/justsaumit/bufferline-config.lua | 32 +++++++++++------------ .config/nvim/lua/justsaumit/keymaps.lua | 5 ++-- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/.config/nvim/lua/justsaumit/bufferline-config.lua b/.config/nvim/lua/justsaumit/bufferline-config.lua index 493bafc..879c669 100644 --- a/.config/nvim/lua/justsaumit/bufferline-config.lua +++ b/.config/nvim/lua/justsaumit/bufferline-config.lua @@ -1,23 +1,25 @@ ---vim.opt.termguicolors = true - +--Enable true color support for the terminal +vim.opt.termguicolors = true +--Protected call local status, bufferline = pcall(require, "bufferline") if not status then return end -require('bufferline').setup { +bufferline.setup { options = { mode = "buffers", numbers = "none", - close_command = "bdelete! %d", -- can be a string | function, see "Mouse actions" - right_mouse_command = "bdelete! %d", -- can be a string | function, see "Mouse actions" - left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions" - middle_mouse_command = nil, -- can be a string | function, see "Mouse actions" + close_command = "bdelete! %d", + right_mouse_command = "bdelete! %d", + left_mouse_command = "buffer %d", + middle_mouse_command = nil, indicator = { icon = '▎', style = 'icon', }, - buffer_close_icon = '󰠳', + --buffer_close_icon = '󰠳', + buffer_close_icon = "", modified_icon = '●', close_icon = '', -- close_icon = '', @@ -38,15 +40,14 @@ require('bufferline').setup { separator_style = "thin", -- | "thick" | "thin" | slant, enforce_regular_tabs = true, always_show_bufferline = true, - name_formatter = function(buf) -- buf contains a "name", "path" and "bufnr" - -- remove extension from markdown files for example - if buf.name:match('%.md') then - return vim.fn.fnamemodify(buf.name, ':t:r') - end - end + -- name_formatter = function(buf) -- buf contains a "name", "path" and "bufnr" + -- -- remove extension from markdown files for example + -- if buf.name:match('%.md') then + -- return vim.fn.fnamemodify(buf.name, ':t:r') + -- end + -- end } } - local opts = { noremap = true, silent = true } local keymap = vim.keymap.set keymap("", "", "", opts) @@ -68,4 +69,3 @@ keymap("n", "W", ":bdelete!", opts) --Shift+Tab for Backward Cycle keymap("n", "", ":BufferLineCycleNext", opts) keymap("n", "", ":BufferLineCyclePrev", opts) - diff --git a/.config/nvim/lua/justsaumit/keymaps.lua b/.config/nvim/lua/justsaumit/keymaps.lua index ebe355a..582113c 100644 --- a/.config/nvim/lua/justsaumit/keymaps.lua +++ b/.config/nvim/lua/justsaumit/keymaps.lua @@ -32,9 +32,10 @@ vim.cmd([[autocmd BufEnter *.cpp map :w :!g++ % -o %< && ./%< ]]) --Save file with Ctrl+S keymap("n", "", ":w", opts) --Toggle nvim-tree -keymap("n", "", ":NvimTreeToggle", opts) +keymap('n', '', ':NvimTreeToggle', opts) +keymap('n', 'e', ':NvimTreeToggle', opts) --Disable C-e -keymap("n", "", ":", opts) +-- keymap("n", "", ":", opts) -- Better window navigation for split keymap("n", "", "h", opts) -- cgit v1.2.3