Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added two quizzes about vim #417

Merged
merged 2 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/1-introduction/1.3.2-vim.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -109,6 +112,10 @@ Normal mode.

?> To learn more about Vim, use the command `vimtutor` in your terminal to run through a tutorial that explores more advanced commands.

<div class="quizdown">
<div id="chapter-1/1.3.2/vim-quiz.js" ></div>
</div>

# Deliverables

- Discuss the benefits of using Vim in your workflow
105 changes: 105 additions & 0 deletions src/quizzes/chapter-1/1.3.2/vim-quiz.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
const rawQuizdown = `
---
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:<br>
\`text tex|t text\`<br>
The '|' signifies where the cursor is at<br>
Vim is in normal mode<br><br>
What are the contents of the file after the following commands are entered?<br>
\`w\`<br>
\`a\`<br>
\`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:<br>
\`text\`<br>
Vim is in normal mode<br><br>
What are the contents of the file after the following commands are entered?<br>
\`yy\`<br>
\`p\`<br>
\`p\`

1. [x] text<br>text<br>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

# 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 }
Loading