Learning Emacs, for the beginner is a painful process. The goal is in getting comfortable with using Emacs in doing basic tasks so Emacs will become a tool of first choice.
Emacs is a very powerful and efficient solution provider.
To leverage that power and efficiency, it needs to be used as often as possible. For the beginner, that means simple tasks, and build more complex actions to harness the strength of Emacs.
There is Dired, Org-mode, themes, many programming languages are covered.
Org-mode is a powerful tool on it's own.
Org-Mode Demo
https://www.youtube.com/watch?v=hnMntOQjs7Q
The Emacs Text File TLDR Reference:
When you type a command, and realize you don't want to do that:
Ctrl-g
This escapes the current active command.
Open an existing text file, or create a new one, in the /home/user directory:
Ctrl-x Ctrl-f <type>What-is-Forth.txt [RET] or (Enter)
If the text file exists, this will open the Existing Document.
When the text file doesn't exist, this will create a New Document.
Now Type something:
FORTH is an interactive language best explained by example.
Disadvantages of the Forth Programming Language:
1.FORTH systems don't have floating-point arithmetic. This is not a fault of the language; rather, it reflects its history in microcomputer
control applications, where integer arithmetic is often needed for speed. Now there is more pressure for floating point, and it is becoming available.
2. FORTH is not a typed language (unlike Pascal). For example, if an integer operation is performed on a floating-point quantity, no message is printed either at compile time or at run time to warn of this error. (However, the user can add type checking and other error-preventing operations into any FORTH word.)
It may seem that unreliable code would result from the untyped nature of FORTH, but, in fact, FORTH code is remarkably solid and bug-free. The modularity and excellent testing environment aid error control; and type mismatches are less dangerous than most other mistakes because they are easy to detect.
3. FORTH is its lack of a directory file structure. Again, this is historical and is not a characteristic of the language, which can be developed to use any kind of files.
The traditional FORTH file system is primitive, but in practice it has worked very well. The entire disk (or disks) is a single virtual array of blocks numbered from 1, with the block size standardized at 1024 bytes regardless of physical disk sector size.
The blocks (called screens because they can be displayed as sixteen 64-character lines on a terminal) are automatically buffered so that they are physically read and written only when necessary. A LOAD command will read a given screen and treat the information exactly as if it had been typed in a terminal session, thereby compiling source code or executing commands (depending on the contents of the screen). The LOAD instruction can be executed within a screen; in this way, a single LOAD command can control the compilation of large source programs.
This disk-based file system allows any part of the disk to be read or written with a single access. Load screens or data areas can be saved by name, and portions of the disk can be protected by redefining the names of a few input and output operations so that they check before writing and/or reading.
The disadvantage of this system is that there is no directory; when a new disk is inserted, the user or the program must know the block numbers for load screens and data files.
4. The most important criticism of FORTH is that its source programs are difficult to read. Some of this impression results from unfamiliarity with a language different from others in common use. However much of it results from its historical development in systems work and in read-only-memory-based machine control, where very tight programming that sacrifices clarity for memory economy can be justified. Today's trend is strongly toward adequate commenting and design for readability.
5. FORTH enforces extreme modularity, so the decomposition of each task into component parts is critical. Top-down design is especially important. Large jobs should be written as application-oriented libraries of operations to make team-work and maintenance easier. A much larger fraction of the total programming effort is spent on design, with less on coding and debugging. For these and other reasons, FORTH creates its own issues of style, which are only beginning to be explored.
Reference: August 1980 Byte Publications Inc. Article: What Is FORTH? A Tutorial Introduction by John S. James
Link: https://archive.org/details/byte-magazine-1980-08
Move forward one word at a time:
Alt-f
Move Backward one word at a time:
Alt-b
Move to a line Forwards/Down:
Ctrl-n
Move to a line Backwards/Up:
Ctrl-p (up/backwards)
Line Numbers, turn on:
Alt-x <type> display-line-numbers-mode [RET] or (Enter)
Go To Line Number:
Alt-x goto-line [RET] <type the number of the line> [RET] or (Enter)
Highlight (Mark) words, sentences or paragraphs:
Ctrl-Space-bar (Use arrow keys to move the cursor to the end of the selection)
Select All:
Ctrl-x (No Ctrl) h
Copy highlighted content to clipboard:
Alt-w
Cut highlighted content to clipboard:
Ctrl-w
Paste content from clipboard:
Ctrl-y
Save file:
Ctrl-x ctrl-s
At the bottom of the Buffer you can see,
Wrote /home/user/name-of-text-file.txt
Meaning the file has been saved.
Emacs will auto-save the file during a period of inactivity.
File/Directory Viewer called 'Dired':
See the current working directory (/home/user) instead of open a document:
Ctrl-x Ctrl-f [RET] or (Enter)
Black fonts are files.
Blue fonts are directories.
Place the cursor on a Blue Directory, [RET] navigates to that Directory.
Yes. the location of where you place the text files can be changed.
Next time you open a file, the last active directory will be the current working directory.
When you want to go to a specific sub-directory, like Downloads or Documents:
Ctrl-x Ctrl-f <type> /Downloads [RET]
Now you are in the Downloads folder.
Close the active buffer (Text file)
Ctrl-x (No CTRL) k [RET]
Kill this buffer. Note, if you type something you will get (yes/no/save and kill this buffer):
Open a new buffer (To start working on another text file, new or existing)
Ctrl-x Ctrl-b
Will open the directory where your files are stored when there is only one buffer.
Ctrl-x b
Will open the buffer list.
How to Search inside an opened text file:
Find Forward:
Ctrl-s
This highlights the next forward item, but also highlights all occurences.
Find Backward:
Ctrl-r
Change font size:
Ctrl-x Ctrl-= (Then use + or - to adjust the size. Any other key presses stop this feature)
Ideally, you want to keep your hands on the keyboard all the time.
Keeping your hands on the keyboard makes you a more productive typist or programmer.
Maybe you have noticed that 'Ctrl-y' requires 2 hands, or an extreme stretch with your pinky and index fingers.
Emacs is highly configurable, and you can assign a more comfortable key arrangement.
Altering your key combo's is a more advanced topic not covered in this Simple Text File Tutorial.
I hope you find this Toot useful.
-Tsedek1