News for hackers. Stuff that matters.
Re:What's the Future of IDEs? by xg15 on Wednesday November 24, 2021 @05:07PM (#29335736)
But, well, what is so different in the way to interact with text exactly?
Re:What's the Future of IDEs? by stnmtn on Monday November 29, 2021 @12:03PM (#29382179)
VIM people are very bad at explaining this. Basically, VIM allows you to compose commands together, so that learning one command means that you can compose it with another to do things very quickly.

The best example is this, imo. you have a function call that is: `combineFirstAndLastName("John", "Smith")`

If your cursor is in the `"John"` part, and you want to change that, you can just input `ci"`, (c)hange (i)nside ("), to instantly start typing with John being removed. Lets say you want to change all the text inside the parenthesis, you just type ci), (c)hange (i)nside `)`.

There's commands like this all over, and you can compose all of them. For example, `ct"`, (c)hange un(t)ill ("), which will erase any text until the next available `"` on the line.

Or, (d)elete un(t)ill `char`. It's a whole language when you're editing with VIM, and while it might sound like that's very hard to learn, it's not. Because you can slowly add these verbs and sentences into your habits until it's completely natural

Re:What's the Future of IDEs? by jflesner on Thursday November 25, 2021 @12:45AM (#29338555)
You start in a file where you aren't even editing yet. From there, to start almost every type of navigation, highlight, or edit action will often be a few character combinations. Go to the end of a file and adding text to the end of the line would be "GA", for example. Most actions don't require adjustment of your hand placement (and its even better if you remap capslock to escape) or use of a mouse. Whatever action you take can be repeated with a simple period (big time saver if you need to repeat an action mutliple times). More powerful commands like find and replace are available with the command mode. It works perfectly well over a remote session, also

Once you learn the keys that correspond to your desired actions, everything else feels wasteful (Especially as I'm writing this on my phone). I turn on vim keys for anything that has it. It takes a long time to build up your vim vocab (I recommend you learn the simple stuff and incrementally look up better ways to approach things as you go). A great way to get started is vimtutor, which is built in when you install vim; just run vimtutor from shell and start reading. There's a lot more depth to what is possible, buffers, plugins, etc. but that's what stands out to me.

Re:What's the Future of IDEs? by nouveaux on Thursday November 25, 2021 @02:04PM (#29343990)
Vim has a concept of an object and actions/motions that can be applied to the object. You can think of it as nouns and verbs. Vim objects can be letter, words, sentences or paragraphs. Say you have the following sentence:

"How much wood would a woodchuck chuck?"

If you cursor is on the letter "H", you can type the "dw" to delete the word "How".

You can use "dt" to delete up to a letter. If your cursor is at the letter "H", "dtw" deletes up the letter "w" which will delete "How much ".

This barely scratches the surface. There is a steep learning curve involved but it's totally worth it if you need to edit text on a regular basis.