From b6d268cc4e447dae2bb57e68f3175d15d53fb30c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=88=D0=BE=D0=B2=D0=B0=D0=BD=20=D0=82=D0=BE=D0=BA=D0=B8?=
 =?UTF-8?q?=D1=9B-=D0=A8=D1=83=D0=BC=D0=B0=D1=80=D0=B0=D1=86?=
 <sumarac@protonmail.com>
Date: Tue, 8 Aug 2023 20:41:14 +0200
Subject: [PATCH] Removed noice, nomodoro, neorg ; new lualine theme

---
 lua/plugins/gitsigns.lua |  12 +-
 lua/plugins/init.lua     |   3 -
 lua/plugins/lazy.lua     |  32 ++---
 lua/plugins/lualine.lua  | 267 ++++++++++++++++++++++++++++++++-------
 lua/plugins/neorg.lua    |  13 --
 lua/plugins/noice.lua    |  99 ---------------
 lua/plugins/nomodoro.lua |  32 -----
 7 files changed, 239 insertions(+), 219 deletions(-)
 delete mode 100644 lua/plugins/neorg.lua
 delete mode 100644 lua/plugins/noice.lua
 delete mode 100644 lua/plugins/nomodoro.lua

diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua
index 33cafe8..c8d0a02 100644
--- a/lua/plugins/gitsigns.lua
+++ b/lua/plugins/gitsigns.lua
@@ -1,11 +1,11 @@
 require('gitsigns').setup {
     signs = {
-        add          = { text = '│' },
-        change       = { text = '│' },
-        delete       = { text = '│' },
-        topdelete    = { text = '│' },
-        changedelete = { text = '│' },
-        untracked    = { text = '┆' },
+        add          = { text = '▊' },
+        change       = { text = '▊' },
+        delete       = { text = '▊' },
+        topdelete    = { text = '▊' },
+        changedelete = { text = '▊' },
+        untracked    = { text = '|' },
     },
 
     signcolumn = true,  -- Toggle with `:Gitsigns toggle_signs`
diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua
index e74fe64..83583f3 100644
--- a/lua/plugins/init.lua
+++ b/lua/plugins/init.lua
@@ -1,11 +1,8 @@
 require("plugins.lazy")
-require("plugins.noice")
-require("plugins.neorg")
 require("plugins.treesitter")
 require("plugins.drop")
 require("plugins.mini")
 require("plugins.lsp-zero")
-require("plugins.nomodoro")
 require("plugins.devicons")
 require("plugins.lualine")
 require("plugins.veil")
diff --git a/lua/plugins/lazy.lua b/lua/plugins/lazy.lua
index 91043de..85a9736 100644
--- a/lua/plugins/lazy.lua
+++ b/lua/plugins/lazy.lua
@@ -20,23 +20,28 @@ vim.opt.rtp:prepend(lazypath)
 
 require("lazy").setup({
 
-    "navarasu/onedark.nvim",
+    -- colorscheme
     "EdenEast/nightfox.nvim",
 
+    -- Focus more !
     "folke/twilight.nvim",
     "folke/zen-mode.nvim",
-    "MunifTanjim/nui.nvim",
 
+    -- it's annoying that w skips the whole word, so let's fix it
     "bkad/camelcasemotion",
+
+    -- very good file jumping system
     "ThePrimeagen/harpoon",
+
+    -- arbitrarily comment
     "tpope/vim-commentary",
 
+    -- this one is just fun
     "eandrju/cellular-automaton.nvim",
-    "dbinagi/nomodoro",
 
 
     -- indicate what has changed in git repo
-       "lewis6991/gitsigns.nvim",
+    "lewis6991/gitsigns.nvim",
 
     -- like magit for emacs
     {
@@ -46,6 +51,7 @@ require("lazy").setup({
     },
 
 
+    -- for faster file navigation
     {
       "nvim-tree/nvim-tree.lua",
       version = "*",
@@ -118,15 +124,6 @@ require("lazy").setup({
     },
 
 
-    -- modern ui
-    {
-        "folke/noice.nvim",
-        config = function ()
-            require("plugins.noice")
-        end
-    },
-
-
     -- dashboard and start page
     {
         "willothy/veil.nvim",
@@ -138,9 +135,6 @@ require("lazy").setup({
     },
 
 
-
-
-
     -- size does not matter
     {
         'echasnovski/mini.nvim',
@@ -167,12 +161,6 @@ require("lazy").setup({
         lazy = true
     },
 
-    -- DAMN, org mode?
-    {
-        "nvim-neorg/neorg",
-        lazy = true
-    },
-
 
     -- Cool screensaver !!
     {
diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua
index 1a2fdbf..333f548 100644
--- a/lua/plugins/lualine.lua
+++ b/lua/plugins/lualine.lua
@@ -1,47 +1,226 @@
-require('lualine').setup {
-    options = {
-        icons_enabled = true,
-        theme = 'carbonfox',
+-- Eviline config for lualine
+-- Author: shadmansaleh
+-- Credit: glepnir
+local lualine = require('lualine')
 
-        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 = { require("nomodoro").status },
-        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 = {}
+-- Color table for highlights
+-- stylua: ignore
+local colors = {
+    bg       = '#202328',
+    fg       = '#bbc2cf',
+    yellow   = '#ECBE7B',
+    cyan     = '#008080',
+    darkblue = '#081633',
+    green    = '#98be65',
+    orange   = '#FF8800',
+    violet   = '#a9a1e1',
+    magenta  = '#c678dd',
+    blue     = '#51afef',
+    red      = '#ec5f67',
 }
 
+local conditions = {
+    buffer_not_empty = function()
+        return vim.fn.empty(vim.fn.expand('%:t')) ~= 1
+    end,
+    hide_in_width = function()
+        return vim.fn.winwidth(0) > 80
+    end,
+    check_git_workspace = function()
+        local filepath = vim.fn.expand('%:p:h')
+        local gitdir = vim.fn.finddir('.git', filepath .. ';')
+        return gitdir and #gitdir > 0 and #gitdir < #filepath
+    end,
+}
+
+-- Config
+local config = {
+    options = {
+        -- Disable sections and component separators
+        component_separators = '',
+        section_separators = '',
+        theme = {
+            -- We are going to use lualine_c an lualine_x as left and
+            -- right section. Both are highlighted by c theme .  So we
+            -- are just setting default looks o statusline
+            normal = { c = { fg = colors.fg, bg = colors.bg } },
+            inactive = { c = { fg = colors.fg, bg = colors.bg } },
+        },
+    },
+
+
+    sections = {
+        -- these are to remove the defaults
+        lualine_a = {},
+        lualine_b = {},
+        lualine_y = {},
+        lualine_z = {},
+        -- These will be filled later
+        lualine_c = {},
+        lualine_x = {},
+    },
+    inactive_sections = {
+        -- these are to remove the defaults
+        lualine_a = {},
+        lualine_b = {},
+        lualine_y = {},
+        lualine_z = {},
+        lualine_c = {},
+        lualine_x = {},
+    },
+}
+
+-- Inserts a component in lualine_c at left section
+local function ins_left(component)
+    table.insert(config.sections.lualine_c, component)
+end
+
+-- Inserts a component in lualine_x at right section
+local function ins_right(component)
+    table.insert(config.sections.lualine_x, component)
+end
+
+ins_left {
+    function()
+        return '▊'
+    end,
+    color = { fg = colors.blue }, -- Sets highlighting of component
+    padding = { left = 0, right = 1 }, -- We don't need space before this
+}
+
+
+
+ins_left {
+    -- mode component
+    function()
+        return ''
+    end,
+    color = function()
+        -- auto change color according to neovims mode
+        local mode_color = {
+            n = colors.blue,
+            i = colors.red,
+            v = colors.green,
+            [''] = colors.orange,
+            V = colors.green,
+            c = colors.magenta,
+            no = colors.red,
+            s = colors.orange,
+            S = colors.orange,
+            [''] = colors.orange,
+            ic = colors.yellow,
+            R = colors.violet,
+            Rv = colors.violet,
+            cv = colors.red,
+            ce = colors.red,
+            r = colors.cyan,
+            rm = colors.cyan,
+            ['r?'] = colors.cyan,
+            ['!'] = colors.red,
+            t = colors.red,
+        }
+        return { fg = mode_color[vim.fn.mode()] }
+    end,
+    padding = { right = 1 },
+}
+
+
+ins_left {
+    'branch',
+    icon = '',
+    color = { fg = colors.violet, gui = 'bold' },
+}
+
+ins_left {
+    'diff',
+    -- Is it me or the symbol for modified us really weird
+    symbols = { added = ' ', modified = '󰝤 ', removed = ' ' },
+    diff_color = {
+        added = { fg = colors.green },
+        modified = { fg = colors.orange },
+        removed = { fg = colors.red },
+    },
+    cond = conditions.hide_in_width,
+}
+
+
+
+ins_left {
+    'diagnostics',
+    sources = { 'nvim_diagnostic' },
+    symbols = { error = ' ', warn = ' ', info = ' ' },
+    diagnostics_color = {
+        color_error = { fg = colors.red },
+        color_warn = { fg = colors.yellow },
+        color_info = { fg = colors.cyan },
+    },
+}
+
+-- Insert mid section. You can make any number of sections in neovim :)
+-- for lualine it's any number greater then 2
+ins_left {
+    function()
+        return '%='
+    end,
+}
+
+
+
+ins_left {
+    'filename',
+    cond = conditions.buffer_not_empty,
+    color = { fg = colors.magenta, gui = 'bold' },
+}
+
+
+
+
+ins_right {
+    -- filesize component
+    'filesize',
+    cond = conditions.buffer_not_empty,
+}
+
+ins_right {
+    'progress',
+    color = {
+        fg = colors.fg,
+        gui = 'bold'
+    }
+}
+
+
+
+
+-- Add components to right sections
+ins_right {
+    'o:encoding', -- option component same as &encoding in viml
+    fmt = string.upper, -- I'm not sure why it's upper case either ;)
+    cond = conditions.hide_in_width,
+    color = { fg = colors.green, gui = 'bold' },
+}
+
+ins_right {
+    'fileformat',
+    fmt = string.upper,
+    icons_enabled = false, -- I think icons are cool but Eviline doesn't have them. sigh
+    color = {
+        fg = colors.green,
+        gui = 'bold'
+    },
+}
+
+ins_right {
+    function()
+        return '▊'
+    end,
+    color = {
+        fg = colors.blue
+    },
+    padding = {
+        left = 1
+    },
+}
+
+-- Now don't forget to initialize lualine
+lualine.setup(config)
diff --git a/lua/plugins/neorg.lua b/lua/plugins/neorg.lua
deleted file mode 100644
index 47159c8..0000000
--- a/lua/plugins/neorg.lua
+++ /dev/null
@@ -1,13 +0,0 @@
-require('neorg').setup {
-    load = {
-        ["core.defaults"] = {}, -- Loads default behaviour
-        ["core.concealer"] = {}, -- Adds pretty icons to your documents
-        ["core.dirman"] = { -- Manages Neorg workspaces
-            config = {
-	workspaces = {
-	    notes = "~/notes",
-	},
-            },
-        },
-    },
-}
diff --git a/lua/plugins/noice.lua b/lua/plugins/noice.lua
deleted file mode 100644
index 38f28b9..0000000
--- a/lua/plugins/noice.lua
+++ /dev/null
@@ -1,99 +0,0 @@
-require("noice").setup({
-    noice = {
-        health = {
-            checker = false
-        },
-
-
-        cmdline = {
-            format = {
-                cmdline = {
-                    pattern = "^:",
-                    icon = " ",
-                    lang = "vim",
-                },
-                search_down = {
-                    kind = "search",
-                    pattern = "^/",
-                    icon = " ",
-                    lang = "regex",
-                },
-                search_up = {
-                    kind = "search",
-                    pattern = "^%?",
-                    icon = " ",
-                    lang = "regex"
-                },
-                filter = {
-                    pattern = "^:%s*!",
-                    icon = "$",
-                    lang = "bash"
-                },
-                lua = {
-                    pattern = "^:%s*lua%s+",
-                    icon = "",
-                    lang = "lua"
-                },
-                help = {
-                    pattern = "^:%s*h%s+",
-                    icon = ""
-                },
-                input = {}
-            }
-        },
-
-
-        opts = {
-            win_options = {
-                winhighlight = {
-                    Normal = "NormalFloat",
-                    FloatBorder = "FloatBorder"
-                }
-            }
-        }
-    },
-
-
-    lsp = {
-        progress = {
-            enabled = true
-        },
-        override = {
-            ["vim.lsp.util.convert_input_to_markdown_lines"] = true,
-            ["vim.lsp.util.stylize_markdown"] = true,
-            ["cmp.entry.get_documentation"] = true
-        }
-    },
-
-    -- show command prompt on top of the buffer, no border
-    views = {
-        cmdline_popup = {
-            position = {
-                row = 0,
-                col = "50%"
-            },
-            size = {
-                width = "98%"
-            },
-            border = {
-	style = "none",
-	padding = { 1, 1 },
-            },
-        }
-    },
-
-
-    presets = {
-        long_message_to_split = true,
-        lsp_doc_border = true
-    },
-
-
-    popupmenu = {
-        backend = "cmp"
-    },
-
-
-    format = {}
-})
-
diff --git a/lua/plugins/nomodoro.lua b/lua/plugins/nomodoro.lua
deleted file mode 100644
index e5204fc..0000000
--- a/lua/plugins/nomodoro.lua
+++ /dev/null
@@ -1,32 +0,0 @@
-require('nomodoro').setup({
-    work_time = 25,
-    break_time = 5,
-    menu_available = true,
-
-    texts = {
-        on_break_complete = "Break is over!",
-        on_work_complete = "Take a break!",
-        status_icon = "羽",
-        timer_format = '!%0M:%0S' -- To include hours: '!%0H:%0M:%0S'
-    },
-
-    -- force break time yaaay
-    on_work_complete = function()
-        vim.cmd('CellularAutomaton make_it_rain')
-    end,
-
-    -- resume 
-    on_break_complete = function()
-        vim.cmd('Veil')
-    end
-})
-
-
--- Show timer status in lualine, on the right
-require('lualine').setup({
-    sections = {
-        lualine_x = {
-            require('nomodoro').status,
-        }
-    }
-})