Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jessepav/vim-camelcomplete
Vim 9 plugin to complete CamelCase, snake_case and dash-words identifier abbreviations.
https://github.com/jessepav/vim-camelcomplete
completion vim vim-plugin vim9 vim9-plugin vim9script
Last synced: 7 days ago
JSON representation
Vim 9 plugin to complete CamelCase, snake_case and dash-words identifier abbreviations.
- Host: GitHub
- URL: https://github.com/jessepav/vim-camelcomplete
- Owner: jessepav
- License: mit
- Created: 2023-01-11T22:58:32.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-06-24T05:49:10.000Z (5 months ago)
- Last Synced: 2024-06-24T06:52:39.818Z (5 months ago)
- Topics: completion, vim, vim-plugin, vim9, vim9-plugin, vim9script
- Language: Vim Script
- Homepage:
- Size: 31.3 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-vim9 - vim-camelcomplete - words identifier abbreviations. | ✅ | (Completion)
README
# vim-camelcomplete
Vim 9 plugin to complete `CamelCase`, `snake_case`, and `dash-words` identifier
abbreviations.## 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 `/`, 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, this plugin is written in `vim9script` using the
`matchbufline()` and `matchstrlist()` functions introduced in Vim `v9.1.0009`, and thus
you'll need a sufficiently new version of Vim to use it.## Installation
Use your favorite plugin manager.
For instace, with [vim-plug](https://github.com/junegunn/vim-plug):
```vim
Plug 'jessepav/vim-camelcomplete'
```## Usage
Quick Start:
In your `.vimrc`, add these lines
```
CamelCompleteInstall
inoremap CamelCompleteRefreshBuffers 3
```This will set `'completefunc'` to a script‑local completion function in
`camelcomplete.vim`, and set up `` 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 ``, since it's only one keystroke, but some terminals won't register ``
properly.## More Information
See [`doc/camelcomplete.txt`](https://github.com/jessepav/vim-camelcomplete/blob/master/doc/camelcomplete.txt)
for more details.