statusline wip

This commit is contained in:
siduck76 2021-03-08 10:54:53 +05:30
parent ab3a365450
commit a9e02c662c
4 changed files with 44 additions and 28 deletions

View file

@ -8,7 +8,6 @@ require('bufferline.lua')
require('statusline.lua')
require('gitsigns.lua')
require('lsp_config.lua')
require'colorizer'.setup()

View file

@ -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'}

View file

@ -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}
}
}

View file

@ -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