7 ms·
I was one of those vim users that was stuck on MacVim for years because my brain was too wired to hitting "cmd-s" for save and other dedicated app niceties. I m
by snide 7y ago
I was one of those vim users that was stuck on MacVim for years because my brain was too wired to hitting "cmd-s" for save and other dedicated app niceties. I mean, sure I can :w or bind it to another key, but there are a couple shared OS-level shortcuts like this I just like to retain. No worry, iTerm2 can capture ANYTHING, and rebind it as needed. This means I have a few remaps like "cmd-s" in iterm2 to map to obscure key combinations, which I then have vim interpret and pass along to whatever I want to bind over there. I had no idea the feature existed for years. And sure, I know you're all laughing, why would I even do such a thing... but vim is vim, and we all have our own weird version of it.
iTerm2 is amazing. I've been using it for years daily and it is 100% one of the best, most reliable pieces of software in my toolkit, right next to Alfred.
Show you love for George and contribute to his Patreon[0]. We always love to complain about how to make money with open source on HN. I'd love to see him making a lot more than he does, if for no other reason than we can get more people working full time on the project and provide some redundancy for a critical tool we all love. I wish I could pay for it, but I guess Patreon works.
[0]: https://www.patreon.com/gnachman https://www.patreon.com/gnachman
- AlchemistCamp 7y agoReally? I didn't think iTerm would pass along cmd keys, which is the primary reason I use MacVim instead. For example, I use these kinds of mappings: nmap <D-j> <C-j> nmap <D-k> <C-k> nmap <D-h> <C-h> nmap <D-l> <C-l> nmap <C-[> <C-T> nmap <D-]> <C-]> nmap <D-[> <C-]> nmap <D-p> :CtrlP pwd<cr> nmap <D-r> :CtrlPBufTag<cr> nmap <D-e> :CtrlPMRUFiles<cr> This way, when on a Mac I can use cmd in place of ctrl for various commands I use all the time that are less convenient with ctrl. In my .gvimrc, I added the following to make sure that cmd-p and cmd-l don't get incercepted: "Disable the print key for MacVim" if has("gui_macvim") macmenu &File.Print key=<nop> macmenu &Tools.List\ Errors key=<nop> "macmenu &MacVim.Hide\ MacVim key=<nop> set macligatures endif If there's any possible way to accomplish the same with iTerm, I'd give it another try!
- Myrmornis 7y agoNot a vim user but iTerm2 settings have a section for rebinding modifier keys, (plus you also have karabiner-elements)
- AlchemistCamp 7y agoI don't have karabiner-elements, but doesn't it basically just remap keys across your whole system (much like my mechanical keyboard can)? I don't want change my cmd-keys into control keys system wide. I just want to be able to map my cmd-keys in vim (which to be honest is the lion's share of what I use any terminal for).
- Hnrobert42 7y agoKarabiner-elements is good for mapping single keys to other keys. It doesn’t handle key combinations. (There is something called complex modifiers, but I can’t figure out how to edit them.) BetterTouchTool is good for mapping key sequences. Further, it can do it selectively based on what application is active.
- weaksauce 7y agoThe complex modifiers are just a json file that’s fairly easy to edit. I have a file that has caps+hjkl to arrow keys. Caps by itself is Esc. caps with anything else is Cmd-shift-option-control+anything else. And finally right shift plus caps toggles caps lock.
- Hnrobert42 7y agoWow. That’s good know. I will poke around. Thank you. I like KE and have contributed to the dev several times. In typical modest Japanese fashion, contributions are limited to $10 max. Mapping ‘Enter’ to ‘Caps’ and ‘right shift‘ to ‘right command‘ staved off RSI in my right pinky, so I’m happy to send him/her some cash.
- emilecantin 7y agoOther Vim user here. I was stuck on MacVim as well, but for mouse support. That's until I discovered that `set mouse=a` in Vim and using iTerm instead of the default Terminal essentially gave me the same thing. Then I went into the tmux rabbit hole, but I never really liked iTerm's integration so I don't use it.