ravelinx
ravelinx

Reputation: 1785

Disable cmd+k when using Vim in terminal?

So when I'm using Vim in the mac osx terminal I accidentally enter the command cmd+k that clears my terminal because I'm used to the motion, this makes me have to exit vim and enter again. I want to know if theres a way to disable this.

For example this is me editing my .vimrc

enter image description here

Then I enter the command and my terminal looks like this:

enter image description here

Is there a way to disable this command when using Vim only? I want to continue using it when using the terminal outside Vim. Thanks

Upvotes: 11

Views: 2147

Answers (2)

Jim Rubenstein
Jim Rubenstein

Reputation: 6930

Found the answer to this question while looking for how to do the same thing in tmux

https://superuser.com/questions/611373/with-tmux-on-osx-how-can-i-make-commandk-clear-more-gracefully

Essentially, tell iTerm2 to map cmd+k to send the control sequence 0x0c

Upvotes: 0

phd
phd

Reputation: 94706

Instead of restarting vim use CTRL-L to redraw the screen.

Upvotes: 9

Related Questions