Skip to content
This repository has been archived by the owner on Jul 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #4 from xiaoshihou514/main
Browse files Browse the repository at this point in the history
docs: adds demo video
  • Loading branch information
glepnir authored Dec 1, 2023
2 parents 6e6f7fd + 24d57eb commit 2c1794f
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Blazingly fast, minimal lsp auto-completion and snippet plugin for neovim.

[demo.webm](https://github.com/xiaoshihou514/epo.nvim/assets/108414369/e6df8be6-1cd3-4f53-96ba-023d785a0d1c)

**Needs neovim nightly**

**This plugin would be much more feature-complete after [this pr](https://github.com/neovim/neovim/pull/24723) is merged**
Expand Down Expand Up @@ -55,7 +57,7 @@ PmenuThumb
```

<details>
<summary>Click to show some mapping presets</summary>
<summary>Click to show some config presets</summary>

- <kbd>TAB</kbd> complete

Expand Down Expand Up @@ -88,6 +90,25 @@ vim.keymap.set('i', '<C-e>', function()
end, {expr = true})
```

- kind icons like in the demo
```lua
-- reference: onsails/lspkind.nvim
local kind_icons = {
Text = "󰉿", Method = "󰆧", Function = "󰘧", Constructor = "", Field = "󰜢",
Variable = "󰀫", Class = "󰠱", Interface = "", Module = "", Property = "󰜢",
Unit = "󰑭", Value = "󰎠", Enum = "", Keyword = "󰌋", Snippet = "", Color = "󰏘",
File = "󰈙", Reference = "", Folder = "󰉋", EnumMember = "", Constant = "󰏿",
Struct = "", Event = "", Operator = "󰆕", TypeParameter = "", Unknown = "",
}

require("epo").setup {
kind_format = function(k)
return kind_icons[k] .. " " .. k
end
}

```

- use `<cr>` to accept completion

```lua
Expand All @@ -102,12 +123,12 @@ end, { expr = true, noremap = true })
-- nvim-autopair compatibility
vim.keymap.set("i", "<cr>", function()
if vim.fn.pumvisible() == 1 then
return "<C-y>"
return vim.api.nvim_replace_termcodes("<C-y>", true, true, true)
end
return require("nvim-autopairs").autopairs_cr()
end, { expr = true, noremap = true })
end, { expr = true, noremap = true, replace_keycodes = false })
require("nvim-autopairs").setup({ map_cr = false })
```

</details>

## License MIT

0 comments on commit 2c1794f

Please sign in to comment.