Added a bunch of things

This commit is contained in:
qorg11 2020-05-25 03:10:22 +02:00
parent df22fead50
commit 968ddaeec1
9 changed files with 117 additions and 4 deletions

View File

@ -0,0 +1,31 @@
# Getting help about Emacs
Emacs is a very big software and you'll surely will need help about
it. There are some ways to get help on Emacs.
## Self documenting text editor
Emacs claims to be a *self-documenting* text editor. And it's true:
Emacs has a lot of built-in documentation. For example. If you don't
know what the C-r keybindings do, you can do this:
C-h k C-r_
Emacs will split and will show what the keybindings you gave does.
Emacs has a built-in tutorial. You can access to it by pressing C-h t.
## Getting help from another users
You can talk to other Emacs users and ask them for help on some sites:
* [Emacs stack exchange](https://emacs.stackexchange.com/)
* [The help-gnu-emacs mailing list](https://lists.gnu.org/archive/html/help-gnu-emacs/)
* #emacs on freenode
## Tips about emacs
There's a [twitter account](https://twitter.com/iLemming) which post
tips about Spacemacs and Emacs. The account's owner also posts useful
packages you can install in Emacs.

View File

@ -37,6 +37,7 @@ love it more than "comfortable" Vim key bindings.
If moving character by character is too slow, you can try using the
M-f and M-b to move word by word. M-p and M-n don't do anything. So
don't try it.
## Moving even faster
Sometimes you just have to go to the end or beginning of the

View File

@ -0,0 +1,72 @@
# Editing files on Emacs
Emacs is a text editor. So its main function is to edit text. You can
open a file with C-x C-f ```(find-file)``` and type the name of the
file you want to open, for example:
C-x C-f myfile
That will create a buffer[^1] which your file's contents.
There is another ways to visit a file in Emacs. for example:
C-x C-r `(file-find-read-only)`: This will open a file but won't allow
you to make changes on it.
C-x 4 f `(find-file-other-window)`: This splits your Emacs window
vertically and puts the selected file you gave on the buffer bellow
C-x 5 f `(find-file-other-frame)`: This opens another Emacs window[^2]
and puts the selected file on a new buffer.
# Opening remote files
Emacs comes with TRAMP which can be used to open remote files. To open
a remote file. Press C-x C-f ```(find-file)``` and follow this syntax:
~~~
/method:host:filename
/method:user@host:filename
/method:user@host#port:filename
~~~
If you don't gave a method (put - as method) Emacs do the following:
1. If `host` starts with ftp, Emacs will use ftp
2. If `user` is "*ftp*" or "*anonymous*" Emacs will use ftp.
3. If the variable `tramp-default-method` is ftp, Emacs will use ftp.
4. If ssh-agent is running, Emacs will use ftp.
5. Otherwise, Emacs will use ssh.
Try opening this remote file: `ftp://test.rebex.net/readme.txt`
To do this, press C-x C-f ```(find-file)``` and type this
/ftp:demo@test.rebex.net:/readme.txt
Emacs will ask for a password. This password is `password`
This is a read only ftp server, but if it allowed write, you could
write the remote file with C-x C-s `(save-buffer)`
## Writing text
To add text to a buffer, you just type what you want to add on the
buffer, unlike Vi/Vim Emacs do not have an "INSERT" mode.
When you finish typing and want to save what you have done press C-x C-s `(save-buffer)`
## Reverting edits on Emacs
Emacs, like every other text editor, allows to undo what you've done.
If you have done massive changes to a file and want to revert it, type
`M-x revert-buffer` Emacs will ask confirmation. Since this reverts to
the saved version of the buffer. If you saved the file after some
changes, this method will not work. You can undo your last change to
the file with some shorcuts: C-x u, C-/ and C-_ `(undo)`
[^1]: A buffer is where the text resides on your Emacs window,
everything in Emacs is a buffer. In other words, a buffer holds
your text file.
[^2]: This is not a new Emacs run, it is called a "frame" These
two emacs window shares the opened buffers.

View File

@ -2,7 +2,7 @@
Emacs (short for Editor MACroS) is a text editor[^1] made by some
weird guy in the late 70s, and had too many implementations, such as
Xemacs, Freemacs, µEmacs (microemacs). in 1984 (lmao), the GNU project ~~stole~~
XEmacs, Freemacs, µEmacs (microemacs). in 1984 (lmao), the GNU project ~~stole~~
rewrote the original Emacs code and the most used version of Emacs was
born: GNU Emacs.
@ -10,7 +10,7 @@ born: GNU Emacs.
Windows users: <https://ftp.rediris.es/mirror/GNU/emacs/windows/> (Or their nearly GNU mirror)
Mac Users: brew install emacs, I guess.
Mac Users: brew install Emacs, I guess.
GNU/Linux users: probably the "emacs" package on your distro's repos
@ -20,8 +20,8 @@ Plan 9 users: What are you doing here?
# Other versions of Emacs
As mencioned above, there are other versions of emacs, most of them
are obsolete (Xemacs for example). µEmacs is the emacs version used
As mentioned above, there are other versions of emacs, most of them
are obsolete (XEmacs for example). µEmacs is the emacs version used
by Linus Torvalds[^2] I do not recommend to use it. If you want to use
a mini Emacs, you should try [Zile](https://gnu.org/software/zile) or
[Jed](http://www.jedsoft.org/jed/). Zile is stupidly minimum while Jed
@ -30,6 +30,15 @@ real GNU Emacs.
You can find more about Emacs on the sidebar.
# Information about Emacs
In Emacs, everything is an Emacs Lisp function, each keybinding, every
M-x function is written in Emacs Lisp, Emacs Lisp is a complete
programming language. So that's why you can see browsers inside Emacs.
In this book, I'll write the name of the function in front of a
keybinding. Because they're pretty self explanatory
**Highly work in progress, please [contribute](https://gitlab.com/qorg11/kill9)**
[^1]: Some people call it a "operating system", but I prefer to call it a Emacs Lisp interpreter.