Live data from Hacker News

Vim After 11 Years

statico.github.com

221–230 of 254 posts

Re: Vim After 11 Years

#222
post #75

Earlier quoted context omitted.

You seem to be conflating Vim and Terminal. Vim is just one of the many things you can run in a terminal, and just one of the many things you can do with a terminal.

No. I know what the difference is between the two. And I know that I never use mouse in one or the other. I don't use it for scrolling, I don't use it for pointing and clicking, I don't use for selecting stuff… REPL? no use for the mouse. htop? no use for the mouse. git/svn/hg? no use for the mouse.

How do you select text then? I'm sure there are ways, but they are certainly not intuitive and I've never bothered to look them up since I don't do this task as often.

Re: Vim After 11 Years

#223
post #204

I'm disappointed no one's mentioned digraphs yet. I've used emacs for years, but I'm starting to use vim now because ctrl-k G* etc is just so easy (I type a lot of math).

If that's your only reason, stick with emacs but use evil-mode. I flip-flop between liking evil-mode (when I'm mostly just editing stuff) and preferring standard emacs keybindings (when I'm switching a lot between shells, dired, interactive sessions, etc.)

Re: Vim After 11 Years

#224
post #20

Earlier quoted context omitted.

iterm2 supports mouse input, terminal.app does not.

iterm2 does not let me go forward/backward by word (with the option key). anyone know how to fix this?

I might as well answer seeing as I found this out yesterday. Go to the profile options then the keys tab. Then there is an option for left/right option key acting as normal meta or +esc. While meta sounds correct for this, esc+ was recommended and works.

Re: Vim After 11 Years

#225
post #206

Earlier quoted context omitted.

have your terminal map Ctrl-Z to fg, and you can cycle in and out of the shell almost instantly from vim with that key.

How can you do that? For me, this just doesn't work... bind '"\C-z":"fg\n"' bind -x '"\C-z":"fg"' echo 'Control-z: "fg\n"' >> ~/.inputrc If I replace "z" with "a", it works. C-z works otherwise, e.g. C-v C-z prints ^Z in shell, and C-z suspends programs (e.g. vim). Is it a bash thing or a terminal thing (I'm using iTerm2)?

Try:

  set bind-tty-special-chars Off
in your .inputrc, before you do the bind on C-z.

The readline man page is a little misleading:

  bind-tty-special-chars (On)
    If set to On, readline attempts to bind the control characters treated 
    specially by the kernel's terminal driver to their readline equivalents.
Disabling it doesn't actually stop readline from binding those control characters. It just enables you to override those default readline binds. If the variable is set to On (the default), that's not possible.

Re: Vim After 11 Years

#226
post #206

Earlier quoted context omitted.

How can you do that? For me, this just doesn't work... bind '"\C-z":"fg\n"' bind -x '"\C-z":"fg"' echo 'Control-z: "fg\n"' >> ~/.inputrc If I replace "z" with "a", it works. C-z works otherwise, e.g. C-v C-z prints ^Z in shell, and C-z suspends programs (e.g. vim). Is it a bash thing or a terminal thing (I'm using iTerm2)?

Try: set bind-tty-special-chars Off in your .inputrc, before you do the bind on C-z. The readline man page is a little misleading: bind-tty-special-chars (On) If set to On, readline attempts to bind the control characters treated specially by the kernel's terminal driver to their readline equivalents. Disabling it doesn't actually stop readline from binding those control characters. It just enables you to override th…

This does not work for me, unfortunately...

Also, another thing I have noticed, is that I cannot catch the SIGTSTP (Control-Z) signal with the `trap` command. I can catch other standard signals, e.g. SIGINT (Control-C), but not SIGTSTP (along with SIGSTOP and SIGKILL, obviously).

Re: Vim After 11 Years

#228
post #58
post #40

Lots of people seem to declare ; or , to be useless keys and remap them. They're two of my most used movement keys in certain circumstances. I used to have , remapped to but switched back when I realised what I was missing out on. I'd advise anybody else to reconsider if they've made the same mistake I did.

I've had ; mapped to : forever. Is there a use for `;` I'm missing out on? `;` just seems to be for stuff like "`fp` -- Oh wait, I didn't see all the p's between my cursor and the p I wanted. ; ; ; ;." Now I use easymotion.vim which obviates that scenario.

g; will move the cursor to the line of your last edit (and further through your edit history). I find it useful as a move command but also use it to remind myself of what and where my last edit was.

Re: Vim After 11 Years

#229

Earlier quoted context omitted.

Keyboard shortcuts give me precision and efficiency, not speed, and that cognitive overload you talk about is a small price to pay.

For you. But you don't get to make that decision for everyone else. Stop trying to impose your value system on others. It's clear you don't like using a mouse. Then don't. Keep using a 1970s keyboard if it suits you. Bon a petite.

Yes, openly criticizing someone's opinion (or in this case, simply stating another opinion) on a public forum is exactly the same as trying to impose my value system on that person.

By the way, you totally missed the "me" in

> Keyboard shortcuts give me precision and efficiency, not speed, and that cognitive overload you talk about is a small price to pay.

which quite clearly means that this is a subjective matter.

Thanks for helping policing the internet: we clearly don't need to debate about anything.

Re: Vim After 11 Years

#230
post #213

Earlier quoted context omitted.

Yes, there is. "Best" is a harder subject to tackle, but there's always "better". di{ is obviously both quicker and more precise than reaching to the mouse, pointing at the beginning of the code block, extending the selection until the end of the code block and hitting backspace. One may think these keybindings are awkward or hard to remember (I did, at first, they are not) but they are both faster, more efficient an…

Good luck beaming your vim registers from a remote vim into the local clipboard.

That's why I prefer to use my local Vim (Emacs with evil-mode) and its remote editing features (Tramp).
Post reply on HN