در حال بارگذاری ...

Opening NeoVim Basics0:32

we can start with a clean slate and build it back up together. To open NeoVim, we'll type nvim and press enter. And I just want to show you that I've also created an alias for vim that will open NeoVim, and that's just because I've got a lot of muscle memory from so many years of using vim, and because it's easier to type. So just know that when I type vim, I am opening NeoVim. So when we first open NeoVim, it places us into normal mode. This is because NeoVim and vim are modal text editors, which are fundamentally different from how most other editors work. If I type a word like hello in normal mode, it won't actually write the word hello.

Editing Modes and Appending5:07

to the end of the line, and if you've used Regex, then you might remember that the dollar sign is for the end of the line, so there's a few things in Vim that are kind of similar that you can remember. So from here, we can press SHIFT A to append, and now we can type something at the end, and when you press escape, you'll see that it adds it to the end of the line. The last mode you want to know about is command mode, which we can get to from normal mode by typing the colon character. This gives us a prompt at the bottom left, and this is where we can do things like opening files, saving files, quitting, and much more. So to write the file, we can go w, but if we try and do this at the moment, we'll get

Saving and Quitting Files5:40

files, saving files, quitting, and much more. So to write the file, we can go w, but if we try and do this at the moment, we'll get an error that there's no file name. So let's go :w, and then call this file test.txt, and write that file. We can also do :q to exit the file, which we're not going to do just yet, and we can do :wq to write and quit the file. If we've made some changes to the file, some changes, and then try and quit the file with :q, we'll get an error saying that there are unsaved changes. If we want to ignore this, we can go :q!, and this will exit without saving the changes.

Moving AroundModes

دوست دارید گاهی خبرهای Laracasts را ایمیل کنیم؟