Skip to content

Commit

Permalink
Extend README
Browse files Browse the repository at this point in the history
  • Loading branch information
theHamsta committed Nov 21, 2021
1 parent b2f1378 commit bb8a9ec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,12 @@ require'nvim-semantic-tokens'.setup({
```

Preset configurations are loaded from [./lua/nvim-semantic-tokens/presets](./lua/nvim-semantic-tokens/presets).
The `"default"` preset will set the highlight groups described in [./doc/nvim-semantic-tokens.txt](./doc/nvim-semantic-tokens.txt).

Use an autocommand for a filetype for which you have a language server set up that supports semantic tokens (e.g. clangd)

```vim
if &filetype == "cpp" || &filetype == "cuda" || &filetype == "c"
autocmd BufEnter,CursorHold,InsertLeave <buffer> lua require 'vim.lsp.buf'.semantic_tokens_full()
endif
```
2 changes: 2 additions & 0 deletions doc/nvim-semantic-tokens.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,5 @@ And the following highlight groups modifiers SemanticTokenModifiers:
LspDocumentation
*hl-DefaultLibrary*
LspDefaultLibrary

vim:tw=78:ts=8:expandtab:noet:ft=help:norl:

0 comments on commit bb8a9ec

Please sign in to comment.