diff options
author | Saumit Dinesan <justsaumit@protonmail.com> | 2023-07-19 02:14:31 +0530 |
---|---|---|
committer | Saumit Dinesan <justsaumit@protonmail.com> | 2023-07-19 02:14:31 +0530 |
commit | 55d2488635f81916d092c81e6ec79740f7b45461 (patch) | |
tree | 4a69c83074f8cd53cb2fcec4ba7ef08513df19a6 | |
parent | cb7bcee2f75e3e078a1776998ff759b1d281d515 (diff) |
nvim: bufferline config changes + options indentfix + keymap changes for nvimtree
-rw-r--r-- | .config/nvim/lua/justsaumit/bufferline-config.lua | 32 | ||||
-rw-r--r-- | .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("", "<Space>", "<Nop>", opts) @@ -68,4 +69,3 @@ keymap("n", "W", ":bdelete!<CR>", opts) --Shift+Tab for Backward Cycle keymap("n", "<Tab>", ":BufferLineCycleNext<CR>", opts) keymap("n", "<S-Tab>", ":BufferLineCyclePrev<CR>", 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 <F4> :w <CR> :!g++ % -o %< && ./%< <CR>]]) --Save file with Ctrl+S keymap("n", "<C-s>", ":w<CR>", opts) --Toggle nvim-tree -keymap("n", "<m-e>", ":NvimTreeToggle<CR>", opts) +keymap('n', '<C-e>', ':NvimTreeToggle<CR>', opts) +keymap('n', '<leader>e', ':NvimTreeToggle<CR>', opts) --Disable C-e -keymap("n", "<c-e>", ":<CR>", opts) +-- keymap("n", "<C-e>", ":<CR>", opts) -- Better window navigation for split keymap("n", "<C-h>", "<C-w>h", opts) |