e

A dead simple editor
授权协议 Unlicense License
开发语言 C/C++
所属分类 应用工具、 文档/文本编辑
软件类型 开源软件
地区 不详
投 递 者 潘宪
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

e

Braindead editor. Feels like Vim, only simpler. Inspired bykilo, of course, and a largeswath of the code is similar.

It can be scripted through Lua.

asciicast

Features

  • Scripting through intuitive Lua interface
  • Incremental search (and replace)
  • Multiple modi (similar to Vim)
  • Mnemonic movement (feels like Vim, just different enough for you to be frustrated)
  • Limitless Undo (until memory runs out)
  • Extensible syntax highlighting
  • No global state in the library part (just in main.c)
  • Can be used as a library
  • Ships with syntax highlighting for
    • C/C++ (stable)
    • Python (experimental)
    • JavaScript (experimental)
    • Go (experimental)
    • Haskell (experimental)
    • Carp (experimental)
    • Markdown (unfinished)

Installation

git clone https://github.com/hellerve/e
cd e
make install # install_lua for Lua support

If there are any problems—particularly with Lua—, please refer to theTroubleshooting page onthe wiki.

Usage

There are two major modes, init and edit. edit mode works like a normaltext editor would. init mode enables the user to navigate and do meta work,such as saving the file, searching, and replacing.

init mode mnemonics

Use wasd or the arrow keys for movement. Editing (backspace, etc.) works normally.

  • n: insert a line below the cursor and start editing (next)
  • p: insert a line above the cursor and start editing (previous)
  • b: jump to the beginning of the line and start editing
  • t: jump to the end of the line and start editing (terminus)
  • h: hide a line (delete it) and add it to the system clipboard (clipboard only on Windows and OS X)
  • c: copy a line to the system clipboard (only on Windows and OS X)
  • v: view (i.e. paste) the contents of the system clipboard (only on Windows and OS X)
  • /: incremental highlighted search
  • r: search and replace first occurrence
  • R: search and replace all occurrences
  • Space: quick save (might be prompted for a file name)

In meta mode (reachable by pressing the colon character :), there arethe following commands:

  • s: save and quit (might be prompted for a file name)
  • q: exit (will abort if the file has unsaved content)
  • !: force exit
  • Number n: jump to line n

Writing syntax files

By default, e creates a directory called .estx in the user's homedirectory (the location is overridable by providing STXDIR to make install).There, e will search for syntax files on startup. Their grammar is veryminimal, see the C file below:

displayname: c
extensions: .*\.cpp$
            .*\.hpp$
            .*\.c$
            .*\.h$
comment|no_sep: //.*$
keyword: (restrict|switch|if|while|for|break|continue|return|else|try|catch|else|struct|union|class|typedef|static|enum|case|asm|default|delete|do|explicit|export|extern|inline|namespace|new|public|private|protected|sizeof|template|this|typedef|typeid|typename|using|virtual|friend|goto)
type: (auto|bool|char|const|double|float|inline|int|mutable|register|short|unsigned|volatile|void|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|size_t|ssize_t|time_t)
comment|no_sep: /\*.*\*/
comment|no_sep: /\*.*
                 .*\*/
pragma: \s*#(include|pragma|define|undef) .*$
predefined: (NULL|stdout|stderr)
pragma: \s*#(ifdef|ifndef|if) .*$
pragma: \s*#(endif)
string|no_sep: "([^\\\"]|\\.)*"
string|no_sep: '([^\\\']|\\.)'
number: [+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)[fl]?

displayname is the string displayed at the bottom of e. extensionsis a list of regexes to match the filenames. Highlighting keys are comment,keyword, type, pragma, string, number, and predefined. By appending|no_sep, the user signals to e that no separator is needed, i.e. highlightingworks even if the matched string is part of a longer word. The values are regexes.

If you provide a second regex (must by divided by a newline), e assumes that everythingbetween the two matches should be colored (useful for e.g. multiline comments).

Scripting through Lua

The editor has scripting capabilities in Lua. Thus far I've only documented themin a blog post, but thispost should give you a good overview of how to write Lua scripts for e. Thereis also an example .ercfile in the repository that you can look at for inspiration.

That's it!

Tabs vs. Spaces

I personally always use spaces for indentation, thus e does the same. It willalways convert all of the tabs in your file to spaces automatically for you, andI understand if that bit of behavior is undesired by some. It is very much bydesign, though, and probably won’t change.


Have fun!

  • =lookup(X,{0,A*0.85,A*1.05,A*1.1,A*1.15,A*1.2,A*1.25},{0,5,6,7,8,9,10}) EXCEL中的公式。公式中第一个大括号中的A*0.85等需要换算成数字放在里面。本题中就是=. 另外再问下,e的多少次方等于一个常数???? 1、解方程?怎么没有未知数?2、想问的是“e的多少次方等于一个整数”吧?e的任意确定的次方都等于一个 常数3、e的

  • 苹果手机移动手机上怎么显示是E网? iphone6s上E网状态是运营商网络故障造异常。 需要工具:iphone6s手机 具体操作步骤: 1锁iphone6s手机至主屏幕页面后,屏幕顶部的状态栏显示“E”网络,打开【设置】。 2、进入【设置】中心后,在选项列表中找到【通用】功能打开。 3、在【通用】的功能菜单栏列表中找到并打开【还原】设置。 4、在【还原】的管理设置页面下,选择打开【还原网络设置】功

  • E2E测试 E2E 是End to End的简称,是黑盒测试的一种。 编写测试用例,模拟用户操作,确保组件(或零件)间通信正常,数据流传递如逾期。 E2E模块实现的功能 E2E的目的是提高SWC间通信的安全性。预防通信错误。 参考:4.3.1\Communication.zip\Communication\AUTOSAR_SRS_E2E.pdf To provide a safe End-to-E

  • 作用: e.target.dataset与e.currentTarget.dataset的作用:获取标签中定义的值,定义方法 data-*=某个值 区别: e.target.dataset是指获取当前点击dom的值,若没有对应的值则取的是undefined e.currentTarget 是指注册了监听点击事件的组件,会获取有事件的那个元素 使用: 1需要在触发元素上用“data-”+“属性”的形

相关阅读

相关文章

相关问答

相关文档