I've wanted to dedicate time to learning Vim for probably a decade now.
When I was just getting started as a junior developer, I remember thinkin...
For further actions, you may consider blocking this person and/or reporting abuse
I love it when I see setups where people put everything together from the ground up. LazyVim is just an alternative to I think it's Packer that Prime uses. Did you mean NVChad? I've done the whole ground up thing, but NVChad is just too good!
Dreams of Code on YouTube has a bunch of amazing NVChad tutorials, If you haven't seen them, I'd highly recommend them :)
Keep on trucking and learning! I love seeing people who are willing to put in a little extra work for something they think is cool!
I haven't heard of NVChat but thanks for sending those tutorials! I'll have to check them out one of these days.
LazyVim is a "distro" like NVChad, "Lazy.nvim" is a plugin manager used by LazyVim comparable to Packer. It's a confusing choice of name, but they do pretty much the same thing.
Oh wow. Everything makes sense now π
:h window{Ctrl-D} - this took me forever to find, but it was a game-changer for me. Without Ctrl-D, you just get the basic vim introduction and the definition of a window. When you type Ctrl-D rather than just Enter, you get a list of references to all help entries that include the word βwindowβ. Now you see that there are help entries for βwindow-movingβ, βwindow-resizeβ and a host of other options. I used to think :h was not much help until I started using this.
Great to see new people picking up vim!
Great article and thank you for posting.
When you said:
You are absolutely correct. However, and If I understand you correctly, you do not need to use any plugins in this particular scenario. You could do:
%s/foo/bar/g
To search and replace all instances of foo with bar in a file.
To see more checkout this page
Have a nice day!
You did understand me correctly and I had no idea that I could do that without a plugin! Thank you for sharing that!
Oh wow, welcome to Vim! If you are just getting to
%s
, many wonders await you ahead. Here's something might be of use on that journey. I forgot to note the source for some of these below... as always,<C-g>
means hold down the CTRL key while then pressing 'g'... start the first session of your day with a...:smile
- optional.)Now the useful. Open Vim and press
<C-o-o>
. It will take you directly to your last opened file and last location of the cursor. Yes!Having a shortcut to switch between the last edited buffer and your current one would be very handy. Vim actually has the shortcut for this:
<C-^>
. However, it feels much better if you map this command to Backspace YMMV, for example:nnoremap <bs> <C-^>
q:
# list of vim command historyq/
# window of search history edit/run goto previous searchesgi
# put into INSERT mode with cursor at end of last insert you didgf
# open file whose name is under curor or afterga
# show ASCII value of character under the cursor in decimal, hex, octalg<C-g>
# show file specs info current file, num of words, how many bytes.
# current line$
# last line%
# all lines - same as:[1,$]
.:[range]g/pattern/command
#[range]
is optional, by default it's the whole file, for the command.pattern
# pattern looking to matchcommand
# Ex command to be executed for each line matching the pattern:g/error/d
# delete all lines matching pattern:g!/important/d
# delete all lines NOT matching pattern:3,9t20
# copy lines 3 - 9 after line 20, regardless where cursor is:3,9t$
# copy 3 - 9 to the end:3,9m20
# move lines 3 - 9 to line 20Has there ever been a screen-based editor where you could not do that directly?
I've been editing code for over 40 years and I don't remember one that didn't have some sort of find/replace-all functionality.
How old is teco now? Wikipedia says it was developed in 1962, so would be 62 years old. It was available on a screen in 1964. Teco was line based, iirc, and was a mature tool when I first met it, perhaps around 1979-80.
It had a flexible find/replace which did more than you would imagine. EMACS was originally written in teco macros.
History: This has been your history lesson for today
Moral: Explore the editor before you start adding plugin-ins
I was also wondering about the use of plugins. Sure, you can use them if you wish, but here are a few things that can get you around rapidly!
First press Esc to make sure you are in command mode rather than input mode.
1G - navigate to the top of the file or buffer, regardless of where you are.
Similarly
G - navigate to the bottom of the file or buffer, regardless of where you are.
19G - navigate to line 19; change the number and you can navigate anywhere.
Similarly, w moves forward a word, 5w moves forward 5 words and so on.
h moves left one character; 8h moves left 8 characters.
l moves right one character; *l moves right * characters.
j moves down one line; *j moves down * lines.
k moves up one line; *k moves up * lines.
w moves forward to the beginning of the next word; *w moves forward * words to the beginning of the *th next word.
b moves backward to the previous word boundary; e moves forward to the end of the next word boundary.
:w writes out the buffer.
:q quits the buffer
Wx saves and exits.
To input text, there are multiple input commands; the basic one is i, input mode. Using a instead of i puts you in input mode after the current location; think of it like "append" instead of input.
thegeekdiary.com/basic-vi-commands... is a quick vi cheat sheet.
cheatography.com/dcschmid/cheat-sh... is a similar cheat sheet for nvim - Neovim.
Right here in Dev:
dev.to/socool/nvim-cheatsheet-3bpa
gg β for top of file is my preferred approach. Quicker than going for the number key.
Great page. π
Damn right we are. Welcome to Coolsville.
Vim Visual Cheat Sheet - hamwaves.com/vim.tutorial/
Try vim on adroid phone , in temux. i can surprise how easy to write at least document with screen keyboard. temux are give secret to proper use of vim.The vim h-j-k-l is great because on that key don't have arrowkeys.
My favorit is: u.
Welcome to all you that are just starting in vim/neovim. Here is the best book to help get you started (I've read many of them): wizardsusevim.com/
It is a great resource for new vimers and long time users.
Great, I am using
kickstart.nvim
for neovimI am also exploring VIM these days .
Enjoy your journey, and savor the process. You'll love it. :-)
Best of luck!
Welcome to the journey, I might have started exactly at the same time ...
Iβm just starting my coding journey and I found out about Vim through Primeagen. Right now Iβm just using Vim motions in VS Code but so far I love it! I canβt wait to make the full switch to NeoVim.