From d012a9ef7716040023ba587a76f53e6bd1dec60d Mon Sep 17 00:00:00 2001 From: cfculler Date: Fri, 22 Dec 2023 09:31:43 -0800 Subject: [PATCH 1/2] Added two quizzes about vim --- docs/1-introduction/1.3.2-vim.md | 10 ++++ src/quizzes/chapter-1/1.3.2/vim-modes-quiz.js | 35 +++++++++++ .../chapter-1/1.3.2/vim-specifics-quiz.js | 60 +++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 src/quizzes/chapter-1/1.3.2/vim-modes-quiz.js create mode 100644 src/quizzes/chapter-1/1.3.2/vim-specifics-quiz.js diff --git a/docs/1-introduction/1.3.2-vim.md b/docs/1-introduction/1.3.2-vim.md index 16be74ed..d6cb7ca5 100644 --- a/docs/1-introduction/1.3.2-vim.md +++ b/docs/1-introduction/1.3.2-vim.md @@ -109,6 +109,16 @@ Normal mode. ?> To learn more about Vim, use the command `vimtutor` in your terminal to run through a tutorial that explores more advanced commands. +Time for a few simple quizzes. Let's start off by making sure you're familiar with the basic mode differences +
+
+
+ +Now let's explore some more specifics of each mode +
+
+
+ # Deliverables - Discuss the benefits of using Vim in your workflow diff --git a/src/quizzes/chapter-1/1.3.2/vim-modes-quiz.js b/src/quizzes/chapter-1/1.3.2/vim-modes-quiz.js new file mode 100644 index 00000000..0eda6859 --- /dev/null +++ b/src/quizzes/chapter-1/1.3.2/vim-modes-quiz.js @@ -0,0 +1,35 @@ +const rawQuizdown = ` +--- +shuffleQuestions: true +--- + +# This Vim mode is made up of shortcuts to jump the cursor around and enter additional modes + +1. [x] Normal Mode +1. [ ] Insert Mode +1. [ ] Visual Mode +1. [ ] Command Mode + +# This Vim mode is the mode that you will typically be in and acts as Vim's text editor + +1. [ ] Normal Mode +1. [x] Insert Mode +1. [ ] Visual Mode +1. [ ] Command Mode + +# This Vim mode handles text manipulation via copy/paste methods + +1. [ ] Normal Mode +1. [ ] Insert Mode +1. [x] Visual Mode +1. [ ] Command Mode + +# This Vim mode is how you directly save and exit (write and quit) the file + +1. [ ] Normal Mode +1. [ ] Insert Mode +1. [ ] Visual Mode +1. [x] Command Mode +`; + +export { rawQuizdown } \ No newline at end of file diff --git a/src/quizzes/chapter-1/1.3.2/vim-specifics-quiz.js b/src/quizzes/chapter-1/1.3.2/vim-specifics-quiz.js new file mode 100644 index 00000000..0fd181ca --- /dev/null +++ b/src/quizzes/chapter-1/1.3.2/vim-specifics-quiz.js @@ -0,0 +1,60 @@ +const rawQuizdown = ` +--- +shuffleQuestions: true +shuffleAnswers: true +--- + +# A file has the following contents:
+\`text tex|t text\`
+The '|' signifies where the cursor is at
+Vim is in normal mode

+What are the contents of the file after the following commands are entered?
+\`w\`
+\`a\`
+\`NEW\` + +1. [x] text text tNEWext +1. [ ] text text NEWtext + > Look above to recall what the \`w\` and \`a\` shortcuts do +1. [ ] text text textNEW + > Look above to recall what the \`w\` and \`a\` shortcuts do +1. [ ] text textNEW text + > Look above to recall what the \`w\` and \`a\` shortcuts do +1. [ ] text texNEWt text + > Look above to recall what the \`w\` and \`a\` shortcuts do + +# A file has the following contents:
+\`text\`
+Vim is in normal mode

+What are the contents of the file after the following commands are entered?
+\`yy\`
+\`p\`
+\`p\` + +1. [x] text
text
text +1. [ ] text text text + > Look above to recall what the \`yy\` and \`p\` shortcuts do +1. [ ] texttexttext + > Look above to recall what the \`yy\` and \`p\` shortcuts do + +# While in normal mode, which of the following commands will yield different results depending on where in the line your cursor is at? + +- [x] a +- [x] w +- [x] e +- [x] b +- [ ] $ + > This will jump your cursor to the end of the line no matter where it's at +- [ ] 0 + > This will jump your cursor to the beginning of the line no matter where it's at +- [ ] o + > This will insert a new line below the current line no matter where the cursor is at +- [ ] O + > This will insert a new line above the current line no matter where the cursor is at +- [ ] A + > This will jump your cursor to the end of the line (and enter insert mode) no matter where it's at +- [ ] yy + > This will copy the current line no matter where your cursor is at +`; + +export { rawQuizdown } \ No newline at end of file From 4b86cd97c5d2337fe41b7bbfef49b5f54efce380 Mon Sep 17 00:00:00 2001 From: cfculler Date: Fri, 22 Dec 2023 14:35:34 -0800 Subject: [PATCH 2/2] combined quizzes, added questions, and added commands to docs page --- docs/1-introduction/1.3.2-vim.md | 11 ++--- src/quizzes/chapter-1/1.3.2/vim-modes-quiz.js | 35 -------------- .../{vim-specifics-quiz.js => vim-quiz.js} | 47 ++++++++++++++++++- 3 files changed, 50 insertions(+), 43 deletions(-) delete mode 100644 src/quizzes/chapter-1/1.3.2/vim-modes-quiz.js rename src/quizzes/chapter-1/1.3.2/{vim-specifics-quiz.js => vim-quiz.js} (61%) diff --git a/docs/1-introduction/1.3.2-vim.md b/docs/1-introduction/1.3.2-vim.md index d6cb7ca5..844443bd 100644 --- a/docs/1-introduction/1.3.2-vim.md +++ b/docs/1-introduction/1.3.2-vim.md @@ -57,6 +57,9 @@ expect them to. Here are some commands that will work: | `$` | Move cursor to the end of the line | | `yy` | Copy current line into buffer | | `p` | Paste line in buffer | +| `gg` | Move cursor to beginning of file | +| `G` | Move cursor to beginning of last line in file | +| `^` | Move cursor to first non-blank character in the current line | There are many other ways of inserting text and navigating the file but these are some of the easiest examples. Remember that Vim is not made to stay in insert mode @@ -109,14 +112,8 @@ Normal mode. ?> To learn more about Vim, use the command `vimtutor` in your terminal to run through a tutorial that explores more advanced commands. -Time for a few simple quizzes. Let's start off by making sure you're familiar with the basic mode differences
-
-
- -Now let's explore some more specifics of each mode -
-
+
# Deliverables diff --git a/src/quizzes/chapter-1/1.3.2/vim-modes-quiz.js b/src/quizzes/chapter-1/1.3.2/vim-modes-quiz.js deleted file mode 100644 index 0eda6859..00000000 --- a/src/quizzes/chapter-1/1.3.2/vim-modes-quiz.js +++ /dev/null @@ -1,35 +0,0 @@ -const rawQuizdown = ` ---- -shuffleQuestions: true ---- - -# This Vim mode is made up of shortcuts to jump the cursor around and enter additional modes - -1. [x] Normal Mode -1. [ ] Insert Mode -1. [ ] Visual Mode -1. [ ] Command Mode - -# This Vim mode is the mode that you will typically be in and acts as Vim's text editor - -1. [ ] Normal Mode -1. [x] Insert Mode -1. [ ] Visual Mode -1. [ ] Command Mode - -# This Vim mode handles text manipulation via copy/paste methods - -1. [ ] Normal Mode -1. [ ] Insert Mode -1. [x] Visual Mode -1. [ ] Command Mode - -# This Vim mode is how you directly save and exit (write and quit) the file - -1. [ ] Normal Mode -1. [ ] Insert Mode -1. [ ] Visual Mode -1. [x] Command Mode -`; - -export { rawQuizdown } \ No newline at end of file diff --git a/src/quizzes/chapter-1/1.3.2/vim-specifics-quiz.js b/src/quizzes/chapter-1/1.3.2/vim-quiz.js similarity index 61% rename from src/quizzes/chapter-1/1.3.2/vim-specifics-quiz.js rename to src/quizzes/chapter-1/1.3.2/vim-quiz.js index 0fd181ca..1c055408 100644 --- a/src/quizzes/chapter-1/1.3.2/vim-specifics-quiz.js +++ b/src/quizzes/chapter-1/1.3.2/vim-quiz.js @@ -1,9 +1,36 @@ const rawQuizdown = ` --- -shuffleQuestions: true shuffleAnswers: true --- +# This Vim mode is made up of shortcuts to jump the cursor around and enter additional modes + +1. [x] Normal Mode +1. [ ] Insert Mode +1. [ ] Visual Mode +1. [ ] Command Mode + +# This Vim mode is the mode that you will typically be in and acts as Vim's text editor + +1. [ ] Normal Mode +1. [x] Insert Mode +1. [ ] Visual Mode +1. [ ] Command Mode + +# This Vim mode handles text manipulation via copy/paste methods + +1. [ ] Normal Mode +1. [ ] Insert Mode +1. [x] Visual Mode +1. [ ] Command Mode + +# This Vim mode is how you directly save and exit (write and quit) the file + +1. [ ] Normal Mode +1. [ ] Insert Mode +1. [ ] Visual Mode +1. [x] Command Mode + # A file has the following contents:
\`text tex|t text\`
The '|' signifies where the cursor is at
@@ -55,6 +82,24 @@ What are the contents of the file after the following commands are entered?
> This will jump your cursor to the end of the line (and enter insert mode) no matter where it's at - [ ] yy > This will copy the current line no matter where your cursor is at + +# Which of the following commands in Vim moves the cursor to the beginning of the file? + +1. [x] gg +1. [ ] G + > This command moves the cursor to the first character of the last line of the file +1. [ ] ^ + > This command moves the cursor to the first non-blank character of the current line +1. [ ] $ + > This command moves the cursor to the end of the current line + +# How do you search for the word 'bootcamp' in a file? + +1. [x] /bootcamp +1. [ ] :bootcamp +1. [ ] ?bootcamp +1. [ ] *bootcamp + `; export { rawQuizdown } \ No newline at end of file