Hacker News new | ask | show | jobs
by splaty 3191 days ago
Not this, but I do fairly often think assume I'm in vim when I'm not.

`alias :q="echo NOT IN VIM!!!"`

4 comments

My favorite one of these is typing ctrl-w (cut in emacs) in a browser tab as I am editing a bunch of text in a text box.
I use vimperator, so the only program I use a lot which still doesn't recognize ctrl+w is Hexchat.

My friends have gotten used to see me part the channel and rejoin shortly after, cursing my fingers.

Hexchat closing on C-w is such a pain! It can't be scripted away either because it's hardcoded in the source. I haven't looked into this for some time but there does seem to have been some updates.

https://github.com/hexchat/hexchat/issues/397

That sounds like the kind of thing that would be really easy to maintain your own fork for...
HexChat parting on Ctrl+w is probably one of the main reasons that drove me to use a TUI IRC client like weechat.
You can try Lazarus form recovery[1] to mitigate your pain. It locally saves the content of forms and allows you to pull it back.

[1] https://addons.mozilla.org/en-US/firefox/addon/lazarus-form-...

Heh, for me ctrl-w means "extend selection to enclosing expression", which leads to the same issue in browsers.
One of the things I appreciate about macOS is that it implements some of the emacs behavior (C-a, C-e, C-k). Unfortunately not C-y, and non of the M- ones work since that's for special characters. I understand they originally come from the readline library.
Now try C-k and then C-y

Then regular old Cmd + v.

You're welcome.

Well, cutting is called killing in Emacs...
So why is emodendroket referring to ctrl-w then?
In other words ctrl-w is "kill," which is what most people would think of as "cut," and ctrl-y is "yank," which is what most people would think of as "paste."
And Vimmers would think of yank as copy or kill save
That's funny. Never thought about that. I guess Emacs people think of it as yanking from the clipboard to the document, and Vim people think of it as yanking from the document into the clipboard.
I actually aliased :q to clear:

https://github.com/jez/dotfiles/blob/master/util/aliases.sh#...

I also have clera, lcear, and lcera -> clear, and :tabe -> vim.

Are you aware Ctrl-l also clears? I can't recall the last time I typed clear.
I have to admit, I wince when I see someone type clear.
Not just `alias :q exit`?
Not really, if they mean `:q` to exit vim and go back to the terminal `alias :q=exit` wouldn't produce the desired result.
could really mess with it:

> alias :q=vim -c ':q'

best one
I really do that a lot so I aliased 'q' to exit in shell.