From eec560c13a0353910f2dc95aabe93c3b642f9e21 Mon Sep 17 00:00:00 2001 From: Nicolai Van der Storm Date: Tue, 24 Oct 2023 12:47:25 +0200 Subject: [PATCH] added bufferline lualine and telescope to nvim --- nix/users/base/neovim/default.nix | 17 +++- nix/users/base/neovim/plugins/bufferline.lua | 26 ++++++ nix/users/base/neovim/plugins/lualine.lua | 92 ++++++++++++++++++++ nix/users/base/neovim/plugins/telescope.lua | 48 ++++++++++ 4 files changed, 182 insertions(+), 1 deletion(-) create mode 100644 nix/users/base/neovim/plugins/bufferline.lua create mode 100644 nix/users/base/neovim/plugins/lualine.lua create mode 100644 nix/users/base/neovim/plugins/telescope.lua diff --git a/nix/users/base/neovim/default.nix b/nix/users/base/neovim/default.nix index a59fb2f..ef8b366 100644 --- a/nix/users/base/neovim/default.nix +++ b/nix/users/base/neovim/default.nix @@ -132,7 +132,22 @@ { plugin = nvim-tree-lua; - config = toLuaFile ./plugins/nvimtree.lua + config = toLuaFile ./plugins/nvimtree.lua; + } + + { + plugin = bufferline-nvim; + config = toLuaFile ./plugins/bufferline.lua; + } + + { + plugin = lualine-nvim; + config = toLuaFile ./plugins/lualine.lua; + } + + { + plugin = telescope-nvim; + config = toLuaFile ./plugins/telescope.lua; } ]; diff --git a/nix/users/base/neovim/plugins/bufferline.lua b/nix/users/base/neovim/plugins/bufferline.lua new file mode 100644 index 0000000..2188e9d --- /dev/null +++ b/nix/users/base/neovim/plugins/bufferline.lua @@ -0,0 +1,26 @@ +local status, plugin = pcall(require,'bufferline') +if not status then + print('Error with plugin: ', plugin) + return +end + +plugin.setup{ + options = { + close_command = "bdelete %d", + right_mouse_command = "bdelete! %d", + left_mouse_command = "buffer %d", + middle_mouse_command = nil, + + indicator = { + style = 'none', + }, + hover = { + enabled = true, + delay = 200, + reveal = {'close'}, + }, + color_icons = true, + numbers = "ordinal", + offsets = {{filetype = "NvimTree", text = "File Explorer", padding = 0 }}, + }, +} \ No newline at end of file diff --git a/nix/users/base/neovim/plugins/lualine.lua b/nix/users/base/neovim/plugins/lualine.lua new file mode 100644 index 0000000..49b6e9f --- /dev/null +++ b/nix/users/base/neovim/plugins/lualine.lua @@ -0,0 +1,92 @@ +local status, plugin = pcall(require,'lualine') +if not status then + print('Error with plugin: ', plugin) + return +end + +local colors = { + darkgray = "#16161d", + gray = "#727169", + innerbg = nil, + outerbg = nil, + normal = "#bd93f9", + insert = "#7e9cd8", + visual = "#ffa066", + replace = "#e46876", + command = "#e6c384", +} +local custom_theme = { + inactive = { + a = { fg = colors.gray, bg = colors.outerbg, gui = "bold" }, + b = { fg = colors.gray, bg = colors.outerbg }, + c = { fg = colors.gray, bg = colors.innerbg }, + }, + visual = { + a = { fg = colors.darkgray, bg = colors.visual, gui = "bold" }, + b = { fg = colors.gray, bg = colors.outerbg }, + c = { fg = colors.gray, bg = colors.innerbg }, + }, + replace = { + a = { fg = colors.darkgray, bg = colors.replace, gui = "bold" }, + b = { fg = colors.gray, bg = colors.outerbg }, + c = { fg = colors.gray, bg = colors.innerbg }, + }, + normal = { + a = { fg = colors.darkgray, bg = colors.normal, gui = "bold" }, + b = { fg = colors.gray, bg = colors.outerbg }, + c = { fg = colors.gray, bg = colors.innerbg }, + }, + insert = { + a = { fg = colors.darkgray, bg = colors.insert, gui = "bold" }, + b = { fg = colors.gray, bg = colors.outerbg }, + c = { fg = colors.gray, bg = colors.innerbg }, + }, + command = { + a = { fg = colors.darkgray, bg = colors.command, gui = "bold" }, + b = { fg = colors.gray, bg = colors.outerbg }, + c = { fg = colors.gray, bg = colors.innerbg }, + }, +} + +plugin.setup { + options = { + icons_enabled = true, + theme = custom_theme, + + component_separators = { '' }, + section_separators = { left = ''}, + disabled_filetypes = { + 'NvimTree', + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + globalstatus = false, + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000, + } + }, + sections = { + lualine_a = {'mode'}, + lualine_b = {'branch', 'diff', 'diagnostics'}, + lualine_c = {'filename'}, + lualine_x = {'encoding', 'fileformat', 'filetype'}, + lualine_y = {'progress'}, + lualine_z = {'location'} + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = {'filename'}, + lualine_x = {'location'}, + lualine_y = {}, + lualine_z = {} + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {} +} \ No newline at end of file diff --git a/nix/users/base/neovim/plugins/telescope.lua b/nix/users/base/neovim/plugins/telescope.lua new file mode 100644 index 0000000..fcfa5bc --- /dev/null +++ b/nix/users/base/neovim/plugins/telescope.lua @@ -0,0 +1,48 @@ +local status, plugin = pcall(require,'telescope') +if not status then + print('Error with plugin: ', plugin) + return +end +plugin.setup{ + defaults = { + -- Default configuration for telescope goes here: + -- config_key = value, + layout_strategy = "vertical", + layout_config = { + height = vim.o.lines, -- maximally available lines + width = vim.o.columns, -- maximally available columns + prompt_position = "top", + preview_height = 0.6, -- 60% of available lines + }, + border = true; + mappings = { + i = { + -- map actions.which_key to (default: ) + -- actions.which_key shows the mappings for your picker, + -- e.g. git_{create, delete, ...}_branch for the git_branches picker + [""] = "which_key" + } + } + }, + pickers = { + find_files = { + file_ignore_patterns = { ".git/", ".undo/",".backup/"}, + }, + live_grep = { + }, + -- Default configuration for builtin pickers goes here: + -- picker_name = { + -- picker_config_key = value, + -- ... + -- } + -- Now the picker_config_key will be applied every time you call this + -- builtin picker + }, + extensions = { + -- Your extension configuration goes here: + -- extension_name = { + -- extension_config_key = value, + -- } + -- please take a look at the readme of the extension you want to configure + } +} \ No newline at end of file