compsci-missing_semester_2020/_subsections/lesson-03.org
2025-07-16 22:10:36 +03:00

92 lines
2.7 KiB
Org Mode
Executable file

#+title: Lesson 03 | text editors (vim)
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../_share/media/css/missing-semester.css" />
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../_share/media/css/org-media-sass/collapsible.css" />
#+HTML_HEAD: <script src="../_share/media/js/collapsible.js"></script>
#+OPTIONS: H:6
* Links
#+attr_html: :class links
- [[../toc.org][TOC | Missing Semester]]
- [[https://www.youtube.com/playlist?list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J][Playlist: Missing Semester]]
- [[https://missing.csail.mit.edu/2020/editors/][class notes]]
- Curr: https://youtu.be/a6Q8Na575qc?si=B-yLC3sGZxqQhOTb&t=2258
*** timestamps
:PROPERTIES:
:CUSTOM_ID: timestamp
:END:
#+attr_html: :class playlist
+ [[https://www.youtube.com/watch?v=a6Q8Na575qc][00:00 - introduction]]
+ [[https://youtu.be/a6Q8Na575qc?si=qzD5HiycrEhplKeQ&t=285][04:45 - modal editor]]
+ [[https://youtu.be/a6Q8Na575qc?si=ra-MbPQpbKzAcJnP&t=571][09:30 - opening vim]]
+ [[https://youtu.be/a6Q8Na575qc?si=OyhOfX2ft9w7O9kM&t=1020][17:00 - buffers vs windows]]
+ [[https://youtu.be/a6Q8Na575qc?si=gyYNZk4_XiXVk_4a&t=1217][20:17 - movement keys]]
+ [[https://youtu.be/a6Q8Na575qc?si=QysgH5bMEG0bigKq&t=1530][25:30 - editing commands]]
+ [[https://youtu.be/a6Q8Na575qc?si=_gbAQlOZ_irCdHt6&t=1797][29:54 - questions]]
+ [[https://youtu.be/a6Q8Na575qc?si=4VwNEC040Jna5znz&t=2254][37:33 - demo]]
+ [[https://youtu.be/a6Q8Na575qc?si=0qDOcyT0WX1U4RXB&t=2682][44:42 - vim configuration]]
* notes
** modes
*** normal mode
- not editing directly
- default
- get to it via ESC
*** insert mode
- i
- pushes text aside
*** replace mode
- R (capital 'r')
- overwrites text
*** visual mode
- line visual: Shift+V
- goes by line
- block visual: Ctrl+V
- allows you to select vertical and horizontal
*** command line
** opening vim
- entered via ':'
** buffers vs windows
- vim maintains a set of open buffers
- any buffer can be open in 0 or more windows at any time
- you can have tabs, and tabs can contain windows
*** quiting
- :q only closes the current WINDOW, not buffer
- :q exits when there are no more windows open
- :qa is "quit all" and closes all windows
** movement
- hjkl
- w/b forward and backward by one word
- e end of word
- 0/$ beginning and end of line
- ^ first non empty character on a line
*** scrolling up and down
- C+U move up
- C+D move down
*** move by buffer
- G moves to end of buffer
- gg move to top of buffer
*** move by screen
- L moves to lowest line on screen
- M moves to middle line on screen
- H moves to the highest on screen
*** move by find
- f <letter> will move to the first letter forward
- F <letter> backwards
- t <letter> moves to just before the letter
- T <letter> moves backwards to in front of the letter
** editing commands