From a9e02c662ce087062a653c00c8dec90a9ab4125a Mon Sep 17 00:00:00 2001 From: siduck76 Date: Mon, 8 Mar 2021 10:54:53 +0530 Subject: [PATCH] statusline wip --- init.lua | 1 - lua/pluginsList/lua.lua | 8 +++---- lua/statusline/lua.lua | 49 +++++++++++++++++++++++------------------ lua/utils/lua.lua | 14 ++++++++++++ 4 files changed, 44 insertions(+), 28 deletions(-) diff --git a/init.lua b/init.lua index acbc4b1..09ba2e8 100644 --- a/init.lua +++ b/init.lua @@ -8,7 +8,6 @@ require('bufferline.lua') require('statusline.lua') require('gitsigns.lua') -require('lsp_config.lua') require'colorizer'.setup() diff --git a/lua/pluginsList/lua.lua b/lua/pluginsList/lua.lua index 2d243b3..a246e5f 100644 --- a/lua/pluginsList/lua.lua +++ b/lua/pluginsList/lua.lua @@ -2,13 +2,11 @@ local packer_exists = pcall(vim.cmd, [[packadd packer.nvim]]) return require('packer').startup(function() + use {'wbthomason/packer.nvim', opt = true} use { 'kyazdani42/nvim-web-devicons'} use { 'kyazdani42/nvim-tree.lua'} - use {'neovim/nvim-lspconfig'} - use {'nvim-lua/completion-nvim'} - use {'SirVer/ultisnips'} - use {'hrsh7th/nvim-compe'} - use {'wbthomason/packer.nvim', opt = true} + use { 'hoob3rt/lualine.nvim'} + use { 'neoclide/coc.nvim' , branch = 'release'} use { 'nvim-lua/plenary.nvim'} use { 'lewis6991/gitsigns.nvim'} use { 'glepnir/galaxyline.nvim'} diff --git a/lua/statusline/lua.lua b/lua/statusline/lua.lua index ee5ef6d..86159e4 100644 --- a/lua/statusline/lua.lua +++ b/lua/statusline/lua.lua @@ -22,10 +22,17 @@ local colors = { nordYel = '#EBCB8B' } +gls.left[1] = { + FirstElement = { + provider = function() return '' end, + highlight = { colors.nord, colors.bg } + }, +} + gls.left[2] = { ViMode = { provider = function() - return ' 󰀘 ' + return ' 󰀘 ' end, highlight = {colors.bg,colors.nord}, separator = ' ', @@ -52,6 +59,14 @@ gls.left[4] = { } gls.left[5] = { + rightRounded = { + provider = function() return '' end, + highlight = { colors.lightbg, colors.bg } + }, +} + + +gls.left[6] = { GitIcon = { provider = function() return '  ' end, condition = require('galaxyline.provider_vcs').check_git_workspace, @@ -59,7 +74,7 @@ gls.left[5] = { } } -gls.left[6] = { +gls.left[7] = { GitBranch = { provider = 'GitBranch', condition = require('galaxyline.provider_vcs').check_git_workspace, @@ -134,11 +149,18 @@ gls.left[13] = { } } -gls.right[1]= { + + +gls.right[1] = { + uwu = { + provider = function() return '' end, + highlight = { colors.firored, colors.bg } + }, +} + +gls.right[2]= { FileFormat = { provider = 'FileFormat', - separator = ' ', - separator_highlight = {colors.firored,colors.firored}, highlight = {colors.bg,colors.firored}, } } @@ -151,20 +173,3 @@ gls.right[3] = { highlight = {colors.bg,colors.fg}, } } -gls.short_line_left[1] = { - BufferType = { - provider = 'FileTypeName', - separator = ' ', - separator_highlight = {colors.purple,colors.bg}, - highlight = {colors.fg,colors.purple} - } -} - -gls.short_line_right[1] = { - BufferIcon = { - provider= 'BufferIcon', - separator = ' ', - separator_highlight = {colors.purple,colors.bg}, - highlight = {colors.fg,colors.purple} - } -} diff --git a/lua/utils/lua.lua b/lua/utils/lua.lua index 121b440..d36b260 100644 --- a/lua/utils/lua.lua +++ b/lua/utils/lua.lua @@ -20,3 +20,17 @@ opt('o' , 'cmdheight' , 1) opt('o' , 'updatetime' , 250) opt('o' , 'clipboard' , 'unnamedplus') + +local M = {} + +function M.is_buffer_empty() + -- Check whether the current buffer is empty + return vim.fn.empty(vim.fn.expand('%:t')) == 1 +end + +function M.has_width_gt(cols) + -- Check if the windows width is greater than a given number of columns + return vim.fn.winwidth(0) / 2 > cols +end + +return M