• Stars
    star
    149
  • Rank 241,737 (Top 5 %)
  • Language
    Emacs Lisp
  • Created over 11 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Yet another folding extension for Emacs

yafolding - Yet another folding extension for Emacs

CircleCI

Folding code blocks based on indentation.

ScreenShot

PrtSc

Config Example

Default Keymap

(defvar yafolding-mode-map
  (let ((map (make-sparse-keymap)))
    (define-key map (kbd "<C-S-return>") #'yafolding-hide-parent-element)
    (define-key map (kbd "<C-M-return>") #'yafolding-toggle-all)
    (define-key map (kbd "<C-return>") #'yafolding-toggle-element)
    map))

Discover commands with a context menu

Call M-x yafolding-discover to have a magit-like context menu that displays the available commands. This feature relies on discover.el.

To give it a keybinding:

(global-set-key (kbd "s-d y") 'yafolding-discover)

Hook into prog-mode-hook

(add-hook 'prog-mode-hook
          (lambda () (yafolding-mode)))

Modify keybindings

(require 'yafolding)
(define-key yafolding-mode-map (kbd "<C-S-return>") nil)
(define-key yafolding-mode-map (kbd "<C-M-return>") nil)
(define-key yafolding-mode-map (kbd "<C-return>") nil)
(define-key yafolding-mode-map (kbd "C-c <C-M-return>") 'yafolding-toggle-all)
(define-key yafolding-mode-map (kbd "C-c <C-S-return>") 'yafolding-hide-parent-element)
(define-key yafolding-mode-map (kbd "C-c <C-return>") 'yafolding-toggle-element)

Known Issue

data loss on delete-trailing-whitespace

use this instead:

(lambda ()
    (yafolding-show-all)
    (delete-trailing-whitespace))

see also: #13

Licensing

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Debug

Testing

For testing, use ecukes, installed by Cask. The tests are in the features subdirectory, test data is in the data dir.

Run tests

cask install
cask exec ecukes --no-win

More Repositories

1

fonts.css

跨平台 CSS 中文字体解决方案
TypeScript
2,067
star
2

Free-Chinese-Fonts

免费中文字体
JavaScript
1,429
star
3

color-hash

Generate color based on the given string (using HSL color space and SHA256).
TypeScript
703
star
4

p5.js-svg

SVG runtime for p5.js.
JavaScript
655
star
5

font-detect.js

Detect font without flash, simply using javascript & @font-face
JavaScript
80
star
6

node-yaqrcode

Pure Javascript QR Code Generator for NodeJS
HTML
60
star
7

p5.js-pdf

A simple PDF export module for p5.js.
JavaScript
52
star
8

apisix-javascript-plugin-runner

Node.js / Deno / WASM Plugin Runner for APISIX
TypeScript
32
star
9

css-eldoc

eldoc-mode plugin for CSS
Emacs Lisp
28
star
10

gitlab-changelog

A php script to generate changelog via gitlab api
PHP
16
star
11

cocolour

Color schemes generator based on machine learning
JavaScript
12
star
12

colors-clustering

Colors clustering based on K-means algorithm & CIE76
JavaScript
11
star
13

act.js

Create Adobe Color Table (.act) files using Uint8Array, Blob API and FileReader API.
JavaScript
10
star
14

php-eldoc

eldoc-mode plugin for PHP source code
Emacs Lisp
10
star
15

parallel-algorithm-notes

This is my notes for our Parallel Algorithms course.
HTML
9
star
16

electronic-wechat-deb

Deb package for Zhongyi Tong's awesome Electronic WeChat.
Shell
7
star
17

automatic-control-theory

自动控制理论
Python
6
star
18

colors

colors
JavaScript
5
star
19

colors-clustering-visualization

Visualization demo for Colors Clustering using RGB & K-means algorithm
JavaScript
4
star
20

Data-Visualization-Examples

一些数据可视化的例子
CSS
4
star
21

qr-auth

QR Code Based 2-Step Authentication
CoffeeScript
4
star
22

wp-cors

Yet another wordpress cross domain plugin
PHP
3
star
23

gsoc2015

My Proposals and Logs for Google Summer of Code 2015
JavaScript
3
star
24

rice-sorting

Rice sorting based on machine vision
JavaScript
2
star
25

.xmonad

My XMonad & XMobar Config
Haskell
2
star
26

The-Nature-of-Code

The Nature of Code (in processing-js)
Processing
2
star
27

upgradeneeded

浏览器更新提示。
CSS
2
star
28

interval.js

A simple interval manager with lifetime / start / stop / pause / resume / restart
CSS
2
star
29

gene-pool

Genetic algorithms in a given gene pool
JavaScript
2
star
30

zju-cli

This repo was moved to https://github.com/QSCTech/zjunet.
Shell
2
star
31

apisix-plugin-waf

ModSecurity compatible web application firewall plugin for Apache APISIX
2
star
32

npmm

Install npm packages using mirrrors with package-lock.json resolved to registry.npmjs.org
Shell
2
star
33

skeleton

Detect theme colors of a webpage using phantomjs
JavaScript
1
star
34

service

互联网服务
1
star
35

dotxbindkeys

Xbindkeys Configuration Framework
Scheme
1
star
36

xbindkeys-chromemacs

Emacs keybindings for Chrome / Chromium using xbindkeys
Scheme
1
star
37

cold-plasma-rice-seeds

冷等离子处理的水稻种子吸水特性
Python
1
star
38

postino

C
1
star
39

socks-scripts

Scripts using red socks & socks to bgswlan or any other router or server
1
star
40

bingang-industrial-park

滨港工业城官方网站前端
CoffeeScript
1
star
41

ASM-80C51

80C51 汇编
Assembly
1
star
42

MathJax

Self hosted MathJax plus some handy configuration.
JavaScript
1
star
43

ASABE-Robotics-Competition

ASABE Robotics Competition
JavaScript
1
star
44

simple-loading-bar

A simple loading bar bind on dom
JavaScript
1
star
45

chrome-time

a simple clock for chrome
JavaScript
1
star
46

Machine-Learning

Machine Learning Exercises
Clojure
1
star
47

fs-storage

localStorage like, fileSystem based storage
CoffeeScript
1
star
48

iframe-url-binding

Iframe based url binding
JavaScript
1
star
49

Cache.coffee

Cache.coffee is a library written for data caching.
CoffeeScript
1
star
50

common-knowledge

常识
1
star
51

time

A clock Web App, using IndexedDB.
JavaScript
1
star
52

mdt

Markdown toolkit (pandoc, XeLaTeX, mermaid and LaTeX beamer slide show)
Shell
1
star
53

try-kicad

IDL
1
star