From a7053d63f01fca00385d60a2e9c80c2ed604f3a6 Mon Sep 17 00:00:00 2001 From: 409 Date: Mon, 8 Jan 2024 15:21:49 +0100 Subject: [PATCH] added lualine --- after/plugin/lualine.lua | 40 +++++++++++++++++++++++++ after/plugin/telescope.lua | 8 ++++- lua/409/packer.lua | 61 +++++++++++++++++++++----------------- plugin/packer_compiled.lua | 11 +++++++ 4 files changed, 91 insertions(+), 29 deletions(-) create mode 100644 after/plugin/lualine.lua diff --git a/after/plugin/lualine.lua b/after/plugin/lualine.lua new file mode 100644 index 0000000..a51b983 --- /dev/null +++ b/after/plugin/lualine.lua @@ -0,0 +1,40 @@ +require('lualine').setup { + options = { + icons_enabled = true, + theme = 'auto', + component_separators = { left = '', right = '' }, + section_separators = { left = '', right = '' }, + disabled_filetypes = { + 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 = {} +} diff --git a/after/plugin/telescope.lua b/after/plugin/telescope.lua index f4079bb..22bec77 100755 --- a/after/plugin/telescope.lua +++ b/after/plugin/telescope.lua @@ -2,6 +2,12 @@ local builtin = require('telescope.builtin') vim.keymap.set("n", "pf", builtin.find_files, {}) vim.keymap.set("n", "", builtin.git_files, {}) vim.keymap.set("n", "ps", function() - builtin.grep_string({ search = vim.fn.input("Grep > ") }); + local status, result = pcall(function() vim.fn.input("Grep > ") end) + -- prevent keyboard interrupt error + if not status then + return + end + + builtin.grep_string({ search = result }); end) vim.api.nvim_set_hl(0, "TelescopeSelection", { link = "Visual" }) diff --git a/lua/409/packer.lua b/lua/409/packer.lua index fcd6143..4cd9e6a 100755 --- a/lua/409/packer.lua +++ b/lua/409/packer.lua @@ -1,50 +1,55 @@ vim.cmd.packadd('packer.nvim') return require('packer').startup(function(use) - use 'wbthomason/packer.nvim' + use 'wbthomason/packer.nvim' - use 'nvim-lua/plenary.nvim' + use 'nvim-lua/plenary.nvim' use { 'christoomey/vim-tmux-navigator', lazy = false } - use { - 'nvim-telescope/telescope.nvim', - requires = { {'nvim-lua/plenary.nvim'} } - } + use { + 'nvim-telescope/telescope.nvim', + requires = { { 'nvim-lua/plenary.nvim' } } + } use { "catppuccin/nvim", as = "catppuccin" } - use('nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' }) + use('nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' }) use('nvim-treesitter/nvim-tree-docs') - use{ - 'ThePrimeagen/harpoon', - branch = 'harpoon2', - requires = { { 'nvim-lua/plenary.nvim' } } - } + use { + 'ThePrimeagen/harpoon', + branch = 'harpoon2', + requires = { { 'nvim-lua/plenary.nvim' } } + } - use('mbbill/undotree') - use('tpope/vim-fugitive') + use('mbbill/undotree') + use('tpope/vim-fugitive') - use { - 'VonHeikemen/lsp-zero.nvim', - branch = 'v3.x', - requires = { - {'williamboman/mason.nvim'}, - {'williamboman/mason-lspconfig.nvim'}, + use { + 'nvim-lualine/lualine.nvim', + requires = { 'nvim-tree/nvim-web-devicons', opt = true } + } - -- LSP Support - {'neovim/nvim-lspconfig'}, - -- Autocompletion - {'hrsh7th/nvim-cmp'}, - {'hrsh7th/cmp-nvim-lsp'}, - {'L3MON4D3/LuaSnip'}, - } - } + use { + 'VonHeikemen/lsp-zero.nvim', + branch = 'v3.x', + requires = { + { 'williamboman/mason.nvim' }, + { 'williamboman/mason-lspconfig.nvim' }, + + -- LSP Support + { 'neovim/nvim-lspconfig' }, + -- Autocompletion + { 'hrsh7th/nvim-cmp' }, + { 'hrsh7th/cmp-nvim-lsp' }, + { 'L3MON4D3/LuaSnip' }, + } + } end) diff --git a/plugin/packer_compiled.lua b/plugin/packer_compiled.lua index b711478..baaf46a 100644 --- a/plugin/packer_compiled.lua +++ b/plugin/packer_compiled.lua @@ -99,6 +99,11 @@ _G.packer_plugins = { path = "/home/j409/.local/share/nvim/site/pack/packer/start/lsp-zero.nvim", url = "https://github.com/VonHeikemen/lsp-zero.nvim" }, + ["lualine.nvim"] = { + loaded = true, + path = "/home/j409/.local/share/nvim/site/pack/packer/start/lualine.nvim", + url = "https://github.com/nvim-lualine/lualine.nvim" + }, ["mason-lspconfig.nvim"] = { loaded = true, path = "/home/j409/.local/share/nvim/site/pack/packer/start/mason-lspconfig.nvim", @@ -129,6 +134,12 @@ _G.packer_plugins = { path = "/home/j409/.local/share/nvim/site/pack/packer/start/nvim-treesitter", url = "https://github.com/nvim-treesitter/nvim-treesitter" }, + ["nvim-web-devicons"] = { + loaded = false, + needs_bufread = false, + path = "/home/j409/.local/share/nvim/site/pack/packer/opt/nvim-web-devicons", + url = "https://github.com/nvim-tree/nvim-web-devicons" + }, ["packer.nvim"] = { loaded = true, path = "/home/j409/.local/share/nvim/site/pack/packer/start/packer.nvim",