From 292609e3ad06946abc9e780bb383112c127d1917 Mon Sep 17 00:00:00 2001
From: Hubert Pelczarski <41551030+hoob3rt@users.noreply.github.com>
Date: Thu, 13 May 2021 23:19:11 +0200
Subject: [PATCH] docs: vimscript removal prep (#243)
---
README.md | 93 ++---------------------------
doc/lualine.txt | 88 +++------------------------
lua/lualine/components/filename.lua | 2 +-
lua/lualine/init.lua | 4 ++
4 files changed, 18 insertions(+), 169 deletions(-)
diff --git a/README.md b/README.md
index 73ad259..ddaa7c4 100644
--- a/README.md
+++ b/README.md
@@ -58,8 +58,6 @@ use {
```
## Usage and customization
-Lualine can be configured with both lua and vimscript.
-Click [here](#lua-config-example) if you want to see a config example in lua and [here](#vimscript-config-example) if you want to see a config example in vimscript.
Lualine has sections as shown below.
@@ -71,12 +69,6 @@ Lualine has sections as shown below.
Each sections holds it's components e.g. current vim's mode.
----
-### Starting lualine
-```lua
-require('lualine').setup()
-```
-
Default config
```lua
@@ -111,6 +103,12 @@ require'lualine'.setup {
+---
+### Starting lualine
+```lua
+require('lualine').setup()
+```
+
---
### Setting a theme
```lua
@@ -406,82 +404,3 @@ You can disable lualine for specific filetypes
```lua
options = {disabled_filetypes = {'lua'}}
```
-
----
-### Lua config example
-
-
-packer config
-
-```lua
- use {
- 'hoob3rt/lualine.nvim',
- requires = {'kyazdani42/nvim-web-devicons', opt = true},
- config = function()
- require('lualine').setup{
- options = {
- theme = 'gruvbox',
- section_separators = {'', ''},
- component_separators = {'', ''},
- disabled_filetypes = {},
- icons_enabled = true,
- },
- sections = {
- lualine_a = { {'mode', upper = true} },
- lualine_b = { {'branch', icon = ''} },
- lualine_c = { {'filename', file_status = true} },
- lualine_x = { 'encoding', 'fileformat', 'filetype' },
- lualine_y = { 'progress' },
- lualine_z = { 'location' },
- },
- inactive_sections = {
- lualine_a = { },
- lualine_b = { },
- lualine_c = { 'filename' },
- lualine_x = { 'location' },
- lualine_y = { },
- lualine_z = { }
- },
- extensions = { 'fzf' }
- }
- end
- }
-```
-
-
-
-### Vimscript config example
-
-
-vimrc config
-
-```vim
-let g:lualine = {
- \'options' : {
- \ 'theme' : 'gruvbox',
- \ 'section_separators' : ['', ''],
- \ 'component_separators' : ['', ''],
- \ 'disabled_filetypes' : [],
- \ 'icons_enabled' : v:true,
- \},
- \'sections' : {
- \ 'lualine_a' : [ ['mode', {'upper': v:true,},], ],
- \ 'lualine_b' : [ ['branch', {'icon': '',}, ], ],
- \ 'lualine_c' : [ ['filename', {'file_status': v:true,},], ],
- \ 'lualine_x' : [ 'encoding', 'fileformat', 'filetype' ],
- \ 'lualine_y' : [ 'progress' ],
- \ 'lualine_z' : [ 'location' ],
- \},
- \'inactive_sections' : {
- \ 'lualine_a' : [ ],
- \ 'lualine_b' : [ ],
- \ 'lualine_c' : [ 'filename' ],
- \ 'lualine_x' : [ 'location' ],
- \ 'lualine_y' : [ ],
- \ 'lualine_z' : [ ],
- \},
- \'extensions' : [ 'fzf' ],
- \}
-lua require("lualine").setup()
-```
-
diff --git a/doc/lualine.txt b/doc/lualine.txt
index bcd1521..a904339 100644
--- a/doc/lualine.txt
+++ b/doc/lualine.txt
@@ -23,9 +23,7 @@ CONTENTS *lualine-contents*
1.1.6 Component options.......................|lualine-component_options|
1.1.7 Tabline...........................................|lualine-tabline|
1.1.8 Extensions.....................................|lualine-extensions|
- 1.2 Config examples..............................|lualine-config_examples|
- 1.2.1 Lua config example...................|lualine-lua_config_example|
- 1.2.2 Vimscript config example.......|lualine-vimscript_config_example|
+ 1.1.8 Disabling lualine.................................|lualine-disable|
==============================================================================
USAGE AND CUSTOMIZATION *lualine-usage_and_customization*
@@ -38,11 +36,6 @@ Lualine has sections as shown below.
Each sections holds it's components e.g. current vim's mode.
-------------------------------------------------------------------------------
-STARTING LUALINE *lualine-starting_lualine* *lualine.setup()*
->
- require('lualine').setup()
-
Default config~
>
require'lualine'.setup {
@@ -73,6 +66,11 @@ Default config~
extensions = {}
}
+------------------------------------------------------------------------------
+STARTING LUALINE *lualine-starting_lualine* *lualine.setup()*
+>
+ require('lualine').setup()
+
------------------------------------------------------------------------------
SETTING A THEME *lualine-theme*
>
@@ -323,83 +321,11 @@ Available extensions
* |nvim-tree|
* |quickfix|
-==============================================================================
+------------------------------------------------------------------------------
DISABLING LUALINE *lualine-disable*
You can disable lualine for specific filetypes
`options = {disabled_filetypes = {'lua'}}`
-
-==============================================================================
-
-CONGIG EXAMPLES *lualine-config_examples*
-
------------------------------------------------------------------------------
-LUA CONFIG EXAMPLE *lualine-lua_config_example*
->
- use {
- 'hoob3rt/lualine.nvim',
- requires = {'kyazdani42/nvim-web-devicons', opt = true},
- config = function()
- require('lualine').setup{
- options = {
- theme = 'gruvbox',
- section_separators = {'', ''},
- component_separators = {'', ''},
- disabled_filetypes = {},
- icons_enabled = true,
- },
- sections = {
- lualine_a = { {'mode', upper = true} },
- lualine_b = { {'branch', icon = ''} },
- lualine_c = { {'filename', file_status = true} },
- lualine_x = { 'encoding', 'fileformat', 'filetype' },
- lualine_y = { 'progress' },
- lualine_z = { 'location' },
- },
- inactive_sections = {
- lualine_a = { },
- lualine_b = { },
- lualine_c = { 'filename' },
- lualine_x = { 'location' },
- lualine_y = { },
- lualine_z = { }
- },
- extensions = { 'fzf' }
- }
- end
- }
-<
-------------------------------------------------------------------------------
-VIMSCRIPT CONFIG EXAMPLE *lualine-vimscript_config_example*
->
- let g:lualine = {
- \'options' : {
- \ 'theme' : 'gruvbox',
- \ 'section_separators' : ['', ''],
- \ 'component_separators' : ['', ''],
- \ 'disabled_filetypes' : [],
- \ 'icons_enabled' : v:true,
- \},
- \'sections' : {
- \ 'lualine_a' : [ ['mode', {'upper': v:true,},], ],
- \ 'lualine_b' : [ ['branch', {'icon': '',}, ], ],
- \ 'lualine_c' : [ ['filename', {'file_status': v:true,},], ],
- \ 'lualine_x' : [ 'encoding', 'fileformat', 'filetype' ],
- \ 'lualine_y' : [ 'progress' ],
- \ 'lualine_z' : [ 'location' ],
- \},
- \'inactive_sections' : {
- \ 'lualine_a' : [ ],
- \ 'lualine_b' : [ ],
- \ 'lualine_c' : [ 'filename' ],
- \ 'lualine_x' : [ 'location' ],
- \ 'lualine_y' : [ ],
- \ 'lualine_z' : [ ],
- \},
- \'extensions' : [ 'fzf' ],
- \}
- lua require("lualine").setup()
-<
------------------------------------------------------------------------------
vim:tw=80:sw=4:ts=8:noet:ft=help:norl:et:
diff --git a/lua/lualine/components/filename.lua b/lua/lualine/components/filename.lua
index 06cc622..1b2d75c 100644
--- a/lua/lualine/components/filename.lua
+++ b/lua/lualine/components/filename.lua
@@ -27,7 +27,7 @@ FileName.new = function(self, options, child)
if new_instance.options.full_path or new_instance.options.shorten then
vim.schedule(function()
vim.api.nvim_err_writeln(
- [[Lualine: filename component configuration changed, see :h lualine_custom_options ]])
+ [[Lualine: filename component configuration changed, see :h lualine-component_options ]])
end)
end
diff --git a/lua/lualine/init.lua b/lua/lualine/init.lua
index e696966..10c252d 100644
--- a/lua/lualine/init.lua
+++ b/lua/lualine/init.lua
@@ -181,6 +181,10 @@ local function setup(user_config)
if user_config then
config_module.apply_configuration(user_config)
elseif vim.g.lualine then
+ vim.schedule(function()
+ vim.api.nvim_err_writeln(
+ [[Lualine: lualine will stop supporting vimscript soon, change your config to lua or wrap it around lua << EOF ... EOF]]) -- luacheck: ignore
+ end)
config_module.apply_configuration(vim.g.lualine)
end
setup_theme()