Skip to content

Commit

Permalink
doc: add example of using advanced keymapping to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
aarondill committed Mar 25, 2024
1 parent d4a78a7 commit 7f61423
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,23 @@ lua <<EOF
EOF
```

### Advanced use cases:

You can set `accept_keymap` and `dismiss_keymap` to `false` to disable them, then you can create mappings using `require('tabnine.keymaps')`

```lua
--- Example integration with Tabnine and LuaSnip; falling back to inserting tab if neither has a completion
vim.keymap.set("i", "<tab>", function()
if require("tabnine.keymaps").has_suggestion() then
return require("tabnine.keymaps").accept_suggestion()
elseif require("luasnip").jumpable(1) then
return require("luasnip").jump(1)
else
return "<tab>"
end
end, { expr = true })
```

## Activate Tabnine Pro

- `:TabnineHub` - to open Tabnine Hub and log in to your account
Expand Down

0 comments on commit 7f61423

Please sign in to comment.