aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorAshkan Kiani <ashkan.k.kiani@gmail.com>2019-10-18 09:25:25 -0700
committerAshkan Kiani <ashkan.k.kiani@gmail.com>2019-10-18 09:25:25 -0700
commit962453e7b7c33bb8fd0075464e455b0aaff9fb13 (patch)
treed425f93d4c5f19fe7c3251f68fe87d9d8ce27198 /README.md
parentAdd FileType information to the README (#10) (diff)
Update with fully qualified settings and commands.
- Add command documentation and new commands. - Add new settings which have a better naming scheme. - Fix reloading settings and add a command to detach highlighter. - Fix #RGB pattern like for #define where it will highlight the #def part.
Diffstat (limited to 'README.md')
-rw-r--r--README.md46
1 files changed, 40 insertions, 6 deletions
diff --git a/README.md b/README.md
index e7626d9..2cb28b3 100644
--- a/README.md
+++ b/README.md
@@ -34,13 +34,23 @@ Additionally, having a Lua API that's available means users can use this as a li
### Customization
-The available highlight modes are `foreground`, `background`. The default is
-`background`.
+```lua
+ DEFAULT_OPTIONS = {
+ RGB = true; -- #RGB hex codes
+ RRGGBB = true; -- #RRGGBB hex codes
+ names = true; -- "Name" codes like Blue
+ rgb_fn = false; -- CSS rgb() and rgba() functions
+ hsl_fn = false; -- CSS hsl() and hsla() functions
+ css = false; -- Enable all features above.
+ css_fn = false; -- Enable all CSS *functions*: rgb_fn, hsl_fn
+ -- Available modes: foreground, background
+ mode = 'background'; -- Set the display mode.
+ }
+```
-Full options list:
-- `no_names`: Disable parsing names like "Blue"
-- `rgb_fn`: Enable parsing `rgb(...)` functions.
-- `mode`: Highlight mode. Valid options: `foreground`,`background`
+MODES:
+- `foreground`: sets the foreground text color.
+- `background`: sets the background text color.
For basic setup, you can use a command like the following.
@@ -80,6 +90,30 @@ require 'colorizer'.setup {
For lower level interface, see the [LuaDocs for API details](https://norcalli.github.io/luadoc/nvim-colorizer.lua/modules/colorizer.html) or use `:h colorizer.lua` once installed.
+## Commands
+
+```help
+|:ColorizerAttachToBuffer|
+
+Attach to the current buffer and start highlighting with the settings as
+specified in setup (or the defaults).
+
+If the buffer was already attached (i.e. being highlighted), the settings will
+be reloaded with the ones from setup. This is useful for reloading settings
+for just one buffer.
+
+|:ColorizerDetachFromBuffer|
+
+Stop highlighting the current buffer (detach).
+
+|:ColorizerReloadAllBuffers|
+
+Reload all buffers that are being highlighted with new settings from the setup
+settings (or the defaults). Shortcut for ColorizerAttachToBuffer on every
+buffer.
+```
+
+
## Caveats
If the file you are editing has no filetype, the plugin won't be attached, as it relies on AutoCmd to do so. You can still make it work by running the following command: