Skip to content

Freed-Wu/jieba.nvim

 
 

Repository files navigation

jieba.nvim

pre-commit.ci status github/workflow

github/downloads github/downloads/latest github/issues github/issues-closed github/issues-pr github/issues-pr-closed github/discussions github/milestones github/forks github/stars github/watchers github/contributors github/commit-activity github/last-commit github/release-date

github/license github/languages github/languages/top github/directory-file-count github/code-size github/repo-size github/v

luarocks

Use C/C++ to realize Chinese w/b/e/ge for neovim.

Related Projects

Similar Projects

Install

rocks.nvim

Command style

:Rocks install jieba.nvim

Declare style

~/.config/nvim/rocks.toml:

[plugins]
"jieba.nvim" = "scm"

Then

:Rocks sync

or:

$ luarocks --lua-version 5.1 --local --tree ~/.local/share/nvim/rocks install jieba.nvim
# ~/.local/share/nvim/rocks is the default rocks tree path
# you can change it according to your vim.g.rocks_nvim.rocks_path

Configure

Keymap

Be default, add keymaps for b/B/w/W/e/E/ge/gE. you can enable more:

vim.keymap.set("n", "ce", function()
    require("jieba.nvim").wordmotion_change_w()
end, { noremap = false, silent = true })
vim.keymap.set("n", "de", function()
    require("jieba.nvim").wordmotion_delete_w()
end, { noremap = false, silent = true })
vim.keymap.set("n", "viw", function()
    require("jieba.nvim").wordmotion_select_w()
end, { noremap = false, silent = true })

Dictionary

By default, it don't use any user dictionary. You can:

local jieba = require"jieba.nvim.utils"
local jieba_path = jieba.jieba_path
jieba_path.user_dict_path = "/the/path/of/my/user.dict.utf8"
jieba.init(jieba_path)
-- skip default init
jieba.is_init = true

HMM

By default, HMM is enabled to provide higher precision. you can disable it to speed up.

local jieba = require"jieba.nvim.utils"
jieba.hmm = false

Releases

No releases published

Packages

No packages published

Languages

  • Lua 89.3%
  • C 6.3%
  • C++ 3.3%
  • Nix 1.1%