Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chansey97/company-yasnippet-autoparens
A company-mode script for auto-parenthesis
https://github.com/chansey97/company-yasnippet-autoparens
company-mode emacs lisp parentheses yasnippet
Last synced: 2 months ago
JSON representation
A company-mode script for auto-parenthesis
- Host: GitHub
- URL: https://github.com/chansey97/company-yasnippet-autoparens
- Owner: chansey97
- Created: 2019-02-13T13:37:10.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-03-12T00:05:01.000Z (almost 3 years ago)
- Last Synced: 2024-08-07T18:31:40.532Z (6 months ago)
- Topics: company-mode, emacs, lisp, parentheses, yasnippet
- Language: Emacs Lisp
- Size: 619 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# company-yasnippet-autoparens
A company-mode script for auto-parenthesis### What problem does company-yasnippet-autoparens solve?
Most of completion systems for Emacs do not support automatic parentheses. For example, by default, when typing `add-ho`, the completion list will show `add-hook` instead of `(add-hook)`. This is sometimes annoying. The company-yasnippet-autoparens solves the problem, it can make `add-hook - > (add-hook)` appear in the completion list.
### Demo
1. Any text input, a parentheses version will be added to the completion list.
2. It can combine various backends, e.g. dabbrev.
3. Some other examples that combine with yasnippet.
Note that company-yasnippet-autoparens supports any s-exp languages, not just Elisp. It even can support non s-exp languages, if using `company-yasnippet-autoparens-2.el`.
4. Non s-exp languages.
### Usage
1. If you have installed `company` and `yasnippet`, uninstall them.
2. Clone this repository and unzip it to your emacs configuration path.
3. Add the following code to your configuration file.
```
(require 'yasnippet)
(yas-global-mode 1)(require 'company)
(global-company-mode 1)
(setq company-idle-delay 0.1)
(setq company-minimum-prefix-length 1)
(setq company-dabbrev-char-regexp "\\sw\\|_\\|-\\|!\\|\\?\\|*\\|+\\|=\\|>\\|<")
(setq company-backends '((company-capf
company-dabbrev
company-yasnippet-autoparens
company-yasnippet)))
```