A Python + Tkinter text editor that adds 4 spaces before every line.
Reddit's Deluxe Editor is buggy when pasting. Markdown mode works better, but an extra 4-space-indentation needs to precede every line. Or you prepare your code in this editor and click "Done".
- Empty lines preceding and trailing your code are added.
- 4 leading spaces are added to every code line.
- The TAB character is replaced by 4 spaces.
Your altered code gets copied to the clipboard and can be pasted into Reddit's Markdown editor.
Python 3.4+
Move the script file to a directory in your $PATH
and give permission to run as a program.
user@machine:~/Downloads$ mv redcode.py ~/.local/bin/redcode
user@machine:~/Downloads$ chmod +x ~/.local/bin/redcode
user@machine:~/Downloads$
user@machine:~/Downloads$ # Run by calling from command line.
user@machine:~/Downloads$ redcode
user@machine:~/Downloads$
Installation on Windows may differ.
- Enter text you want to insert as codeblock on Reddit.
- Do some editing (optional).
- Click "Done" to copy re-formatted code to clipboard.
- Paste in Reddit's Markdown mode.
- Type everything from scratch or
- Copy & Paste existing code or
- Load file contents by clicking "Open".
TABs can't be set to a fixed number of characters. Their width is 1 cm here, but they will have 4 spaces after copying.
Sensitive information can be censored. Select text and click Edit > Censor
. Text appears strikethrough and is blackened before being copied to clipboard.
Issues: For now, there's no option to de-censor text. Also, censored text spanning multiple lines will remove the line break.
Search for a file to open, starting in the most recent directory.
Runs on my Linux machine, but that's as far as testing went.