a really nice one that not a lot of people mention is jump list navigation with ctrl+o and ctrl+i. something i often do is "gd" to go to a definition, then you can ctrl+o to jump back to where you were before going to the definition. ctrl+i would allow you to jump back to the definition you were at before using ctrl+o. those actions really helped me keep a flow state while using nvim
One small change at 11:05 , instead of 1000yy, you can just use yG to yank everything to the bottom of the page. Also, one that I use a lot is “+y which yanks it into the system clipboard to use in other apps like discord.
That's how Neovim renders the diagnostics from its LSP client out of the box. The client itself needs to be configured, and you can do that by hand, but the lspconfig plugin can set reasonable defaults for most LSP servers out there.
11:50, you can use 't' motion here. It's a motion to select html/xml tag, including jsx/tsx file. Place the cursor on the tag, then you can press 'vat' to select outer tag or 'vit' to select inner tag. Of course, you can use similar motion like 'dat' or 'cit'.
I’m tired so I won’t give tips. However I can guarantee that you can improve a lot the way you navigate and edit. You will discover very nice things in your journey if you keep going. Don’t surrender and it’ll be beautiful at the end
Also consider using visual mode more instead of directly deleting things. I find it useful to select them before yanking or deleting them. Remember you can use o to change the position of your cursor.
You don't have to select a word first then copy. You can simply do yiw ( yank in word ) . Also yi{ - yank in curly braces, but if yoy want to copy with curly braces you do ya{ - yank around curly . Same for delete and change : diw, daw, da{ , ciw, caw , ci{, ca{
:% => apply the following to the entire file/buffer so you can go :%d, :%y etc. but a big one is s/ :%s/x/y/g =>Apply a regex search for x and replace it with y, globally (so to the entire line) Now knowing that we can choose where we're applying changes we have extra power :$ => apply the following to the last line of the file/buffer :n => (where n is a line number) apply to line Now for extra fun here's something to remember, the capital version of a command does something "like" the original. so gg goes to begining and G goes to ending. So find out what I, A, D, and C do.
The next thing that I learned besides what you just showed is using folds (zM, zR, za, etc) and has helped me A LOT for inline navigation and just quckly scanning the current buffer and just dive in (unfold) what I am actually interested in inside a bigger file, instead of seeing a big wall of 400 lines of text all the time. It can be confusing at first because there are many fold commands (that start with “z”) but it’s time worth invested.
@ 😄 i try to get used to vim thing. I practice a lot and still find IDE like VSCode still help me code faster. Plus, install VIM extension in vscode, and boom, you got tue best in both world. You got VIM with all the key binding and all vscode goodies
All the shorcuts used in this video ♥ : j: Move down one line k: Move up one line h: Move left one character l: Move right one character gg: Go to the top of the file G: Go to the bottom of the file ctrl+d: Move down half a page ctrl+u: Move up half a page {: Move to the beginning of the previous paragraph }: Move to the beginning of the next paragraph /: Search forward for a string n: Go to the next match N: Go to the previous match ?: Search backward for a string :: Enter command mode q: Quit the current buffer w: Save the current buffer x: Save and close the current buffer wq: Save and quit the current buffer q!: Quit without saving ZZ: Save and quit X: Cut the current line dd: Delete the current line yy: Yank (copy) the current line p: Paste the last yanked text P: Paste the last yanked text before the cursor u: Undo the last change ctrl+r: Redo the last undone change r: Replace the character under the cursor R: Enter replace mode i: Enter insert mode before the cursor a: Enter insert mode after the cursor o: Open a new line below the current line and enter insert mode O: Open a new line above the current line and enter insert mode A: Append text to the end of the current line I: Insert text at the beginning of the current line v: Enter visual mode V: Enter visual line mode ctrl+v: Enter visual block mode d: Delete the selected text y: Yank (copy) the selected text c: Change the selected text x: Cut the selected text >: Indent the selected text
and Ctrl O or Ctrl I does not just go between files. You use it to navigate between lines you edited (yes, vim keeps history of these lines and you just jump through them)
netrw is terrible and it shouldn't be included in neovim. It has unresolved bugs a decade old that no one wants to fix because it's such a mess. No offense to the author, I'm sure it was valuable at one point but it hasn't kept up
11:00 you can type yG to yank from current line to the bottom, ggyG to go to the first line and then yank the entire buffer
Nice thank you!
love to see people using NeoVim now a days
We got a thumbnail today 😅
vim motions are amazing, not only speed up your code navigation, but also add more joy to programming :D
tip on the braces: you can also use B for {} and b for () when selecting in/all. I find it more ergonomic
a really nice one that not a lot of people mention is jump list navigation with ctrl+o and ctrl+i. something i often do is "gd" to go to a definition, then you can ctrl+o to jump back to where you were before going to the definition. ctrl+i would allow you to jump back to the definition you were at before using ctrl+o.
those actions really helped me keep a flow state while using nvim
Thanks, this is very useful for someone switching to Neovim.
Love it and love you! But also next time walk me through it… for I am not tech smart hahaha 😅😩
You’re smart! Love you babe!
You should add some syntax color highlighting, looking at this hurts ouch
Leader ca is “code actions” if you are on a line that has an error, you can easily add imports or resolve simple errors.
One small change at 11:05 , instead of 1000yy, you can just use yG to yank everything to the bottom of the page. Also, one that I use a lot is “+y which yanks it into the system clipboard to use in other apps like discord.
Very nice
Cody, is this a plugin that sends those hints in blue and red like "unreachable content" or "await has no effect"? Thanks
That's how Neovim renders the diagnostics from its LSP client out of the box. The client itself needs to be configured, and you can do that by hand, but the lspconfig plugin can set reasonable defaults for most LSP servers out there.
@ wow, looks great! Thank you for the explanation!
Welcome to the Neovim world!
(I use Neovim btw)
11:50, you can use 't' motion here. It's a motion to select html/xml tag, including jsx/tsx file. Place the cursor on the tag, then you can press 'vat' to select outer tag or 'vit' to select inner tag. Of course, you can use similar motion like 'dat' or 'cit'.
I’ll have to try that one
I’m tired so I won’t give tips.
However I can guarantee that you can improve a lot the way you navigate and edit.
You will discover very nice things in your journey if you keep going. Don’t surrender and it’ll be beautiful at the end
Also consider using visual mode more instead of directly deleting things. I find it useful to select them before yanking or deleting them. Remember you can use o to change the position of your cursor.
*vim.highlight.on_yank()*
You don't have to select a word first then copy. You can simply do yiw ( yank in word ) . Also yi{ - yank in curly braces, but if yoy want to copy with curly braces you do ya{ - yank around curly . Same for delete and change : diw, daw, da{ , ciw, caw , ci{, ca{
:% => apply the following to the entire file/buffer
so you can go :%d, :%y etc. but a big one is s/
:%s/x/y/g =>Apply a regex search for x and replace it with y, globally (so to the entire line)
Now knowing that we can choose where we're applying changes we have extra power
:$ => apply the following to the last line of the file/buffer
:n => (where n is a line number) apply to line
Now for extra fun here's something to remember, the capital version of a command does something "like" the original. so gg goes to begining and G goes to ending. So find out what I, A, D, and C do.
very good video, one question tho, did u setup any treesitter because the syntax highlighting seems to be not readable at all.
I doubt it, only started a few days ago
@@WebDevCody then i highly recommend looking more into it, it will make reading code way more easier.
Treesitter is setup as part of kickstart.nvim so it is probably just the muted theme that makes it seem like it might not be working.
@@Haphazardhero tree-sitter is different than the treesitter.nvim thats in the kickstart
Have you got treesitter installed it’ll make syntax highlight a whole lot better
I don’t know
The next thing that I learned besides what you just showed is using folds (zM, zR, za, etc) and has helped me A LOT for inline navigation and just quckly scanning the current buffer and just dive in (unfold) what I am actually interested in inside a bigger file, instead of seeing a big wall of 400 lines of text all the time. It can be confusing at first because there are many fold commands (that start with “z”) but it’s time worth invested.
good tip! I'll try this one out
will you try to configure neovim? like the color scheme and stuff?
You can use caster to show your keystrokes to the audience.
omg Cody is turning to nvim 😃
I have been using NeoVim now, for an yr now. Love it nd building thibgs i want my way.
bro is neovim pilled now
ggVG to select all in file. Breakdown: gg - move cursor to start of file, V - enter visual mode (select mode), G - move cursor to end of file.
A little more info here:
- v: visual mode (character)
- V: visual line mode
"If you wanna scroll like an old school coder" lmao, it's very hard sometimes to figure out whether you're being sarcastic or not.
I’m always sarcastic
how is this faster thatn cmd+p in vscode?
it's the same; I also don't remember comparing anything to vscode in this video
@ 😄 i try to get used to vim thing. I practice a lot and still find IDE like VSCode still help me code faster. Plus, install VIM extension in vscode, and boom, you got tue best in both world. You got VIM with all the key binding and all vscode goodies
@@hamdaniash-siddiq5021 yeah I still use cursor when I'm serious about wanting to build something. This NeoVim journey is just for fun.
I've been spent the last 4 days configuring my neovim
it really takes this long; but i dont feel more cracked
All the shorcuts used in this video ♥ :
j: Move down one line
k: Move up one line
h: Move left one character
l: Move right one character
gg: Go to the top of the file
G: Go to the bottom of the file
ctrl+d: Move down half a page
ctrl+u: Move up half a page
{: Move to the beginning of the previous paragraph
}: Move to the beginning of the next paragraph
/: Search forward for a string
n: Go to the next match
N: Go to the previous match
?: Search backward for a string
:: Enter command mode
q: Quit the current buffer
w: Save the current buffer
x: Save and close the current buffer
wq: Save and quit the current buffer
q!: Quit without saving
ZZ: Save and quit
X: Cut the current line
dd: Delete the current line
yy: Yank (copy) the current line
p: Paste the last yanked text
P: Paste the last yanked text before the cursor
u: Undo the last change
ctrl+r: Redo the last undone change
r: Replace the character under the cursor
R: Enter replace mode
i: Enter insert mode before the cursor
a: Enter insert mode after the cursor
o: Open a new line below the current line and enter insert mode
O: Open a new line above the current line and enter insert mode
A: Append text to the end of the current line
I: Insert text at the beginning of the current line
v: Enter visual mode
V: Enter visual line mode
ctrl+v: Enter visual block mode
d: Delete the selected text
y: Yank (copy) the selected text
c: Change the selected text
x: Cut the selected text
>: Indent the selected text
Wow ok
G (shift g) for moving to last line in file. Not GG
Primeagen's Vim setup playlist is the best place to start.
gg y G would copy the whole content of the file: go to the top, yank until the end of file
also _ goes to the start of the line
and Ctrl O or Ctrl I does not just go between files. You use it to navigate between lines you edited (yes, vim keeps history of these lines and you just jump through them)
also would like to mention pressing * on a word, which is basically the same as / yourQuery Enter
super cool feature, use it every day)
netrw is terrible and it shouldn't be included in neovim. It has unresolved bugs a decade old that no one wants to fix because it's such a mess.
No offense to the author, I'm sure it was valuable at one point but it hasn't kept up
No no no man don't do it, don't do the thumbnail face!
need to get some more views
Waw