Giter VIP home page Giter VIP logo

vim-camelcomplete's Introduction

vim-camelcomplete

Vim 9 plugin to complete CamelCase and snake_case identifier abbreviations.

(Note: I've since rewritten this plugin in Lua, found in the lua branch. This was done for performance, when running Vim built against LuaJIT)

Introduction

This plugin provides a lightweight insert-mode completion function that allows you to expand CamelCase, snake_case, and dash-words abbreviations into their full identifiers. It is purely textual, and doesn't require setting up language servers or defining a project structure; rather, it operates like <C-P>/<C-N>, but on identifier abbreviations rather than prefixes.

For instance,

Identifier Abbreviation
setForwardMark sFM
open_last_file olf
channel34Types c3T
margin-top mt

As an example (with * representing the cursor position),

  obj.sFM* --> (invoke camelcomplete) --> obj.setForwardMark*

Note: for performance (well, at least compared with legacy Vimscript), this plugin is written in vim9script so you'll need Vim 9 (or perhaps a late 8.2 would work as well, though I haven't tested it).

Installation

Use your favorite plugin manager.

For instace, with vim-plug:

Plug 'jessepav/vim-camelcomplete'

Usage

Quick Start:

In your .vimrc, add these lines

  CamelCompleteInstall
  imap <C-X><C-A>    <Plug>CamelCompleteRefreshAndComplete

This will set 'completefunc' to a script‑local completion function in camelcomplete.vim, and set up <C‑X><C‑A> to scan all listed buffers and complete the abbreviation before the cursor. You can, of course, use any {lhs} mapping you'd like. I prefer <M‑/>, since it's only one keystroke, but some terminals won't register <M‑/> properly.

More Information

See doc/camelcomplete.txt for more details.

vim-camelcomplete's People

Contributors

jessepav avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  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.