Skip to content

Commit

Permalink
docs: consistent lua formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
gepbird committed Jun 9, 2024
1 parent 70d71fa commit 7eb3326
Show file tree
Hide file tree
Showing 2 changed files with 300 additions and 303 deletions.
17 changes: 7 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ If you'd like to use an older version of the plugin compatible with nvim-0.6.1 a

```lua
-- using packer.nvim
use {'akinsho/bufferline.nvim', tag = "*", requires = 'nvim-tree/nvim-web-devicons'}
use { "akinsho/bufferline.nvim", tag = "*", requires = "nvim-tree/nvim-web-devicons" }

-- using lazy.nvim
{'akinsho/bufferline.nvim', version = "*", dependencies = 'nvim-tree/nvim-web-devicons'}
{ "akinsho/bufferline.nvim", version = "*", dependencies = "nvim-tree/nvim-web-devicons" }
```

**Vimscript**
Expand All @@ -79,15 +79,15 @@ of various highlight groups.
" In your init.lua or init.vim
set termguicolors
lua << EOF
require("bufferline").setup{}
require("bufferline").setup()
EOF
```

**Lua**

```lua
vim.opt.termguicolors = true
require("bufferline").setup{}
require("bufferline").setup()
```

You can close buffers by clicking the close icon or by _right clicking_ the tab anywhere
Expand Down Expand Up @@ -178,7 +178,6 @@ diagnostics_indicator = function(count, level, diagnostics_dict, context)
local icon = level:match("error") and "" or ""
return " " .. icon .. count
end

```

</details>
Expand All @@ -189,12 +188,10 @@ end
<summary><b>snippet</b></summary>

```lua

diagnostics_indicator = function(count, level, diagnostics_dict, context)
local s = " "
for e, n in pairs(diagnostics_dict) do
local sym = e == "error" and ""
or (e == "warning" and "" or "")
local sym = e == "error" and "" or (e == "warning" and "" or "")
s = s .. n .. sym
end
return s
Expand All @@ -212,10 +209,10 @@ LSP indicators can additionally be reported conditionally, based on buffer conte
```lua
diagnostics_indicator = function(count, level, diagnostics_dict, context)
if context.buffer:current() then
return ''
return ""
end

return ''
return ""
end
```

Expand Down
Loading

0 comments on commit 7eb3326

Please sign in to comment.