4 files changed,
20 insertions(+),
238 deletions(-)
M
init.lua
@@ -2,4 +2,5 @@ require "options"
require "plugin" require "keymapings" -vim.cmd [[colo onedarker]] +vim.g.vscode_style = "dark" +vim.cmd [[colo vscode]]
M
lua/plugin/configs/cmp.lua
@@ -1,9 +1,9 @@
local M = {} function M.setup() - require("nvim-autopairs.completion.cmp").setup {} - local cmp = require "cmp" + + cmp.event:on("confirm_done", require("nvim-autopairs.completion.cmp").on_confirm_done()) cmp.setup { snippet = { expand = function(args)
M
lua/plugin/configs/statusline.lua
@@ -1,240 +1,20 @@
local M = {} function M.setup() - local colors = { - bg = "#282c34", - fg = "#abb2bf", - yellow = "#e0af68", - cyan = "#56b6c2", - darkblue = "#081633", - green = "#98c379", - orange = "#d19a66", - violet = "#a9a1e1", - magenta = "#c678dd", - blue = "#61afef", - red = "#e86671", - } - - local vi_mode_colors = { - NORMAL = colors.green, - INSERT = colors.red, - VISUAL = colors.magenta, - OP = colors.green, - BLOCK = colors.blue, - REPLACE = colors.violet, - ["V-REPLACE"] = colors.violet, - ENTER = colors.cyan, - MORE = colors.cyan, - SELECT = colors.orange, - COMMAND = colors.green, - SHELL = colors.green, - TERM = colors.green, - NONE = colors.yellow, - } - - local function file_osinfo() - local os = vim.bo.fileformat:upper() - local icon - if os == "UNIX" then - icon = " " - elseif os == "MAC" then - icon = " " - else - icon = " " - end - return icon .. os - end - - local lsp = require "feline.providers.lsp" - local vi_mode_utils = require "feline.providers.vi_mode" - - local lsp_get_diag = function(str) - local count = vim.lsp.diagnostic.get_count(0, str) - return (count > 0) and " " .. count .. " " or "" - end - - local comps = { - vi_mode = { - left = { - provider = function() - return " " .. vi_mode_utils.get_vim_mode() - end, - hl = function() - local val = { - name = vi_mode_utils.get_mode_highlight_name(), - fg = vi_mode_utils.get_mode_color(), - } - return val - end, - right_sep = " ", - }, - right = { - provider = "▊", - -- provider = "", - hl = function() - local val = { - name = vi_mode_utils.get_mode_highlight_name(), - fg = vi_mode_utils.get_mode_color(), - } - return val - end, - left_sep = " ", - right_sep = " ", - }, - }, - file = { - info = { - provider = "file_info", - file_modified_icon = "", - hl = { fg = colors.blue, style = "bold" }, - }, - encoding = { - provider = "file_encoding", - left_sep = " ", - hl = { fg = colors.violet, style = "bold" }, - }, - type = { provider = "file_type" }, - os = { - provider = file_osinfo, - left_sep = " ", - hl = { - fg = colors.violet, - style = "bold", - }, - }, - position = { - provider = "position", - left_sep = " ", - hl = { - fg = colors.cyan, - style = "bold", - }, - }, - }, - left_end = { - provider = function() - return "" - end, - hl = { fg = colors.bg, bg = colors.blue }, - }, - line_percentage = { - provider = "line_percentage", - left_sep = " ", - hl = { style = "bold" }, - }, - scroll_bar = { - provider = "scroll_bar", - left_sep = " ", - hl = { fg = colors.blue, style = "bold" }, - }, - diagnos = { - err = { - -- provider = 'diagnostic_errors', - provider = function() - return "" .. lsp_get_diag "Error" - end, - enabled = function() - return lsp.diagnostics_exist "Error" - end, - hl = { - fg = colors.red, - }, - }, - warn = { - -- provider = 'diagnostic_warnings', - provider = function() - return "" .. lsp_get_diag "Warning" - end, - enabled = function() - return lsp.diagnostics_exist "Warning" - end, - hl = { - fg = colors.yellow, - }, - }, - info = { - -- provider = 'diagnostic_info', - provider = function() - return "" .. lsp_get_diag "Information" - end, - enabled = function() - return lsp.diagnostics_exist "Information" - end, - hl = { fg = colors.blue }, - }, - hint = { - provider = function() - return "" .. lsp_get_diag "Hint" - end, - enabled = function() - return lsp.diagnostics_exist "Hint" - end, - hl = { fg = colors.cyan }, - }, + require("lualine").setup { + options = { + theme = "codedark", + component_separators = { "", "" }, + section_separators = { "", "" }, + disabled_filetypes = { "NvimTree", "Telescope" }, }, - lsp = { - name = { - provider = "lsp_client_names", - left_sep = " ", - icon = " ", - hl = { fg = colors.yellow }, - }, - }, - git = { - branch = { - provider = "git_branch", - icon = " ", - left_sep = " ", - hl = { fg = colors.violet, style = "bold" }, - }, - add = { - provider = "git_diff_added", - hl = { fg = colors.green }, - }, - change = { - provider = "git_diff_changed", - hl = { fg = colors.orange }, - }, - remove = { - provider = "git_diff_removed", - hl = { fg = colors.red }, - }, - }, - } - - local components = { active = {}, inactive = {} } - table.insert(components.active, {}) - table.insert(components.active, {}) - table.insert(components.active, {}) - table.insert(components.inactive, {}) - table.insert(components.inactive, {}) - table.insert(components.active[1], comps.vi_mode.left) - table.insert(components.active[1], comps.file.info) - table.insert(components.active[1], comps.git.branch) - table.insert(components.active[1], comps.git.add) - table.insert(components.active[1], comps.git.change) - table.insert(components.active[1], comps.git.remove) - table.insert(components.inactive[1], comps.vi_mode.left) - table.insert(components.inactive[1], comps.file.info) - table.insert(components.active[3], comps.diagnos.err) - table.insert(components.active[3], comps.diagnos.warn) - table.insert(components.active[3], comps.diagnos.hint) - table.insert(components.active[3], comps.diagnos.info) - table.insert(components.active[3], comps.lsp.name) - table.insert(components.active[3], comps.file.os) - table.insert(components.active[3], comps.file.position) - table.insert(components.active[3], comps.line_percentage) - table.insert(components.active[3], comps.scroll_bar) - table.insert(components.active[3], comps.vi_mode.right) - - require("feline").setup { - colors = { bg = colors.bg, fg = colors.fg }, - components = components, - vi_mode_colors = vi_mode_colors, - force_inactive = { - filetypes = { "packer", "NvimTree" }, - buftypes = { "terminal", "NvimTree" }, - bufnames = {}, + sections = { + lualine_a = { "branch", "diff" }, + lualine_b = { "filename" }, + lualine_c = {}, + lualine_x = {}, + lualine_y = { { "diagnostics", sources = { "nvim_lsp" } } }, + lualine_z = { "location" }, }, } end
M
lua/plugin/init.lua
@@ -1,7 +1,7 @@
return require("packer").startup(function(use) use "wbthomason/packer.nvim" use "nvim-lua/plenary.nvim" - use "LunarVim/onedarker.nvim" + use "Mofiqul/vscode.nvim" use "kyazdani42/nvim-web-devicons" use "romgrk/barbar.nvim" -- use { "tpope/vim-surround", keys = { "c", "y", "d" } }@@ -59,7 +59,8 @@ end,
} use { - "Famiu/feline.nvim", + "nvim-lualine/lualine.nvim", + config = function() require("plugin.configs.statusline").setup() end,