diff --git a/README.md b/README.md index 8eec55a..0bd3b53 100644 --- a/README.md +++ b/README.md @@ -37,85 +37,4 @@ See [vim-libmodal][libmodal] and the [docs](./doc) for more information. ## Statusline -You can add `libmodal` modes to your status line by using [galaxyline.nvim](https://github.com/glepnir/galaxyline.nvim.git). Here is an example configuration: - -```lua -local _COLORS = -{ - black = {'#202020', 0, 'black'}, - red = {'#ee4a59', 196, 'red'}, - orange = {'#ff8900', 208, 'darkyellow'}, - yellow = {'#f0df33', 220, 'yellow'}, - green = {'#77ff00', 72, 'green'}, - blue = {'#7090ff', 63, 'darkblue'}, - purple = {'#cf55f0', 129, 'magenta'}, -} - --- Statusline color -_COLORS.bar = {middle=_COLORS.gray_dark, side=_COLORS.black} - --- Text color -_COLORS.text = _COLORS.gray_light - --- Table which gets hex values from _COLORS. -local _HEX_COLORS = setmetatable( - {bar = setmetatable({}, {__index = function(_, key) return _COLORS.bar[key] and _COLORS.bar[key][1] or nil end})}, - {__index = function(_, key) local color = _COLORS[key] return color and color[1] or nil end} -) - -local _MODES = -{ - c = {'COMMAND-LINE', _COLORS.red}, - ce = {'NORMAL EX', _COLORS.red}, - cv = {'EX', _COLORS.red}, - i = {'INSERT', _COLORS.green}, - ic = {'INS-COMPLETE', _COLORS.green}, - n = {'NORMAL', _COLORS.purple}, - no = {'OPERATOR-PENDING', _COLORS.purple}, - r = {'HIT-ENTER', _COLORS.blue}, - ['r?'] = {':CONFIRM', _COLORS.blue}, - rm = {'--MORE', _COLORS.blue}, - R = {'REPLACE', _COLORS.red}, - Rv = {'VIRTUAL', _COLORS.red}, - s = {'SELECT', _COLORS.blue}, - S = {'SELECT', _COLORS.blue}, - t = {'TERMINAL', _COLORS.orange}, - v = {'VISUAL', _COLORS.blue}, - V = {'VISUAL LINE', _COLORS.blue}, - ['!'] = {'SHELL', _COLORS.yellow}, - - -- libmodal - TABS = _COLORS.tan, - BUFFERS = _COLORS.teal, - TABLES = _COLORS.orange_light, -} - -require('galaxyline').section.left = -{ - {ViMode = { - provider = function() -- auto change color according the vim mode - local mode_color = nil - local mode_name = nil - - if vim.g.libmodalActiveModeName then - mode_name = vim.g.libmodalActiveModeName - mode_color = _MODES[mode_name] - else - local current_mode = _MODES[vim.fn.mode(true)] - - mode_name = current_mode[1] - mode_color = current_mode[2] - end - - -- If you have Iron-E/nvim-highlite, use this step. - -- If not, just manually highlight it with vim.cmd() - require('highlite').highlight('GalaxyViMode', {fg=mode_color, style='bold'}) - - return '▊ '..mode_name..' ' - end, - highlight = {_HEX_COLORS.bar.side, _HEX_COLORS.bar.side}, - separator = _SEPARATORS.right, - separator_highlight = {_HEX_COLORS.bar.side, get_file_icon_color} - }} -} -``` +You can add `libmodal` modes to your status line by using [`feline.nvim`](https://github.com/famiu/feline.nvim) or [`galaxyline.nvim`](https://github.com/glepnir/galaxyline.nvim) or . You can find my configuration for `feline.nvim` [here](https://gitlab.com/Iron_E/dotfiles/-/blob/master/.config/nvim/lua/plugin/feline.lua#L130-156) and `galaxyline.nvim` [here](https://gitlab.com/Iron_E/dotfiles/-/blob/edf3e1c9779bbc81002832bb03ec875dc86cc16b/.config/nvim/lua/plugin/galaxyline.lua#L140-163)— both of which leverage `nvim-libmodal`'s in the statusbar.