Coder Social home page Coder Social logo

cmp-im's Introduction

cmp-im

Input Method source.

cmp-im

Setup

  • Defaults configuration
local cmp_im = require('cmp_im')
cmp_im.setup{
  -- Enable/Disable IM
  enable = false,
  -- IM keyword pattern
  keyword = [[\l\+]],
  -- IM tables path array
  tables = { },
  -- Function to format IM-key and IM-tex for completion display
  format = function(key, text) return vim.fn.printf('%-15S %s', text, key) end,
  -- Max number entries to show for completion of each table
  maxn = 8,
}
cmp.setup{
    sources = { { name = 'IM' } },
}
  • Enable/Disable IM
vim.keymap.set({'n', 'v', 'c', 'i'}, '<M-;>', function()
  vim.notify(string.format('IM is %s', cmp_im.toggle() and 'enabled' or 'disabled'))
end)
  • Select IM's entry with <Space>
cmp.setup{
  mapping = { ['<Space>'] = cmp.mapping(cmp_im.select(), { 'i' }) },
}

Tables

Table is a plain text file, where each line is a Im-key with one or multiple IM-texts that splited with whitespace character (<Space> or <Tab>) like below.

cmp-im has a better performance with IM-key being ascending order, which can be done with :sort.

a 阿 啊 呵 腌 嗄 锕 吖 錒

Here is some table-repos for you:

cmp-im's People

Contributors

cxwx avatar yehuohan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.