Skip to content

Commit 991c3d8

Browse files
authored
Merge pull request #14 from nushackers/vim-slides
Update vim slides with registers
2 parents b3741d7 + ab1eae6 commit 991c3d8

File tree

4 files changed

+51
-14
lines changed

4 files changed

+51
-14
lines changed

vim/.vimrc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,21 @@ set mouse=a
2424
" Enable (relative) line numbers
2525
set number
2626
set relativenumber
27+
28+
" Disable arrow keys in normal mode
29+
" nnoremap <Up> <Nop>
30+
" nnoremap <Down> <Nop>
31+
" nnoremap <Left> <Nop>
32+
" nnoremap <Right> <Nop>
33+
34+
" Disable arrow keys in insert mode
35+
" inoremap <Up> <Nop>
36+
" inoremap <Down> <Nop>
37+
" inoremap <Left> <Nop>
38+
" inoremap <Right> <Nop>
39+
40+
" Disable arrow keys in visual mode
41+
" vnoremap <Up> <Nop>
42+
" vnoremap <Down> <Nop>
43+
" vnoremap <Left> <Nop>
44+
" vnoremap <Right> <Nop>

vim/presenter_notes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Useful presentation tools
2+
3+
[Keycaster](https://github.com/keycastr/keycastr) is a useful tool for visualizing keypresses

vim/vim.pdf

-226 KB
Binary file not shown.

vim/vim.tex

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
\setminted[bash]{fontsize=\small, tabsize=2, breaklines}
4747

4848
\title{Hackerschool: \\Vim}
49-
\author{Chun Yu}
50-
\date{07 Feb 2024 \\ Slides at \url{https://hckr.cc/ht2425s2-w4-slides}}
49+
\author{Yadunand Prem}
50+
\date{15 Aug 2025 \\ Slides at \url{https://hckr.cc/ht2425s2-w4-slides}}
5151

5252
\begin{document}
5353

@@ -65,8 +65,6 @@ \subsection{}
6565
\end{center}
6666

6767
\begin{center}
68-
\textbf{Hackers} Toolbox
69-
7068
\textbf{Hack} \& Roll
7169

7270
Friday \textbf{Hacks}
@@ -77,11 +75,11 @@ \subsection{}
7775
\end{frame}
7876

7977
\begin{frame}{About Me}
80-
Hi, I'm Chun Yu!
78+
Hi, I'm Yadunand!
8179

82-
Year 4 CS undergrad. I don't like anime.
80+
Year 4 CS undergrad. I like anime.
8381

84-
I use vim for everything.
82+
I've been using vim since \textbf{2017} and I use it for \textit{almost} everything.
8583
\end{frame}
8684

8785
\begin{frame}{Required Software}
@@ -257,12 +255,6 @@ \subsection{}
257255
keys to do anything.
258256
\end{frame}{}
259257

260-
\begin{frame}{A simple vim config}
261-
Notice that by default, vim looks pretty bad. Let's spice it up a bit with some simple configs.
262-
263-
Copy this config file to \keys{~/.vimrc}, or modify your existing config: \url{https://hckr.cc/ht-vim-vimrc}
264-
\end{frame}{}
265-
266258
\begin{frame}{Normal Mode}
267259
\begin{tabular}{|c|c|}
268260
\hline
@@ -289,6 +281,13 @@ \subsection{}
289281
\end{tabular}{}
290282
\end{frame}{}
291283

284+
\begin{frame}{A simple vim config}
285+
Notice that by default, vim looks pretty bad. Let's spice it up a bit with some simple configs.
286+
287+
Copy this config file to \keys{~/.vimrc}, or modify your existing config: \url{https://hckr.cc/ht-vim-vimrc}
288+
\end{frame}{}
289+
290+
292291
\begin{frame}{Searching}
293292
Searching is slightly different in vim, there are two main ways to search something:
294293
\begin{itemize}
@@ -340,7 +339,7 @@ \subsection{}
340339

341340
\begin{frame}{Making small edits - misc. (1/2)}
342341
\begin{itemize}
343-
\item \keys{y + modifier}, yank a certain portion and puts it in a put buffer (think of ctrl c)
342+
\item \keys{y + modifier}, yank a certain portion and puts it in a put buffer (think of \keys{ctrl}/\keys{cmd} \keys{c})
344343
\item \keys{yy} - yank entire line
345344
\item \keys{yw} - yank word
346345
\item \keys{6yw} - yank 6 words
@@ -394,6 +393,22 @@ \subsection{}
394393
\end{itemize}{}
395394
\end{frame}{}
396395

396+
\begin{frame}{Registers}
397+
Whenever you yank or delete text, Vim stores it in \emph{registers} (its clipboards).
398+
399+
\begin{itemize}
400+
\item \keys{:registers} shows all registers and their contents.
401+
\item Use \keys{"} to choose which register to target:
402+
\begin{itemize}
403+
\item \keys{"ayy} -- yank current line into register \texttt{a}
404+
\item \keys{"ap} -- paste from register \texttt{a}
405+
\end{itemize}
406+
\item So this allows you to store multiple items in the clipboard, and choose what you want to paste next!
407+
\item Registers hold not only text, but also macros (coming next).
408+
\end{itemize}
409+
\end{frame}
410+
411+
397412
\begin{frame}{Macros}
398413
Macros are one of the really powerful features in vim that can significantly speed up your workflow.
399414
\begin{itemize}
@@ -427,6 +442,7 @@ \subsection{}
427442
\item \url{https://github.com/preservim/nerdtree}
428443
\item \url{https://github.com/nvim-telescope/telescope.nvim}
429444
\item \url{https://github.com/itchyny/calendar.vim}
445+
\item \url{https://github.com/neovim/neovim}
430446
\end{itemize}
431447
These plugins not only try to speed up your vim workflows, but also add additional functionality to vim.
432448
\end{frame}{}

0 commit comments

Comments
 (0)