5/20/2023 0 Comments Macvim vs vim terminal" previously, I found that ttymouse was getting reset, so had Getting the mouse to not only work in a local copy of iTerm 2 running on my Mac, but also on remote machines accessed via SSH and possibly running tmux sessions was a little trickier.įirst up, I needed something like this in my ~/.vimrc: if has('mouse') ![]() ITerm is configurable enough that I believe I could get it to send a custom sequence for, but I haven’t yet figured out what that should be. (I would use, but alas, the terminal sends exactly the same key code for that as it does for, so the two are indistinguishable.) stty -ixon This has the side-effect that I can use again in Command-T to open a selection in horizontal split. zshrc I have the following to prevent accidental presses of from taking over the terminal. " when I originally started using Command-T inside a terminal, " and Vim (7.3, with patches 1-843), this is all I need: With a handful of settings in my ~/.vimrc I was able to get the and cursor keys to do the right thing in the terminal: set ttimeoutlen=50 This is why I added the ability to configure custom mappings for Command-T, so that users could workaround the idiosyncrasies of their terminal to get the desired mappings they wanted. the "up" arrow might be transmitted to the terminal as OA or something similarly contrived to make Vim execute an undesirable set of operations). They do "crazy" things like sending your cursor key presses as escape sequences (eg. Terminals are tricky beasts, especially when it comes to key bindings. I have iTerm 2 set up to report itself as xterm-256color and also do "Xterm mouse reporting". It is not as fast as Terminal.app, the search highlighting is infuriatingly hard to read (and there appears to be no way to set a preference for the direction of the search), and it is very occasionally unstable (but not often enough to really interfere with you getting your work done), but it has 256-color support (more importantly than this though, it has easily configurable and loadable color schemes, which means you can get color schemes like Solarized up and running and looking nice with ease) and does all the right things as far as things like mouse support are concerned. ITerm 2 is really the only way to go here. It’s now about basically the whole way there. ![]() Starting in 2011, however, I’ve spent a fair bit of time beating the command line version of Vim into shape and making it work the way I want, even over SSH connections or inside tmux sessions. You can get fast-and-easy context switching between your editor and the terminal with "Command-Tab". ![]()
0 Comments
Leave a Reply. |