6/13/2023 0 Comments Opening macvim through terminalOn Mastodon or Twitter, or leave a comment. I love feedback and questions - please feel free to get in touch It can be quite handy try help :macvim for more. When you're running MacVim on the console you can switch to the GUI simply by entering :gui from within Vim. You should see "MacOS X (unix) version" in the first couple of lines of output. If you want to check that you're actually running MacVim, run vi like this: $ vi -version We'll also need to tell Bash to clear its cache of where all your programs live, so that it'll search $PATH for vi again and find the new script, instead of the file in /usr/bin/vi: $ type vi That way: $ ln -s /usr/local/bin/mvim /usr/local/bin/vim Let's setup a link for vim too, in case you're ever tempted to run it Assuming you put the mvim script in /usr/local/bin, this should do it (though you might need sudo, depending on how your Mac is setup): $ ln -s /usr/local/bin/mvim /usr/local/bin/vi To get the vi command to run MacVim without the GUI we can make a symlink to the mvim script, and call it vi. You can get advice on how to do that by typing :help mvim inside MacVim they recommend putting the script in /usr/local/bin. If you haven't already done so, install the mvim script. MacVim's disk image also contains a script called mvim that you can put in a folder in your $PATH so that you can launch that same binary from the command line. When you run MacVim using the application icon it runs a binary inside your Applications folder. If MacVim isn't already installed, go and download it now. MacVim (which includes Ruby support) normally runs with a GUI, but you can run it in a terminal when you type vi if you prefer. When Apple compiled it they didn't link it against Ruby, which means that you can't use /usr/bin/vi with any Ruby based plugins. I read that slow scrolling due to rendering long lines was less pronounced in GVim and MacVim than in terminal Vim, but that was not the case for me.A recent version of Vim comes with every copy of Mac OS X. You can also use the menuing system for your graphical environment. Besides using iTerm instead of Terminal.app for the key repeat issue, no other changes in how I was running Vim helped. First, you can the graphical version of Vim from the command line by typing GVim. However, if youre working from a remote terminal or in any other situation. Note that I did not mention using tmux over screen, or Neovim instead of Vim. Open your practice file now, and try each of the commands that are discussed. All the tricks I currently know for dealing with slow scrolling in Vim. I don’t use this setting anymore because nocursorline was more useful. It turns off syntax highlighting after a max column value, so lines longer than that abrubtly lose syntax coloring. Basically, it seems to limit the number of times Vim renders, which sped up scrolling for me. You can read about it with help lazyredraw. That’s kind of a bummer, but if it means I can scroll through HTML and Ruby files, then I’ll take it. It turns off the bar that highlights the current line you’re on. This setting had the most impact of the three. There are three settings that helped this on my systems. If you’re a programmer, that means a lot of files! And the problem affects more than just macOS. The magic KeyRemap4MacBook values for me were:Įven with fast repeat settings, Vim can slow to a craw while scrolling through files that have long lines, when syntax highlighting is turned on. Tweak the repeat values even more with KeyRemap4MacBook.Terminal.app couldn’t cope with faster key repeat settings – Vim was still slow, though a bit faster. Now, the vanilla options helped some, but in order to get really fast scrolling speed, I had to take two more steps: Tweak the Key Repeat and Delay Until Repeat settings to find a good speed. I had to restart after changing these settings to see any effect. You can change Key Repeat settings in System Preferences -> Keyboard. It turns out there was a simple cause for the problem: key repeat settings. Scrolling with j and k was blindingly fast on Linux, but plodded along on my Mac so slowly that I began using Control-F and Control-B most of the time. you can install MacVim via homebrew and it will work with just mvim from the terminal or if you downloaded the app from the website, you can have an /. There was always a marked difference between Vim on my Mac and Vim on Linux. Other times, the problem is really about Vim’s ability to render long lines with syntax highlighting.įear not! There are solutions to both problems. In some cases, the problem is OS-specific: key repeat settings can slow down scrolling with the j and k keys. Vim, Neovim, and MacVim can all exhibit slow scrolling in macOS.
0 Comments
Leave a Reply. |