From 539b58d3fb6ca99d8c0f2037a3326be50c3a109d Mon Sep 17 00:00:00 2001 From: Omixxx Date: Sat, 22 Apr 2023 13:25:37 +0200 Subject: [PATCH] update --- init.lua | 6 --- lua/custom/plugins/barbar.lua | 8 +-- lua/custom/plugins/dashboard.lua | 38 ++++++++++++++ lua/custom/plugins/floating_bar.lua | 77 +++++++++++++++++++++++++++++ lua/custom/plugins/startup.lua | 10 ---- 5 files changed, 119 insertions(+), 20 deletions(-) create mode 100644 lua/custom/plugins/dashboard.lua create mode 100644 lua/custom/plugins/floating_bar.lua delete mode 100644 lua/custom/plugins/startup.lua diff --git a/init.lua b/init.lua index 818aff93..7e2c4998 100644 --- a/init.lua +++ b/init.lua @@ -288,12 +288,6 @@ vim.api.nvim_set_keymap('n', '', 'h', { noremap = true, silent = true -- Mappa Ctrl+j per spostarsi in basso nel buffer corrente vim.api.nvim_set_keymap('n', '', 'j', { noremap = true, silent = true }) --- mappatura per spostarsi a sinistra tra le finestre -vim.api.nvim_set_keymap('n', '', ':BufferPrevious', { noremap = true, silent = true }) - --- mappatura per spostarsi a destra tra le finestre -vim.api.nvim_set_keymap('n', '', ':BufferNext', { noremap = true, silent = true }) - -- close the current buffer vim.api.nvim_set_keymap('n', 'cb', ':bd', { noremap = true, silent = true }) diff --git a/lua/custom/plugins/barbar.lua b/lua/custom/plugins/barbar.lua index cbf3e982..4a63aa60 100644 --- a/lua/custom/plugins/barbar.lua +++ b/lua/custom/plugins/barbar.lua @@ -1,4 +1,4 @@ -return { - 'romgrk/barbar.nvim', - dependencies = 'nvim-tree/nvim-web-devicons', -} +-- return { +-- 'romgrk/barbar.nvim', +-- dependencies = 'nvim-tree/nvim-web-devicons', +-- } diff --git a/lua/custom/plugins/dashboard.lua b/lua/custom/plugins/dashboard.lua new file mode 100644 index 00000000..cc2e2fa9 --- /dev/null +++ b/lua/custom/plugins/dashboard.lua @@ -0,0 +1,38 @@ +return { + 'glepnir/dashboard-nvim', + event = 'VimEnter', + config = function() + require('dashboard').setup { + theme = 'hyper', + config = { + week_header = { + enable = true, + }, + shortcut = { + { desc = ' Update', group = '@property', action = 'Lazy update', key = 'u' }, + { + icon = ' ', + icon_hl = '@variable', + desc = 'Files', + group = 'Label', + action = 'Telescope find_files', + key = 'f', + }, + { + desc = ' Apps', + group = 'DiagnosticHint', + action = 'Telescope app', + key = 'a', + }, + { + desc = ' dotfiles', + group = 'Number', + action = 'Telescope dotfiles', + key = 'd', + }, + }, + }, + } + end, + dependencies = { { 'nvim-tree/nvim-web-devicons' } } +} diff --git a/lua/custom/plugins/floating_bar.lua b/lua/custom/plugins/floating_bar.lua new file mode 100644 index 00000000..ce7fb46d --- /dev/null +++ b/lua/custom/plugins/floating_bar.lua @@ -0,0 +1,77 @@ +return { + "ghillb/cybu.nvim", + branch = "main", -- timely updates + -- branch = "v1.x", -- won't receive breaking changes + requires = { "nvim-tree/nvim-web-devicons", "nvim-lua/plenary.nvim" }, -- optional for icon support + config = function() + local ok, cybu = pcall(require, "cybu") + if not ok then + return + end + cybu.setup({ + position = { + relative_to = "win", -- win, editor, cursor + anchor = "topcenter", -- topleft, topcenter, topright, + -- centerleft, center, centerright, + -- bottomleft, bottomcenter, bottomright + vertical_offset = 10, -- vertical offset from anchor in lines + horizontal_offset = 0, -- vertical offset from anchor in columns + max_win_height = 5, -- height of cybu window in lines + max_win_width = 0.5, -- integer for absolute in columns + -- float for relative to win/editor width + }, + style = { + path = "tail", -- absolute, relative, tail (filename only) + path_abbreviation = "none", -- none, shortened + border = "rounded", -- single, double, rounded, none + separator = " ", -- string used as separator + prefix = "…", -- string used as prefix for truncated paths + padding = 1, -- left & right padding in number of spaces + hide_buffer_id = true, -- hide buffer IDs in window + devicons = { + enabled = true, -- enable or disable web dev icons + colored = true, -- enable color for web dev icons + truncate = true, -- truncate wide icons to one char width + }, + highlights = { + -- see highlights via :highlight + current_buffer = "CybuFocus", -- current / selected buffer + adjacent_buffers = "CybuAdjacent", -- buffers not in focus + background = "CybuBackground", -- window background + border = "CybuBorder", -- border of the window + }, + }, + behavior = { + -- set behavior for different modes + mode = { + default = { + switch = "immediate", -- immediate, on_close + view = "paging", -- paging, rolling + }, + last_used = { + switch = "on_close", -- immediate, on_close + view = "paging", -- paging, rolling + }, + auto = { + view = "paging", -- paging, rolling + }, + }, + show_on_autocmd = false, -- event to trigger cybu (eg. "BufEnter") + }, + display_time = 750, -- time the cybu window is displayed + exclude = { -- filetypes, cybu will not be active + "neo-tree", + "fugitive", + "qf", + }, + filter = { + unlisted = true, -- filter & fallback for unlisted buffers + }, + fallback = function() + end, -- arbitrary fallback function + -- used in excluded filetypes + }) + vim.keymap.set("n", "", "(CybuPrev)") + vim.keymap.set("n", "", "(CybuNext)") + end, +} diff --git a/lua/custom/plugins/startup.lua b/lua/custom/plugins/startup.lua deleted file mode 100644 index dbc55660..00000000 --- a/lua/custom/plugins/startup.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - 'glepnir/dashboard-nvim', - event = 'VimEnter', - config = function() - require('dashboard').setup { - -- config - } - end, - dependencies = { { 'nvim-tree/nvim-web-devicons' } } -}