suplemon-editor 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- suplemon_editor-0.3.0/LICENSE +21 -0
- suplemon_editor-0.3.0/MANIFEST.in +4 -0
- suplemon_editor-0.3.0/PKG-INFO +515 -0
- suplemon_editor-0.3.0/README.md +474 -0
- suplemon_editor-0.3.0/setup.cfg +8 -0
- suplemon_editor-0.3.0/setup.py +69 -0
- suplemon_editor-0.3.0/suplemon/__init__.py +0 -0
- suplemon_editor-0.3.0/suplemon/__main__.py +3 -0
- suplemon_editor-0.3.0/suplemon/cli.py +65 -0
- suplemon_editor-0.3.0/suplemon/config/defaults.json +153 -0
- suplemon_editor-0.3.0/suplemon/config/keymap.json +63 -0
- suplemon_editor-0.3.0/suplemon/config.py +324 -0
- suplemon_editor-0.3.0/suplemon/cursor.py +135 -0
- suplemon_editor-0.3.0/suplemon/editor.py +568 -0
- suplemon_editor-0.3.0/suplemon/file.py +193 -0
- suplemon_editor-0.3.0/suplemon/help.py +327 -0
- suplemon_editor-0.3.0/suplemon/helpers.py +104 -0
- suplemon_editor-0.3.0/suplemon/hex2xterm.py +23 -0
- suplemon_editor-0.3.0/suplemon/key_mappings.py +239 -0
- suplemon_editor-0.3.0/suplemon/lexer.py +88 -0
- suplemon_editor-0.3.0/suplemon/line.py +51 -0
- suplemon_editor-0.3.0/suplemon/linelight/__init__.py +0 -0
- suplemon_editor-0.3.0/suplemon/linelight/color_map.py +9 -0
- suplemon_editor-0.3.0/suplemon/linelight/css.py +21 -0
- suplemon_editor-0.3.0/suplemon/linelight/diff.py +17 -0
- suplemon_editor-0.3.0/suplemon/linelight/html.py +19 -0
- suplemon_editor-0.3.0/suplemon/linelight/js.py +21 -0
- suplemon_editor-0.3.0/suplemon/linelight/json.py +15 -0
- suplemon_editor-0.3.0/suplemon/linelight/lua.py +10 -0
- suplemon_editor-0.3.0/suplemon/linelight/md.py +19 -0
- suplemon_editor-0.3.0/suplemon/linelight/php.py +27 -0
- suplemon_editor-0.3.0/suplemon/linelight/py.py +27 -0
- suplemon_editor-0.3.0/suplemon/logger.py +90 -0
- suplemon_editor-0.3.0/suplemon/main.py +771 -0
- suplemon_editor-0.3.0/suplemon/module_loader.py +98 -0
- suplemon_editor-0.3.0/suplemon/modules/application_state.py +84 -0
- suplemon_editor-0.3.0/suplemon/modules/autocomplete.py +114 -0
- suplemon_editor-0.3.0/suplemon/modules/autodocstring.py +142 -0
- suplemon_editor-0.3.0/suplemon/modules/battery.py +118 -0
- suplemon_editor-0.3.0/suplemon/modules/bulk_delete.py +75 -0
- suplemon_editor-0.3.0/suplemon/modules/clock.py +22 -0
- suplemon_editor-0.3.0/suplemon/modules/comment.py +59 -0
- suplemon_editor-0.3.0/suplemon/modules/config.py +20 -0
- suplemon_editor-0.3.0/suplemon/modules/date.py +22 -0
- suplemon_editor-0.3.0/suplemon/modules/diff.py +42 -0
- suplemon_editor-0.3.0/suplemon/modules/eval.py +43 -0
- suplemon_editor-0.3.0/suplemon/modules/hostname.py +34 -0
- suplemon_editor-0.3.0/suplemon/modules/input_test.py +23 -0
- suplemon_editor-0.3.0/suplemon/modules/keymap.py +20 -0
- suplemon_editor-0.3.0/suplemon/modules/linter.py +274 -0
- suplemon_editor-0.3.0/suplemon/modules/lower.py +21 -0
- suplemon_editor-0.3.0/suplemon/modules/lstrip.py +20 -0
- suplemon_editor-0.3.0/suplemon/modules/paste.py +49 -0
- suplemon_editor-0.3.0/suplemon/modules/reload.py +16 -0
- suplemon_editor-0.3.0/suplemon/modules/replace_all.py +23 -0
- suplemon_editor-0.3.0/suplemon/modules/reverse.py +22 -0
- suplemon_editor-0.3.0/suplemon/modules/rstrip.py +19 -0
- suplemon_editor-0.3.0/suplemon/modules/save.py +16 -0
- suplemon_editor-0.3.0/suplemon/modules/save_all.py +19 -0
- suplemon_editor-0.3.0/suplemon/modules/sort_lines.py +41 -0
- suplemon_editor-0.3.0/suplemon/modules/strip.py +19 -0
- suplemon_editor-0.3.0/suplemon/modules/system_clipboard.py +121 -0
- suplemon_editor-0.3.0/suplemon/modules/tabstospaces.py +18 -0
- suplemon_editor-0.3.0/suplemon/modules/toggle_whitespace.py +18 -0
- suplemon_editor-0.3.0/suplemon/modules/upper.py +21 -0
- suplemon_editor-0.3.0/suplemon/prompt.py +319 -0
- suplemon_editor-0.3.0/suplemon/suplemon_module.py +210 -0
- suplemon_editor-0.3.0/suplemon/themes/8colors.tmTheme +179 -0
- suplemon_editor-0.3.0/suplemon/themes/monokai.tmTheme +284 -0
- suplemon_editor-0.3.0/suplemon/themes.py +201 -0
- suplemon_editor-0.3.0/suplemon/ui.py +656 -0
- suplemon_editor-0.3.0/suplemon/viewer.py +1004 -0
- suplemon_editor-0.3.0/suplemon_editor.egg-info/PKG-INFO +515 -0
- suplemon_editor-0.3.0/suplemon_editor.egg-info/SOURCES.txt +77 -0
- suplemon_editor-0.3.0/suplemon_editor.egg-info/dependency_links.txt +1 -0
- suplemon_editor-0.3.0/suplemon_editor.egg-info/entry_points.txt +3 -0
- suplemon_editor-0.3.0/suplemon_editor.egg-info/requires.txt +2 -0
- suplemon_editor-0.3.0/suplemon_editor.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015 Richard Lewis
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,515 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: suplemon-editor
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Console text editor with multi cursor support. Maintained fork of Suplemon.
|
|
5
|
+
Home-page: https://github.com/leancode/suplemon/
|
|
6
|
+
Author: Richard Lewis
|
|
7
|
+
Author-email: richrd.lewis@gmail.com
|
|
8
|
+
Maintainer: leancode
|
|
9
|
+
License: MIT
|
|
10
|
+
Project-URL: Original project, https://github.com/richrd/suplemon/
|
|
11
|
+
Project-URL: Changelog, https://github.com/leancode/suplemon/blob/master/CHANGELOG.md
|
|
12
|
+
Project-URL: Issues, https://github.com/leancode/suplemon/issues
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Environment :: Console :: Curses
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Operating System :: MacOS
|
|
17
|
+
Classifier: Operating System :: POSIX
|
|
18
|
+
Classifier: Operating System :: Unix
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
21
|
+
Classifier: Topic :: Text Editors
|
|
22
|
+
Classifier: Topic :: Utilities
|
|
23
|
+
Requires-Python: >=3.8
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: pygments
|
|
27
|
+
Requires-Dist: wcwidth
|
|
28
|
+
Dynamic: author
|
|
29
|
+
Dynamic: author-email
|
|
30
|
+
Dynamic: classifier
|
|
31
|
+
Dynamic: description
|
|
32
|
+
Dynamic: description-content-type
|
|
33
|
+
Dynamic: home-page
|
|
34
|
+
Dynamic: license
|
|
35
|
+
Dynamic: license-file
|
|
36
|
+
Dynamic: maintainer
|
|
37
|
+
Dynamic: project-url
|
|
38
|
+
Dynamic: requires-dist
|
|
39
|
+
Dynamic: requires-python
|
|
40
|
+
Dynamic: summary
|
|
41
|
+
|
|
42
|
+
Suplemon :lemon:
|
|
43
|
+
========
|
|
44
|
+
|
|
45
|
+
[](https://github.com/leancode/suplemon/actions/workflows/test.yml)
|
|
46
|
+
|
|
47
|
+
___________ _________ ___ ______________________________ ___
|
|
48
|
+
/ _____/ / / / _ \/ /\ / ______/ / ___ / | / /\
|
|
49
|
+
/ /____/ / / / /_/ / / / / /_____/ / / / / / / |/ / /
|
|
50
|
+
/____ / / / / _____/ / / / ______/ / / / / / / /| / /
|
|
51
|
+
_____/ / /__/ / /\___/ /____/ /_____/ / / / /__/ / / | / /
|
|
52
|
+
/_______/\_______/__/ / /_______/________/__/__/__/________/__/ /|__/ /
|
|
53
|
+
\_______\ \______\__\/ \_______\________\__\__\__\________\__\/ \__\/
|
|
54
|
+
|
|
55
|
+
Remedying the pain of command line editing since 2014
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
Suplemon is a modern, powerful and intuitive console text editor with multi cursor support.
|
|
59
|
+
Suplemon replicates Sublime Text style functionality in the terminal with the ease of use of Nano.
|
|
60
|
+
https://github.com/leancode/suplemon
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+

|
|
64
|
+
|
|
65
|
+
## About this fork
|
|
66
|
+
|
|
67
|
+
This is an actively maintained fork of [richrd/suplemon](https://github.com/richrd/suplemon).
|
|
68
|
+
|
|
69
|
+
The original is a genuinely good editor and none of the design here is ours.
|
|
70
|
+
Upstream simply stopped: the last commit to `master` landed in January 2021,
|
|
71
|
+
the `dev` branch in June 2020, and 25 issues and 5 pull requests are still
|
|
72
|
+
open, some since 2016. Suplemon had also stopped running altogether on
|
|
73
|
+
Python 3.12 and newer, which is what prompted the fork.
|
|
74
|
+
|
|
75
|
+
Since then this fork has:
|
|
76
|
+
|
|
77
|
+
* restored it on current Python, including 3.13
|
|
78
|
+
* fixed the upstream bugs that were reported but never merged, among them
|
|
79
|
+
large files taking minutes to open, a crash in every prompt when the
|
|
80
|
+
bottom bar was hidden, and missing syntax highlighting for several file
|
|
81
|
+
extensions
|
|
82
|
+
* adopted the useful parts of the unmerged upstream pull requests, including
|
|
83
|
+
the maintainer's own unreleased v0.2.9 work
|
|
84
|
+
* fixed things nobody had reported, such as auto indent losing tab
|
|
85
|
+
indentation, and modified keys like <kbd>Alt</kbd> + <kbd>Left</kbd>
|
|
86
|
+
silently doing the wrong thing
|
|
87
|
+
* added an installer, CI on current Python versions, and rather more
|
|
88
|
+
documentation
|
|
89
|
+
|
|
90
|
+
See the [CHANGELOG](CHANGELOG.md) for the details.
|
|
91
|
+
|
|
92
|
+
### Credit
|
|
93
|
+
|
|
94
|
+
Suplemon was written by **Richard Lewis** ([richrd](https://github.com/richrd))
|
|
95
|
+
and its contributors, and is MIT licensed. The editor, its multi cursor model
|
|
96
|
+
and its interface are all their work. Thank you for building something worth
|
|
97
|
+
keeping alive.
|
|
98
|
+
|
|
99
|
+
Thanks also to the people whose unmerged pull requests were adopted here:
|
|
100
|
+
[bagage](https://github.com/bagage) and
|
|
101
|
+
[joshcangit](https://github.com/joshcangit).
|
|
102
|
+
|
|
103
|
+
If upstream ever picks development back up, the changes here are deliberately
|
|
104
|
+
kept in small, self contained commits so they can be offered back.
|
|
105
|
+
|
|
106
|
+
## Features
|
|
107
|
+
* Proper multi cursor editing, as in Sublime Text
|
|
108
|
+
* Syntax highlighting with Text Mate themes
|
|
109
|
+
* Autocomplete (based on words in the files that are open)
|
|
110
|
+
* Easy Undo/Redo (Ctrl + Z, Ctrl + Y)
|
|
111
|
+
* Copy & Paste, with multi line support (and native clipboard support on X11 / Unix and Mac OS)
|
|
112
|
+
* Multiple files in tabs
|
|
113
|
+
* Powerful Go To feature for jumping to files and lines
|
|
114
|
+
* Find, Find next and Find all (Ctrl + F, Ctrl + D, Ctrl + A)
|
|
115
|
+
* Custom keyboard shortcuts (and easy-to-use defaults)
|
|
116
|
+
* Mouse support
|
|
117
|
+
* Restores cursor and scroll positions when reopenning files
|
|
118
|
+
* Extensions (easy to write your own)
|
|
119
|
+
* Lots more...
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
## Caveats
|
|
123
|
+
* No built in selections (regions). Copy and cut act on whole lines that have a cursor on them; see the "Selecting text" section of the built in help (<kbd>F1</kbd>). To copy part of a line, select it with your mouse and use your terminal's own copy shortcut, usually <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>C</kbd>
|
|
124
|
+
|
|
125
|
+
## Try it!
|
|
126
|
+
|
|
127
|
+
You can clone the repo and run Suplemon from source, or install it. Running
|
|
128
|
+
from source needs `wcwidth`; `pygments` is optional but gives you proper
|
|
129
|
+
syntax highlighting instead of the simpler line based colouring.
|
|
130
|
+
|
|
131
|
+
git clone https://github.com/leancode/suplemon.git
|
|
132
|
+
cd suplemon
|
|
133
|
+
python3 -m venv venv
|
|
134
|
+
./venv/bin/pip install wcwidth pygments
|
|
135
|
+
./venv/bin/python suplemon.py
|
|
136
|
+
|
|
137
|
+
### Installation
|
|
138
|
+
|
|
139
|
+
One line, no sudo, everything under `~/.local`:
|
|
140
|
+
|
|
141
|
+
curl -fsSL https://raw.githubusercontent.com/leancode/suplemon/master/install.sh | sh
|
|
142
|
+
|
|
143
|
+
It checks your platform and Python version, clones or updates the source in
|
|
144
|
+
`~/.local/src/suplemon`, builds a virtualenv, writes a launcher to
|
|
145
|
+
`~/.local/bin/suplemon`, adds an `se` shortcut if that name is free, and puts
|
|
146
|
+
`~/.local/bin` on your `PATH` if it isn't already. Re-run it any time to
|
|
147
|
+
update. Read it first if you'd rather not pipe a script into a shell:
|
|
148
|
+
[install.sh](install.sh).
|
|
149
|
+
|
|
150
|
+
To remove it again:
|
|
151
|
+
|
|
152
|
+
curl -fsSL https://raw.githubusercontent.com/leancode/suplemon/master/uninstall.sh | sh
|
|
153
|
+
|
|
154
|
+
That removes the launchers and `~/.local/src/suplemon`, and keeps
|
|
155
|
+
`~/.local/bin` and your config. Add `--purge` to remove the config too, or
|
|
156
|
+
`--dry-run` to see what it would do first. With the pipe those go after
|
|
157
|
+
`sh -s --`, for example `... | sh -s -- --dry-run`.
|
|
158
|
+
|
|
159
|
+
### Installing as a package
|
|
160
|
+
|
|
161
|
+
The tidiest way is [pipx](https://pipx.pypa.io/), which puts Suplemon and its
|
|
162
|
+
dependencies in their own environment and gives you both a `suplemon` and an
|
|
163
|
+
`se` command:
|
|
164
|
+
|
|
165
|
+
pipx install suplemon-editor
|
|
166
|
+
|
|
167
|
+
The distribution is called `suplemon-editor` because `suplemon` on PyPI is the
|
|
168
|
+
original author's, and `se` there is an unrelated stream editor. The commands
|
|
169
|
+
it installs are still `suplemon` and `se`.
|
|
170
|
+
|
|
171
|
+
To install from a clone of the repo:
|
|
172
|
+
|
|
173
|
+
pipx install .
|
|
174
|
+
|
|
175
|
+
Plain `pip install` works too, but install it into a virtual environment
|
|
176
|
+
rather than system wide. Most current distributions ship a Python marked as
|
|
177
|
+
externally managed (PEP 668) and will refuse `sudo pip install` outright.
|
|
178
|
+
|
|
179
|
+
### Usage
|
|
180
|
+
|
|
181
|
+
suplemon # New file in the current directory
|
|
182
|
+
suplemon [filename]... # Open one or more files
|
|
183
|
+
suplemon [filename:row:col]... # Open one or more files at a specific row or column (optional)
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
### Notes
|
|
187
|
+
- **Python 3.8 or higher.** Python 2 is not supported.
|
|
188
|
+
- *The master branch is considered stable.*
|
|
189
|
+
- *Tested on Linux and FreeBSD.*
|
|
190
|
+
|
|
191
|
+
`wcwidth` is required. `pygments` is optional and recommended; see
|
|
192
|
+
[docs/optional-dependencies.md](docs/optional-dependencies.md) for the rest.
|
|
193
|
+
|
|
194
|
+
### Optional dependencies
|
|
195
|
+
|
|
196
|
+
* Pygments
|
|
197
|
+
> For support for syntax highlighting over 300 languages.
|
|
198
|
+
|
|
199
|
+
* Flake8
|
|
200
|
+
> For showing linting for Python files.
|
|
201
|
+
|
|
202
|
+
* xsel or xclip
|
|
203
|
+
> For system clipboard support on X Window (Linux).
|
|
204
|
+
|
|
205
|
+
* pbcopy / pbpaste
|
|
206
|
+
> For system clipboard support on Mac OS.
|
|
207
|
+
|
|
208
|
+
See [docs/optional-dependencies.md][] for installation instructions.
|
|
209
|
+
|
|
210
|
+
[docs/optional-dependencies.md]: docs/optional-dependencies.md
|
|
211
|
+
|
|
212
|
+
## Description
|
|
213
|
+
Suplemon is an intuitive command line text editor. It supports multiple cursors out of the box.
|
|
214
|
+
It is as easy as nano, and has much of the power of Sublime Text. It also supports extensions
|
|
215
|
+
to allow all kinds of customizations. To get more help hit ```Ctrl + H``` in the editor.
|
|
216
|
+
Suplemon is licensed under the MIT license.
|
|
217
|
+
|
|
218
|
+
## Configuration
|
|
219
|
+
|
|
220
|
+
### Main Config
|
|
221
|
+
The suplemon config file is stored at ```~/.config/suplemon/suplemon-config.json```.
|
|
222
|
+
|
|
223
|
+
The best way to edit it is to run the ```config``` command (Run commands via ```Ctrl+E```).
|
|
224
|
+
That way Suplemon will automatically reload the configuration when you save the file.
|
|
225
|
+
To view the default configuration and see what options are available run ```config defaults``` via ```Ctrl+E```.
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
### Keymap Config
|
|
229
|
+
|
|
230
|
+
Below are the default key mappings used in suplemon. They can be edited by running the ```keymap``` command.
|
|
231
|
+
To view the default keymap file run ```keymap default```
|
|
232
|
+
|
|
233
|
+
* <kbd>Ctrl</kbd> + <kbd>Q</kbd>
|
|
234
|
+
> Exit
|
|
235
|
+
|
|
236
|
+
* <kbd>Ctrl</kbd> + <kbd>W</kbd>
|
|
237
|
+
> Close file or tab
|
|
238
|
+
|
|
239
|
+
* <kbd>Ctrl</kbd> + <kbd>C</kbd>
|
|
240
|
+
> Copy line(s) to buffer
|
|
241
|
+
|
|
242
|
+
* <kbd>Ctrl</kbd> + <kbd>X</kbd>
|
|
243
|
+
> Cut line(s) to buffer
|
|
244
|
+
|
|
245
|
+
* <kbd>Ctrl</kbd> + <kbd>V</kbd>
|
|
246
|
+
> Insert buffer
|
|
247
|
+
|
|
248
|
+
* <kbd>Ctrl</kbd> + <kbd>K</kbd>
|
|
249
|
+
> Duplicate line
|
|
250
|
+
|
|
251
|
+
* <kbd>Ctrl</kbd> + <kbd>G</kbd>
|
|
252
|
+
> Go to line number or file (type the beginning of a filename to switch to it).
|
|
253
|
+
> You can also use 'filena:42' to go to line 42 in filename.py etc.
|
|
254
|
+
|
|
255
|
+
* <kbd>Ctrl</kbd> + <kbd>F</kbd>
|
|
256
|
+
> Search for a string or regular expression (configurable)
|
|
257
|
+
|
|
258
|
+
* <kbd>Ctrl</kbd> + <kbd>D</kbd>
|
|
259
|
+
> Search for next occurrence or find the word the cursor is on. Adds a new cursor at each new occurrence.
|
|
260
|
+
|
|
261
|
+
* <kbd>Ctrl</kbd> + <kbd>T</kbd>
|
|
262
|
+
> Trim whitespace
|
|
263
|
+
|
|
264
|
+
* <kbd>Alt</kbd> + <kbd>Arrow Key</kbd>
|
|
265
|
+
> Add new cursor in arrow direction
|
|
266
|
+
|
|
267
|
+
* <kbd>Ctrl</kbd> + <kbd>Left / Right</kbd>
|
|
268
|
+
> Jump to previous or next word or line
|
|
269
|
+
|
|
270
|
+
* <kbd>ESC</kbd>
|
|
271
|
+
> Revert to a single cursor / Cancel input prompt
|
|
272
|
+
|
|
273
|
+
* <kbd>Alt</kbd> + <kbd>Page Up</kbd>
|
|
274
|
+
> Move line(s) up
|
|
275
|
+
|
|
276
|
+
* <kbd>Alt</kbd> + <kbd>Page Down</kbd>
|
|
277
|
+
> Move line(s) down
|
|
278
|
+
|
|
279
|
+
* <kbd>Ctrl</kbd> + <kbd>S</kbd>
|
|
280
|
+
> Save current file
|
|
281
|
+
|
|
282
|
+
* <kbd>F1</kbd>
|
|
283
|
+
> Save file with new name
|
|
284
|
+
|
|
285
|
+
* <kbd>F2</kbd>
|
|
286
|
+
> Reload current file
|
|
287
|
+
|
|
288
|
+
* <kbd>Ctrl</kbd> + <kbd>O</kbd>
|
|
289
|
+
> Open file
|
|
290
|
+
|
|
291
|
+
* <kbd>Ctrl</kbd> + <kbd>W</kbd>
|
|
292
|
+
> Close file
|
|
293
|
+
|
|
294
|
+
* <kbd>Ctrl</kbd> + <kbd>Page Up</kbd>
|
|
295
|
+
> Switch to next file
|
|
296
|
+
|
|
297
|
+
* <kbd>Ctrl</kbd> + <kbd>Page Down</kbd>
|
|
298
|
+
> Switch to previous file
|
|
299
|
+
|
|
300
|
+
* <kbd>Ctrl</kbd> + <kbd>E</kbd>
|
|
301
|
+
> Run a command.
|
|
302
|
+
|
|
303
|
+
* <kbd>Ctrl</kbd> + <kbd>Z</kbd> and <kbd>F5</kbd>
|
|
304
|
+
> Undo
|
|
305
|
+
|
|
306
|
+
* <kbd>Ctrl</kbd> + <kbd>Y</kbd> and <kbd>F6</kbd>
|
|
307
|
+
> Redo
|
|
308
|
+
|
|
309
|
+
* <kbd>F7</kbd>
|
|
310
|
+
> Toggle visible whitespace
|
|
311
|
+
|
|
312
|
+
* <kbd>F8</kbd>
|
|
313
|
+
> Toggle mouse mode
|
|
314
|
+
|
|
315
|
+
* <kbd>F9</kbd>
|
|
316
|
+
> Toggle line numbers
|
|
317
|
+
|
|
318
|
+
* <kbd>F11</kbd>
|
|
319
|
+
> Toggle full screen
|
|
320
|
+
|
|
321
|
+
## Mouse shortcuts
|
|
322
|
+
|
|
323
|
+
* Left Click
|
|
324
|
+
> Set cursor at mouse position. Reverts to a single cursor.
|
|
325
|
+
|
|
326
|
+
* Right Click
|
|
327
|
+
> Add a cursor at mouse position.
|
|
328
|
+
|
|
329
|
+
* Scroll Wheel Up / Down
|
|
330
|
+
> Scroll up & down.
|
|
331
|
+
|
|
332
|
+
## Commands
|
|
333
|
+
|
|
334
|
+
Suplemon has various add-ons that implement extra features.
|
|
335
|
+
The commands can be run with <kbd>Ctrl</kbd> + <kbd>E</kbd> and the prompt has autocomplete to make running them faster.
|
|
336
|
+
The available commands and their descriptions are:
|
|
337
|
+
|
|
338
|
+
* autocomplete
|
|
339
|
+
|
|
340
|
+
A simple autocompletion module.
|
|
341
|
+
|
|
342
|
+
This adds autocomplete support for the tab key. It uses a word
|
|
343
|
+
list scanned from all open files for completions. By default it suggests
|
|
344
|
+
the shortest possible match. If there are no matches, the tab action is
|
|
345
|
+
run normally.
|
|
346
|
+
|
|
347
|
+
* autodocstring
|
|
348
|
+
|
|
349
|
+
Simple module for adding docstring placeholders.
|
|
350
|
+
|
|
351
|
+
This module is intended to generate docstrings for Python functions.
|
|
352
|
+
It adds placeholders for descriptions, arguments and return data.
|
|
353
|
+
Function arguments are crudely parsed from the function definition
|
|
354
|
+
and return statements are scanned from the function body.
|
|
355
|
+
|
|
356
|
+
* bulk_delete
|
|
357
|
+
|
|
358
|
+
Bulk delete lines and characters.
|
|
359
|
+
Asks what direction to delete in by default.
|
|
360
|
+
|
|
361
|
+
Add 'up' to delete lines above highest cursor.
|
|
362
|
+
Add 'down' to delete lines below lowest cursor.
|
|
363
|
+
Add 'left' to delete characters to the left of all cursors.
|
|
364
|
+
Add 'right' to delete characters to the right of all cursors.
|
|
365
|
+
|
|
366
|
+
* comment
|
|
367
|
+
|
|
368
|
+
Toggle line commenting based on current file syntax.
|
|
369
|
+
|
|
370
|
+
* config
|
|
371
|
+
|
|
372
|
+
Shortcut for openning the config files.
|
|
373
|
+
|
|
374
|
+
* diff
|
|
375
|
+
|
|
376
|
+
View a diff of the current file compared to it's on disk version.
|
|
377
|
+
|
|
378
|
+
* eval
|
|
379
|
+
|
|
380
|
+
Evaluate a python expression and show the result in the status bar.
|
|
381
|
+
|
|
382
|
+
If no expression is provided the current line(s) are evaluated and
|
|
383
|
+
replaced with the evaluation result.
|
|
384
|
+
|
|
385
|
+
* keymap
|
|
386
|
+
|
|
387
|
+
Shortcut to openning the keymap config file.
|
|
388
|
+
|
|
389
|
+
* linter
|
|
390
|
+
|
|
391
|
+
Linter for suplemon.
|
|
392
|
+
|
|
393
|
+
* lower
|
|
394
|
+
|
|
395
|
+
Transform current lines to lower case.
|
|
396
|
+
|
|
397
|
+
* lstrip
|
|
398
|
+
|
|
399
|
+
Trim whitespace from beginning of current lines.
|
|
400
|
+
|
|
401
|
+
* paste
|
|
402
|
+
|
|
403
|
+
Toggle paste mode (helpful when pasting over SSH if auto indent is enabled)
|
|
404
|
+
|
|
405
|
+
* reload
|
|
406
|
+
|
|
407
|
+
Reload all add-on modules.
|
|
408
|
+
|
|
409
|
+
* replace_all
|
|
410
|
+
|
|
411
|
+
Replace all occurrences in all files of given text with given replacement.
|
|
412
|
+
|
|
413
|
+
* reverse
|
|
414
|
+
|
|
415
|
+
Reverse text on current line(s).
|
|
416
|
+
|
|
417
|
+
* rstrip
|
|
418
|
+
|
|
419
|
+
Trim whitespace from the end of lines.
|
|
420
|
+
|
|
421
|
+
* save
|
|
422
|
+
|
|
423
|
+
Save the current file.
|
|
424
|
+
|
|
425
|
+
* save_all
|
|
426
|
+
|
|
427
|
+
Save all currently open files. Asks for confirmation.
|
|
428
|
+
|
|
429
|
+
* sort_lines
|
|
430
|
+
|
|
431
|
+
Sort current lines.
|
|
432
|
+
|
|
433
|
+
Sorts alphabetically by default.
|
|
434
|
+
Add 'length' to sort by length.
|
|
435
|
+
Add 'reverse' to reverse the sorting.
|
|
436
|
+
|
|
437
|
+
* strip
|
|
438
|
+
|
|
439
|
+
Trim whitespace from start and end of lines.
|
|
440
|
+
|
|
441
|
+
* tabstospaces
|
|
442
|
+
|
|
443
|
+
Convert tab characters to spaces in the entire file.
|
|
444
|
+
|
|
445
|
+
* toggle_whitespace
|
|
446
|
+
|
|
447
|
+
Toggle visually showing whitespace.
|
|
448
|
+
|
|
449
|
+
* upper
|
|
450
|
+
|
|
451
|
+
Transform current lines to upper case.
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
## Support
|
|
455
|
+
|
|
456
|
+
If you experience problems, please
|
|
457
|
+
[open an issue](https://github.com/leancode/suplemon/issues) on this fork.
|
|
458
|
+
|
|
459
|
+
The original project pointed people at #suplemon on Freenode. Freenode
|
|
460
|
+
effectively ended in 2021 and that channel is gone, so GitHub issues are the
|
|
461
|
+
place now.
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
## Development
|
|
465
|
+
|
|
466
|
+
If you are interested in contributing to Suplemon, development dependencies can be installed via:
|
|
467
|
+
|
|
468
|
+
# For OS cleanliness, we recommend using `virtualenv` to prevent global contamination
|
|
469
|
+
pip install -r requirements-dev.txt
|
|
470
|
+
|
|
471
|
+
After those are installed, tests can be run via:
|
|
472
|
+
|
|
473
|
+
./test.sh
|
|
474
|
+
|
|
475
|
+
### Releasing
|
|
476
|
+
|
|
477
|
+
./release.sh 0.3.1 # bump, commit, tag, push
|
|
478
|
+
./release.sh 0.3.1 --publish # the same, then create the GitHub release
|
|
479
|
+
|
|
480
|
+
Publishing to PyPI happens in
|
|
481
|
+
[.github/workflows/publish.yml](.github/workflows/publish.yml), triggered by a
|
|
482
|
+
published GitHub release rather than by the tag, so tagging and publishing stay
|
|
483
|
+
separate decisions. It uses
|
|
484
|
+
[PyPI Trusted Publishing](https://docs.pypi.org/trusted-publishers/), so no API
|
|
485
|
+
token exists on any machine or in any repository secret.
|
|
486
|
+
|
|
487
|
+
The trusted publisher on PyPI is configured as:
|
|
488
|
+
|
|
489
|
+
| Field | Value |
|
|
490
|
+
| --- | --- |
|
|
491
|
+
| PyPI project name | `suplemon-editor` |
|
|
492
|
+
| Owner | `leancode` |
|
|
493
|
+
| Repository name | `suplemon` |
|
|
494
|
+
| Workflow name | `publish.yml` |
|
|
495
|
+
| Environment name | `pypi` |
|
|
496
|
+
|
|
497
|
+
Both the workflow and `release.sh` refuse to publish if the distribution name
|
|
498
|
+
is `suplemon`, which is the original author's package.
|
|
499
|
+
|
|
500
|
+
PRs are very welcome and appreciated. **Target `master`.**
|
|
501
|
+
|
|
502
|
+
The original project asked for PRs against `dev`, because releases were cut
|
|
503
|
+
from `master`. That no longer applies: upstream's `dev` last moved in June
|
|
504
|
+
2020 and is behind this fork by everything listed at the top of this file.
|
|
505
|
+
This fork develops on `master` directly, with each change on its own short
|
|
506
|
+
lived branch, so `master` is always the current state.
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
## Rationale
|
|
510
|
+
For many the command line is a different environment for text editing.
|
|
511
|
+
Most coders are familiar with GUI text editors and for many vi and emacs
|
|
512
|
+
have a too steep learning curve. For them (like for me) nano was the weapon of
|
|
513
|
+
choice. But nano feels clunky and it has its limitations. That's why
|
|
514
|
+
I wrote my own editor with built in multi cursor support to fix the situation.
|
|
515
|
+
Another reason is that developing Suplemon is simply fun to do.
|