Takumf

lesson-2.org

Jan 4th, 2015
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.75 KB | None | 0 0
  1. #+STARTUP: indent
  2. #+STARTUP: hidestars
  3. #+STARTUP: oddeven
  4. #+STARTUP: odd
  5.  
  6. * What we have learned so far
  7. ** About Emacs
  8. We got some basic commands that allows us to do all of the things
  9. that can be accomplished in any other editor. What may have been
  10. a bit new, is the fact we got the mini-buffer and basically no use
  11. for mouse. I know that this can be clunky at the start, but trust
  12. me that just like in most other cases, effort you put into learning
  13. yields great increase in the productivity. It is not to say that
  14. other text-editors are bad or could not be used just as easily, but
  15. there is one difference: under Emacs making well formatted lists
  16. (org-mode), own dictionaries, small programs (that work from under
  17. the text-editor itself!) and similar content requires much more
  18. work.
  19. I hope you enjoy it so far. If not, I can only admire your spirit.
  20. ** About org-mode
  21. This particular tool is not just for making lists. Like most parts
  22. of Emacs, this is more like a toolbox that encourages experiments
  23. and learning some of its internal workings so that you can make it
  24. as personalised and fitting your needs as possible. Most common use
  25. of org-mode is making TODO lists. But it is not all. With next parts
  26. of this tutorial you will learn how to interlink your files, make
  27. your notes more organised and providing you with some (not only)
  28. org-mode based tools that will make GMing more expedious.
  29. * What we will learn today
  30. ** Work with org-mode
  31. Pretty self-explanatory. One of the reasons I made this lesson
  32. with org-mode is to let you practice a bit more with this (likely)
  33. new format. Remember that at any point you can ask for help at the
  34. /r/rpgprograms submission for this lesson or send me a PM if the
  35. topic will be sent to archive (this means you are reading it quite
  36. some time into the future. Good to know :D). Not much for now, but
  37. I feel that some more Emacs fundamentals are in order.
  38. *** Wait, really? This is it?!
  39. Actually, no. I want you to complete points below and with newly
  40. acquired knowledge and skills make your first adventure in with
  41. org-mode.
  42. *** What if I need help?
  43. I have provided you with most of the needed tools in previous
  44. lesson and this file itself is (IMHO) a pretty good example that
  45. shows how to use it. But, I understand the different needs.
  46.  
  47. In that case, look for the org-mode manual I have linked in the
  48. last lesson and try using auto-completion trick I provided within
  49. next points.
  50. ** Check spelling
  51. Yes, this part. I made a lot of fuss about installing spell-check
  52. software and it didn't come up until this point. Now it is your
  53. chance to learn it with a perfect example: my off-head spelling in
  54. this document. To make it more of a learning experience, next point
  55. on the list will contain some deliberate mistakes as well as ones
  56. that I simply did on account on being a sloppy foreigner.
  57. Read next sub-point fully before doing the exercise!
  58. *** How do I do this thing?
  59. Go into the mini-buffer (M-x, I hope this hint is not needed at
  60. this point, or rekwired if you will) and type
  61.  
  62. ispell-buffer
  63.  
  64. you will see a new interface on top of the standard Emacs buffer.
  65. This is where you will proceed with the changes. Hit C-h or ?,
  66. your choice, and remember the help you will be provided. You can
  67. invoke it at any point, end the ispell by hitting standard C-g
  68. combination that will make ispell go away (but changes will stay).
  69. If you want to undo something, remember that you can undo changes
  70. commited in reverse order by hitting C-/
  71. ** Emacs split-screens
  72. This is actually insanely usefull feature for GM (and programmer for
  73. that matter) that will allow to browse more documents simultaneously.
  74. *** How do I make vertically splited screen?
  75. C-x 3
  76.  
  77. Yes, it is all. You will likely see duplicate of file you have had
  78. open while executing the command listed above. You can switch the
  79. current buffer by hitting
  80.  
  81. C-x o
  82.  
  83. that will result in cursor jumping from one screen to another.
  84. *** How do I make horizontally splitted screen?
  85. C-x 2
  86.  
  87. As above. Same with jumping between screens. Try using them in
  88. a nested way. To state it explicitly, split screen vertically
  89. and then split one of them horizontally. You can go as deep as some
  90. internal Emacs setting allows, likely the one about minimal size
  91. of screens. For GMing purposes you will likely don't need more then
  92. 3 screens anyway. One for notes, one to swap character sheets and
  93. the last one where you will keep some programs that we will learn
  94. how to write in the later parts of the tutorial.
  95. *** How can I close screens?
  96. C-x 0
  97.  
  98. This will result in closing currently selected screen.
  99.  
  100. C-x 1
  101.  
  102. This will close ALL screens other then currently selected.
  103. ** How can I work on many files?
  104. Previous part about splitting screen will become more usefull now,
  105. when you will start working on multiple files with multiple buffers.
  106. When you will open all of the files you want, you might want to start
  107. adjusting screens.
  108. *** Open/create a file
  109. C-x C-f
  110.  
  111. Followed by locating a file you want to open. If the file does not
  112. exist, it will be created, provided you have typed a valid name.
  113. *** Saving files
  114. C-x C-s
  115.  
  116. Yes, it is all.
  117. *** I did not split screen. How do I browse opened files?
  118. Good question. You will have to use
  119.  
  120. C-x b
  121.  
  122. and either confirm default (last file you were working with),
  123. start writing a name of file you want to open (if default selection
  124. is not what you want) or hit TAB and select buffer you wish to
  125. switch to.
  126.  
  127. It is worth to note, that you can hit TAB at any point, to signalise
  128. to Emacs (and command line in Cygwin, Linux or plain Windows!) that
  129. you want it to list all options that apply. Try it out.
  130. ** About the files, how do I move?
  131. If you went through the tutorial you would know. But I am not
  132. a dick and will give you now a quick list.
  133. *** Going down
  134. C-v
  135. *** Going up
  136. M-v
  137. *** How can I center screen on the cursor?
  138. C-l
  139. *** Is it all?
  140. Mostly. For nearly all of the non-programming stuff you will
  141. do this is all you will need.
  142. *** What about PgDn and PgUp?
  143. They work in the same way as anywhere else. But they are so
  144. far from other keys (at least at the most keyboards I ever
  145. used). Take it or leave it.
  146. ** How can I switch Emacs OFF!?
  147. Oh, good point. Never mentioned it before.
  148.  
  149. C-x C-c
  150.  
  151. And it will quit unless you have some unsaved work.
  152. Then you will get prompted about what to do.
  153. * What do I know now?
  154. ** Honestly?
  155. A lot. Really. With practice you will get fluent and the stuff
  156. you just learned is about 90% of the combinations of keys and
  157. commands I use on a daily basis.
  158. ** Not so honestly?
  159. Still a lot. But you have only scratched the surface by this
  160. point. Practice, curiosity and experimenting/reading on your
  161. own will provide you with more of the stuff you need.
  162.  
  163. Having said that, you know about as much as nothing about the
  164. meat of the Emacs: its own programming language. Emacs Lisp.
  165.  
  166. Even for most Emacs users it is not as obligatory as it seems,
  167. but without knowing it you know only the mundane parts. Think
  168. of it in that way: now you have learned cantrips. Real magic
  169. is built upon knowing them.
  170. *** Did you lie to me?
  171. No. I will teach you about it, provided you actually want to
  172. learn.
  173. **** Trade secret
  174. Generally speaking, if you are still interested by this
  175. point and you are willing to train both fundamentals and
  176. new things, you are ready. Fact that you are still reading
  177. is a good sign.
  178. * What we will learn in the upcomming lessons?
  179. ** More details about org-mode
  180. Like I said, there is much more. I will show you how I am making
  181. my own scenarios with use of org-mode and how I am making notes
  182. so that all the things I want to find easily can be accessed in
  183. a fast way.
  184. ** Searching through files and buffers
  185. No matter how awesome your notes are, you have to know how to
  186. access the information. I will give a short tutorial about the
  187. basics of regular expressions, searching and obtaining result.
  188. ** Emacs Lisp
  189. While it is perfectly understandable that your players will want
  190. to roll for themselves, I don't know if you would like to do so
  191. for your larger groups of NPCs. This will take a lot of parts, but
  192. I will show you how you can make a full program in Emacs Lisp that
  193. will allow you to track state of all of the minions you would in
  194. any other situation had to manage yourself.
  195.  
  196. To avoid licensing problems and overly elaborate example, I will
  197. show you how to do it on basic d20 system.
  198. * The end?
  199. ** I don't want to continue!
  200. No-one forces you to continue. I hope you will respect the fact
  201. that I will continue with making further parts of the tutorial.
  202.  
  203. All I want is you to be respectfull of people who will want to
  204. proceed.
  205. ** I want to continue!
  206. Good to know. I hope I will resume the tutorial in the next two
  207. or three days. It would be awesome of you to post the 'homework'
  208. I assigned at the beginning (your own adventure).
Advertisement
Add Comment
Please, Sign In to add comment