From 9c088e3cc61bedd45eb32dd83571ecf9250268cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Duarte=20Buchweitz?= Date: Mon, 23 Sep 2024 15:20:39 -0300 Subject: [PATCH] tmux bufferline --- init.lua | 6 ++- lua/kickstart/plugins/bufferline.lua | 59 ++++++++++++++++++++++++++++ lua/kickstart/plugins/tmux.lua | 7 ++++ 3 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 lua/kickstart/plugins/bufferline.lua create mode 100644 lua/kickstart/plugins/tmux.lua diff --git a/init.lua b/init.lua index d5c38808..80654f85 100644 --- a/init.lua +++ b/init.lua @@ -84,6 +84,8 @@ I hope you enjoy your Neovim journey, P.S. You can delete this when you're done too. It's your config now! :) --]] +vim.opt.termguicolors = true + -- Set as the leader key -- See `:help mapleader` -- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) @@ -868,7 +870,7 @@ require('lazy').setup({ -- Load the colorscheme here. -- Like many other themes, this one has different styles, and you could load -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. - vim.cmd.colorscheme 'tokyonight-night' + vim.cmd.colorscheme 'tokyonight-moon' -- You can configure highlights by doing something like: vim.cmd.hi 'Comment gui=none' @@ -959,6 +961,8 @@ require('lazy').setup({ require 'kickstart.plugins.go', require 'kickstart.plugins.trouble', require 'kickstart.plugins.nvim-dap-virtual-text', + require 'kickstart.plugins.bufferline', + require 'kickstart.plugins.tmux', -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- This is the easiest way to modularize your config. diff --git a/lua/kickstart/plugins/bufferline.lua b/lua/kickstart/plugins/bufferline.lua new file mode 100644 index 00000000..160b7240 --- /dev/null +++ b/lua/kickstart/plugins/bufferline.lua @@ -0,0 +1,59 @@ +return { + { + 'akinsho/bufferline.nvim', + version = '*', + requires = 'kyazdani42/nvim-web-devicons', -- certifique-se de que 'requires' esteja correto + config = function() + local bufferline = require 'bufferline' -- Ajuste aqui: defina 'bufferline' corretamente + bufferline.setup { + options = { + mode = 'buffers', + style_preset = 'default', -- 'default' é uma string aqui, sem necessidade do bufferline.style_preset + themable = true, + numbers = 'none', + close_command = 'bdelete! %d', + right_mouse_command = 'bdelete! %d', + left_mouse_command = 'buffer %d', + middle_mouse_command = nil, + indicator = { + icon = '▎', + style = 'icon', + }, + hover = { + enabled = true, + delay = 200, + reveal = { 'close' }, + }, + buffer_close_icon = '󰅖', + modified_icon = '●', + close_icon = '', + left_trunc_marker = '', + right_trunc_marker = '', + name_formatter = function(buf) -- altere ou mantenha conforme necessário + -- seu código de formatação aqui + end, + max_name_length = 18, + max_prefix_length = 15, + truncate_names = true, + tab_size = 18, + diagnostics = 'nvim_lsp', + diagnostics_indicator = function(count, level) + local icon = level:match 'error' and ' ' or '' + return ' ' .. icon .. count + end, + -- e assim por diante para as outras opções... + -- Coloque suas demais configurações aqui + }, + } + + -- Agora adicionamos os mapeamentos de teclas + local map = vim.api.nvim_set_keymap + local opts = { noremap = true, silent = true } + + map('n', 'bp', ':BufferLinePick', opts) + map('n', 'bc', ':BufferLinePickClose', opts) + map('n', '', ':BufferLineCycleNext', { noremap = true, silent = true }) + map('n', '', ':BufferLineCyclePrev', { noremap = true, silent = true }) + end, + }, +} diff --git a/lua/kickstart/plugins/tmux.lua b/lua/kickstart/plugins/tmux.lua new file mode 100644 index 00000000..dc206988 --- /dev/null +++ b/lua/kickstart/plugins/tmux.lua @@ -0,0 +1,7 @@ +return { + + { + 'christoomey/vim-tmux-navigator', + config = function() end, + }, +}