-
What is vim? What it is for? Why we need to learn it? 00:00
-
What are key bindings?
-
How to access the keyboard shortcuts (or key bindings) of fastai forum? ?
-
Are key bindings consistent in different programs?
-
How to move up and down in a thread of the forum? j or k
-
How to edit a reply or a post? e
-
How to select all and copy? cmd a
and then cmd c
-
Are these keyboard shortcuts are very similar to vim?
-
How to install vim? brew install vim
05:57
-
Can we use vim in paperspace? Is it preinstalled there?
-
How to install vim in Linux? sudo apt install vim
-
How to start vim? vim
-
How to get into edit mode of vim? i
09:15
-
What is the default mode? command mode
-
How do we know we are in the edit mode? see “insert” at the bottom
-
How to go back to command mode? esc
and see “insert” gone
-
How to move up and down in edit mode? arrow keys
-
How to move up and down in command mode? arrow keys or j or k
-
How to move left and right in command mode? h or l
-
How to open a file with vim? vim filename
10:53
-
How to add comment to the first line of code? enter edit mode and hit enter to move it down a line, and do the editing with other keys learned above
-
How to undo? in command mode, press u
-
How to open a new line below the current line where the cursor is? o
-
How to open a new line above the current line where the cursor is? shift + o
-
How to run command in vim? in command mode type :
for writing commands at bottom
-
How to save a file? :w
-
How to save into a new file with a different name? :w aNewName
-
How to exit vim? :q
-
How to combine commands like save and quit? :wq
-
How to turn lower to upper case from left to right? in command mode press ~
-
How to do ~
command 10 times? in command mode press 10~
-
How to delete the current line? dd
-
How to delete 5 lines from cursor and below? 5dd
-
How to go to the bottom of the file? shift + g
-
How to delete a region from cursor to the end of the file? d + shift + g
15:53
-
How to go to the the start of the file? gg
-
How to delete from cursor to the start of the file? dgg
-
How to go to the start and the end of a paragraph? {
and }
-
How to copy a paragraph below the cursor? put cursor at the line above the paragraph by {
, and then press y}
and p
-
How to move right and left by word? w
or b
-
How to delete and edit on a word? command mode, cursor at the start of a word, cw
to delete this word and enter edit mode
-
How to delete the remaining of the paragraph and the paragraph below? 2d}
-
19:32 How to copy from forum and paste in vim? e; cmd + a; cmd + c; cmd + v;
enter vim cmd + v; gg
-
After you delete a line (or any action) and you want to it again, what to do? .
-
How to delete 5 words from the cursor? 5dw
-
How to search the next digit at the start of a line in vim? /^\d
-
How to start to search? /
-
How to search the start of a line? /^
-
How to search the start of a line which is a digit? /^\d
-
How to search again with the same search command? n
-
How to delete the lines from the cursor to the next line start with digits? d/^\d
-
How to do the same action again? .
-
22:17 How to make an ex
command and apply to all lines? :%
-
How to make a grep search command on all lines? :%g/
-
How to search each line for a -
at the start of a line? :%g/^-/
-
How to search all the lines for a -
at the start of each line and delete them? :%g/^-/d
-
How to search all the lines with one or more empty spaces with the end of the line and delete them? :%g/^\s*$/d
-
How to do search and replace to the whole file? :%s/
-
How to do search the first empty space and replace with a space, -
and another space to the whole file? :%s/ / - /
-
How to search all lines and find those start with a space and a -
and delete them? :%g/^\s\-/d
-
24:33 Why vim is so crucial to all data scientists? Can everything done above be automated by a macro in vim?
-
How to quit without saving changes? :q!
-
25:54 Why our files disappear? because pre-run.sh
stays in root not home directory
-
What does ctrl + z
do? it stops the program which is currently running and put it in the background 26:35
-
How to check what is running in the background? jobs
-
When you are ready to get back to work on the program in the background, can you call it into the foreground? yes with fg
-
How to split vim vertically to view two files at the same time? :sp /run.sh
-
How to move to different panels with vim? ctrl + w
twice (only cmd + w
will close tab in chrome for mac)
-
28:45 What is the solution to the file disappearing problem? by remembering the starting directory and go back to it at the end of the execution of pre-run.sh
pushd ~
#!/usr/bin/env bash
cd
rm -rf .local
ln -s /storage/cfg/.local
rm -rf .ssh
ln -s /storage/cfg/.ssh
popd
-
Can you open multiple programs or vim fileNames
and put them all in the background? yes and you can see them with jobs
and use fg 1
and fg 2
to access each of them
-
Can vscode work with paperspace remotely? 32:29 absolutely
-
How to learn vim? one bite at a time; get the attitude right and hear Jeremy’s story; don’t install any plugins to waste time; and type vimtutor
to get a tutorial on vim
-
How to delete a character at the cursor? x
-
Radek’s resources of learning vim: https://vim-adventures.com/, Practical Vim: Edit Text at the Speed of Thought,
-
Where is Jeremy’s configuration files? fastai dotfiles
-
How does Jeremy customize its vim environment? Jeremy explained his .vimrc
file 41:42
-
Where should we git clone fastai repo into? Is /notebooks/
directory is persistent in restarts of one machine and across machines? but will you still have the files once deleted the machine or notebook? 45:33 #question
-
How to only git clone the latest version of the repo to save time? git clone git@github.com:fastai/fastai.git --depth 1
-
How to explore the entire fastai library repo? 47:41 we can do it in github, vscode and vim
-
What is ctags? How does it work to explore the entire repo?
-
How to make mamba and conda work seamlessly together in paperspace? conda install -c defaults -c conda-forge mamba
-
How to install ctag with mamba? mamba install -c conda-forge universal-ctags
-
Where and how are we going to use ctags? go to the folder where the files you want to explore stored and type ctags
-
How to index the current folder where the files are stored? ctags -R .
and use ls
to check the ctag
file created inside the current folder (git status
does not see it, maybe because of .gitignore?`, need to check #question)
-
What is inside the ctag
file? 54:19
-
How to search a function such as ArrayMask
using ctags from terminal? ctags -t ArrayMask
-
How to search the above function within a python file? vim filename
to open the file, :tj ArrayMask
-
How to jump from a particular class where the cursor is at to the class definition? ctrl + ]
-
How to go back to the previous tag? ctrl + t
-
What is the checkpoint.py file? 56:02
-
How to create a ctag config file to ignore the backup file? #question
-
How to split the tag to view the current function where the cursor is at and the function definition you are searching for? :stag FunctionName