One of the beautiful things about Vim is that many of the common things you might want to do in a text editor can be done without moving you fingers far from home row on your keyboard. If you're ever not sure if you're in normal mode or not, just press Esc. Remember, all of these commands must be entered in normal mode. If you want to discard the changes, you can force Vim to quit without saving by typing :q! If you want to save those changes and quit, type :wq instead. If you've made changes to the file, Vim won't let you quit right away. When you want to quit, press Esc to put Vim back into normal mode. Do this by pressing i.įrom here you can now use it like you might normally use Nano. Instead, you have to put Vim into insert mode. Upon launch, you can't just start typing like you could in Nano. For example, to edit the xmonad configuration we've been editing in the last few articles, run the follow command vim ~ /.xmonad/xmonad.hs Once it's installed, launch it by typing vim or, even better, give Vim a filename to open on launch. You can install Vim through pacman just like all the other packages we've installed so far. This article isn't the ultimate guide on using Vim, but it's a decent start and I think it makes sense to talk about at this stage in the series. That's because you'll spend a significant amount of time figuring out how to do the thing you want to do.īut once you figure it out and start memorizing key combinations and little shortcuts to take care of common tasks, you'll be able to edit files faster than ever before. Most people probably get turned off by Vim because, initially, it will take you much longer to do simple tasks like edit a line of configuration in a file. If you haven't used it before, you probably haven't experienced text editing like you will in Vim before. Vim takes a little bit of time to get used to. Nano is great for beginners but it leaves a lot to be desired. Throughout the series, we've been using Nano to edit the many configuration files necessary to set up and customize the tools we've installed. If you've been following along with this series, we installed Arch Linux, xmonad window manager, Alacritty terminal emulator, and xmobar status bar all from scratch.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |