Live data from Hacker News

Editors (Vim)

missing.csail.mit.edu

101–110 of 120 posts

Re: Editors (Vim)

#101

I'm by no means a high level expert of command line, but if I need to do a quick edit I just use nano, and if I need to get down and dirty I use VS Code. Is this abnormal? I know a lot of power users use Vim, but I've just never fallen in love with it.

This is unfortunately not uncommon. I feel like most of my coworkers at most companies Ive worked for don't use vim. One killer app of vim for me is macros. You can record a string of commands and map doing that to a letter. This makes certain mundane changes you have to do sometimes in software a breeze. For example, I had some code where someone was using string literals everywhere when they should have defined an…

> One killer app of vim for me is macros. You can record a string of commands and map doing that to a letter.

Nano lets you do that too.

Re: Editors (Vim)

#102
post #67

Earlier quoted context omitted.

> If I wasn't using vim I'd probably just leave that code as it was because it would have been so much effort. Most modern editors, Visual Studio Code included, have powerful refactoring abilities. Not only that, but they're usable without needing to be an editor expert - just right-clicking and selecting "Change all occurrences" (or pressing F2) does the trick.

This is reasonably fast, but not nearly as fast as if can be on Vim. IDK how GP did it, but one quick way might be searching for strings and hitting . whenever the macro needs to be applied. So you would end up doing something like n n n . n n . n n and so on, where each n means “go to next string” and each dot corresponds to finding and renaming something manually in other editors. You can go through dozens of occur…

The vscode rename is much simpler/faster than that - cursor over the symbol/variable, press F2, type in the new name, press enter. Renames all references across all files in your project.

edit: no shade on VIM and VIM macros; they're great. I'm a very experienced vim power user, but have switched to vscode with vim keybindings, and I'm very very happy with the switch.

Re: Editors (Vim)

#103
post #83

I feel about Vim the way RMS seems to feel about Linux. Even though, (presumably) everyone knows the relationship of vim to vi, I don’t feel there is enough explicit acknowledgement of that fact. Vim is evidently a wonderful tool, (I say this as a confirmed 20 year emacs user for whom emacs is only usable due to excellent vi emulation possibilities) but it clearly wouldn’t exist without the basic foundation provided…

I use vim regularly on my day job. However, I am not familiar with more of the advanced side of things, and would never call myself an advanced user. That aside, I was always of the impression that vim was simply vi but extended in a sense. Is that not the case? How different is vi to vim?

In my eyes, vi is ok for system administration, but not for programming.

The differences are not huge, but even if I have a "small" .vimrc with one single plugin, I have issues using the vim.tiny installed on Debian by default.

The Vim help has a list of the differences:

https://vimhelp.org/vim_faq.txt.html#faq-1.4

The most important to me are:

- a real undo - buffers - macros (recorded on the fly with ththe q key) - visual mode (included the block selection mode) - text completion (ctrl-p, ctrl-x-f) - automatic indenting - advanced text objects (selecting everyting between '()')

Not having one single of them would not hinder me much... but all of them at once: that hurts!

Re: Editors (Vim)

#104
post #89

Has eye-tracking been explored for improved code editing beyond Vim? Vim does away with the hand-travel delays, but many of these ninja keystroke moves to navigate code are just what your eyes do already (but not all, such as the search function).

Recently, I had an idea (which is somewhat stupid and makes me think I am rather lazy) to switch window context between two monitors using my eyes. Mainly because, right now, most of my workflow is from my keyboard, but to switch windows, I have to make either a weird hand twisting shortcut or use the mouse. I haven't yet found such a solution but I do wonder how hard it would be build such a thing.

Possibly cheaper and more reliable you could attach a pedal to your usb port. As a next step you can start training an ai connected to your cam. Could be a nice project.

Re: Editors (Vim)

#105
post #83

I feel about Vim the way RMS seems to feel about Linux. Even though, (presumably) everyone knows the relationship of vim to vi, I don’t feel there is enough explicit acknowledgement of that fact. Vim is evidently a wonderful tool, (I say this as a confirmed 20 year emacs user for whom emacs is only usable due to excellent vi emulation possibilities) but it clearly wouldn’t exist without the basic foundation provided…

I use vim regularly on my day job. However, I am not familiar with more of the advanced side of things, and would never call myself an advanced user. That aside, I was always of the impression that vim was simply vi but extended in a sense. Is that not the case? How different is vi to vim?

This advanced tutorial helped me https://www.ele.uri.edu/faculty/vetter/Other-stuff/vi/009-in.... I have not found many advanced vi/m tutorials, I wish there were more. hth

Re: Editors (Vim)

#106

Has eye-tracking been explored for improved code editing beyond Vim? Vim does away with the hand-travel delays, but many of these ninja keystroke moves to navigate code are just what your eyes do already (but not all, such as the search function).

Looks like it has. E.g. - https://medium.com/fast-company/the-mouse-of-the-future-your... - https://purehost.bath.ac.uk/ws/portalfiles/portal/190368020/... more https://www.google.com/search?q=eye+tracking+text+editing&oq...

Was going to read the first link, but can't be bothered to sign up / sign in to medium.com. Screw that platform.

Re: Editors (Vim)

#107
post #64

I feel about Vim the way RMS seems to feel about Linux. Even though, (presumably) everyone knows the relationship of vim to vi, I don’t feel there is enough explicit acknowledgement of that fact. Vim is evidently a wonderful tool, (I say this as a confirmed 20 year emacs user for whom emacs is only usable due to excellent vi emulation possibilities) but it clearly wouldn’t exist without the basic foundation provided…

vi itself is just a natural progression from ed, the standard editor.

as is Plan 9's Sam - jumping beyond the Command Line ;)

Re: Editors (Vim)

#108
post #3

I feel like it would be far more useful to just talk about vimtutor . At least for me, it was the only way I was able to grok vim.

From the link posted by the OP:

Exercises

1. Complete vimtutor

Re: Editors (Vim)

#109
post #94
post #79

Earlier quoted context omitted.

What does flying a plane have to do with editing and navigating code?

It happens me every day: I just start to type while still in command mode, and then have to press "u" a couple of times. (But ok, thats maybe just me - thought this is a common experience, and I just wouldn't like to sit behind a pilot doing the same...)

This problem can be mitigated to an extent with a vim setting to change the cursor from a block to a vertical line when you enter insert mode. After using it for a bit your brain will learn to look for the vertical line before typing.

Re: Editors (Vim)

#110

If you think Vim emulation is a replacement for Vim, either you don't know Vim or you don't like Vim. VSCode Vim emulation? Spacemacs? They are miniscule, pale comparisons. VSCode is a fine editor. Emacs is a fine editor. Spacemacs is pretty fantastic. But if you you think that's Vim, you simply don't know and appreciate Vim. That's ok, but it's not even in the same universe as the real thing. By all means use what y…

Would you care to elaborate and point to some specific features and workflows that you consider to be unique to the real Vim?
Post reply on HN