Fork me on GitHub

this seems like a totally newb thing, but I haven't been taking advantage of it enough:

nvim file.clj +100 # opens file to line 100
nvim file.clj +/foo # open file with search active, cursor on first match
a game changer if I am frequently going from the terminal back to make small edits

nice 6

I didn't know about that! Nice!


there's also -oN -ON -pN to start with N splits, N vsplits, or N tabs respecively, something I feel like I should put in an alias to reduce the amount of window management I do on startup


I've done that with filenames. Like vim -O foo.txt


When I skip between small edits/terminal, I often just put vim into the bg with C-z and then bring it back with fg


But this is a nice trick, didn't know about it!


One thing I really nope it would have (I use the + a lot to jump to a line), but to jump to a column isn't yet easily done, would to see something like foo.txt +13:10 or foo.txt +13,10 something like that, so I can jump to line, column.


There are probably several ways. There usually is. 🙂 Here is the first I could think of. Yes it is verbose, but just wrap it in some alias or shell function that makes it simpler? vim file.clj +13 -c "normal 010lh" (go to line 13, column 10)


'. goes to the last cursor position which is sometimes useful


if you re-open a file


Within the same running instance of vim? I usually just scroll through C-o/i and it even changes the files for me.


> vim file.clj +13 -c "normal 010lh" (The observant person will of course notice a small bug, that this way ends up on column 9 if the line is only 10 characters long, but I figured you need something "close enough")