From 5550001acf0b0dbe1a26cfbaecd644d8cba8206d Mon Sep 17 00:00:00 2001 From: Michael Peters Date: Fri, 30 Sep 2022 10:30:39 -0700 Subject: [PATCH] fix bufferline colors, add :Black and :IPDB --- init.lua | 1 + lua/commands.lua | 6 +++ lua/configs/bufferline.lua | 88 ++++++++++++++++++++------------------ lua/keybinds.lua | 2 +- 4 files changed, 55 insertions(+), 42 deletions(-) create mode 100644 lua/commands.lua diff --git a/init.lua b/init.lua index 608cad5..9844ac6 100644 --- a/init.lua +++ b/init.lua @@ -2,6 +2,7 @@ require('plugins') require('settings') require('keybinds') +require('commands') require('cmds') require('highlights') diff --git a/lua/commands.lua b/lua/commands.lua new file mode 100644 index 0000000..1f552a4 --- /dev/null +++ b/lua/commands.lua @@ -0,0 +1,6 @@ +-- Make it easier to run black +vim.api.nvim_create_user_command('Black', 'call Black()', {}) + +-- Insert IPDB statement +vim.api.nvim_create_user_command('IPDB', 'norm oimport ipdb; ipdb.set_trace() # fmt:skip', {}) + diff --git a/lua/configs/bufferline.lua b/lua/configs/bufferline.lua index 85df8e4..de9fc4d 100644 --- a/lua/configs/bufferline.lua +++ b/lua/configs/bufferline.lua @@ -8,13 +8,14 @@ function M.config() -- Semantic Colors local scolors = { - empty_fg = '#ced2dc', + white_fg = '#ced2dc', + + tab_visible_bg = '#404040', + tab_bg = '#353535', empty_bg = '#252526', - tab_fg = '#ced2dc', - tab_bg = '#303030', - selected_fg = '#ced2dc', - selected_bg = '#404040', + green = '#6a9955', + yellow = '#d8b92d', red = '#d16969', none = 'NONE', } @@ -24,16 +25,16 @@ function M.config() close_command = "Bdelete! %d", -- use vim-bbye right_mouse_command = "Bdelete! %d", -- use vim-bbye offsets = { - { - filetype = "NvimTree", - text = "", - padding = 1 - } - }, - indicator = { - icon = '▎', - style = 'icon' - }, + { + filetype = "NvimTree", + text = "", + padding = 1 + } + }, + indicator = { + icon = '▎', + style = 'icon' + }, modified_icon = "", --buffer_close_icon = "", show_buffer_close_icons = false, @@ -53,20 +54,24 @@ function M.config() }, highlights = { + fill = { + fg = scolors.white_fg, + bg = scolors.empty_bg, + }, background = { - fg = scolors.tab_fg, + fg = scolors.white_fg, bg = scolors.tab_bg, }, -- Buffers buffer_selected = { - fg = scolors.selected_fg, - bg = scolors.selected_bg, + fg = scolors.white_fg, + bg = scolors.tab_visible_bg, --gui = colors.none, }, buffer_visible = { - fg = scolors.selected_fg, - bg = scolors.selected_bg, + fg = scolors.white_fg, + bg = scolors.tab_visible_bg, }, -- Diagnostics @@ -81,38 +86,39 @@ function M.config() -- Close buttons close_button = { - fg = scolors.tab_fg, + fg = scolors.white_fg, bg = scolors.tab_bg, }, close_button_visible = { - fg = scolors.selected_fg, - bg = scolors.selected_bg, + fg = scolors.white_fg, + bg = scolors.tab_visible_bg, }, close_button_selected = { fg = scolors.red, - bg = scolors.selected_bg, - }, - fill = { - fg = scolors.empty_fg, - bg = scolors.empty_bg, + bg = scolors.tab_visible_bg, }, + + -- Open buffer indicator indicator_selected = { fg = scolors.green, - bg = scolors.selected_bg, + bg = scolors.tab_visible_bg, + }, + indicator_visible = { + bg = scolors.tab_visible_bg, }, -- Modified modified = { - fg = scolors.red, + fg = scolors.yellow, bg = scolors.tab_bg, }, modified_visible = { - fg = scolors.tab_fg, - bg = scolors.tab_bg, + fg = scolors.yellow, + bg = scolors.tab_visible_bg, }, modified_selected = { - fg = scolors.green, - bg = scolors.selected_bg, + fg = scolors.yellow, + bg = scolors.tab_visible_bg, }, -- Separators @@ -122,25 +128,25 @@ function M.config() }, separator_visible = { fg = scolors.empty_bg, - bg = scolors.selected_bg, + bg = scolors.tab_visible_bg, }, separator_selected = { fg = scolors.empty_bg, - bg = scolors.selected_bg, + bg = scolors.tab_visible_bg, }, -- Tabs tab = { - fg = scolors.tab_fg, + fg = scolors.white_fg, bg = scolors.tab_bg, }, tab_selected = { - fg = scolors.selected_fg, - bg = scolors.selected_bg, + fg = scolors.white_fg, + bg = scolors.tab_visible_bg, }, tab_close = { - fg = scolors.selected_fg, - bg = scolors.selected_bg, + fg = scolors.white_fg, + bg = scolors.tab_visible_bg, }, } } diff --git a/lua/keybinds.lua b/lua/keybinds.lua index f8107ee..4eecaf7 100644 --- a/lua/keybinds.lua +++ b/lua/keybinds.lua @@ -47,7 +47,7 @@ map("n", "ff", "Telescope find_files", opts) map("n", "fw", "Telescope live_grep", opts) map("n", "fb", "Telescope buffers", opts) map("n", "fh", "Telescope help_tags", opts) -map("n", "fo", "Telescope oldfiles", opts) -- This wasn't working for some reason in astrovim +map("n", "fo", "Telescope oldfiles", opts) -- This works for me now :) map("n", "fs", "Telescope git_status", opts) map("n", "fc", "Telescope git_commits", opts)