Macvim



Question or issue on macOS:

That there are a lot of MacVim.app left overs in my system, as follows. They are all accessible (I can open a file through any one of the following 5) That the Vim opened through my Terminal is of a different version (Vim 8.0, 1-543). Worst still, I got Python compatibility issue across all versions of the MacVim and Vim. Assume MacVim is installed in the Application folder. Instead of adding MacVim path to your environment, create a link by typing this in terminal: sudo ln -s /Applications/MacVim.app/Contents/bin/mvim /usr/local/bin/mvim Then, open a new terminal window/tab and type mvim.

I have installed MacVim but I cannot figure out how to do some formatting things.

The screen shot below shows:

Here is what I would like to do:

http://torch.cs.dal.ca/~summers/Picture%205.png

This is my .gvimrc:

This is the color scheme for .jak files located in (~/.vim/syntax/jak.vim):

How to solve this problem?

Solution no. 1:

For the font issue (in .gvimrc):

will set the font in MacVim to Menlo, size 11.

As for the syntax highlighting, it might just be that the colorscheme you are using in console vim is not being picked up by MacVim:

Putting this command in .gvimrc will use the xoria256 colorscheme (for example). I have found that the colorscheme setting in .vimrc are not always picked up correctly.

Solution no. 2:

If you’d like to experiment with your font settings try

That will allow you to choose a font using the standard mac font window. Once you’ve found the font you like, type:

It will show you what the current setting is for guifont. Then you can type that into your .gvimrc.

Solution no. 3:

I’m not on a mac right now so I can’t find the exact reference for you, but I found that while playing around in the menus, one can manually change some of these settings… and then to bring up the configuration file to see what those settings translate to in words. As a result, I was able to add these lines to my standard ~/.vimrc (which Macvim does read), in order to change the font:

You should be able to find similar settings for colours very nearby.
(I’ll edit this answer when I get back to my mac to add more details… you’ll have to wait ~6 hours though.)

Solution no. 4:

You can change the font with this command:

The text color is a bit more complicated because it is syntax highlighting. But you can change this the same way you change the text color in any whatever version of vim you have used before. I use GVIM for Mac every day and I don’t notice any differences between it and GVIM for Windows, for example. For color schema changes might I suggest this great script:

It should give you a lot of great color schemes to try, and any of them can be easily edited, so it’s a good starting point. Good luck!

Solution no. 5:

Long story short: :h :hi (:h is a shortcut for :help, :hi for :highlight) and look for the guifg.

In your custom color scheme you define only cterm part – the guifg, guibg, etc are all missing. That’s why VIM in GUI mode is using default colors from your color scheme (:h :colo).

Hope this helps!

Vim (or MacVim) as a C/C++ IDE

This post is meant to be a little guide to setting up Vim (or MacVim) as your next favorite C/C++ IDE. Vim is probably the most powerful text editor that humans have ever created, so you should consider using it even if its learning curve is a bit steep.

MacVim

First, let’s install MacVim. MacVim adds a graphical interface to Vim that can help newcomers (only for OSX users, others should consider GVim). Skip the next steps if you want to use the regular Vim instead.

  • Get the latest snapshot of MacVim from here (make sure you have the correct OSX version).
  • Decompress it (double click) and drag MacVim.app to your Applications folder.
  • Open the Terminal (commonly located in /Applications/Utilities/Terminal.app, but I suggest you put it in your Dock) and go to the MacVim Snapshot folder you just downloaded. In my case, I had to type the following:
    cd ~/Downloads/MacVim-snapshot-73/
  • Copy the mvim binary to your PATH so that you can open MacVim from any directory in your computer. Like this (you will have to enter your machine password):
    sudo cp mvim /usr/bin
  • Now you should be able to start a new document with MacVim by typing:
    mvim hello.c
    (Type :w to quit).

.vimrc

Vims Clothing Store

Now that you have Vim (and/or MacVim) installed in your system, the next thing you should do is to set it up to adapt it to your needs. The rest of the instructions work for Vim and MacVim, so I will use Vim to refer to both (simply replace vim for mvim if you want to use MacVim). Vim is highly configurable, but here I will describe what I believe is the most useful setup for new users and C/C++ developers.

The Vim (or MacVim) configuration file is located in ~/.vimrc. Therefore, type vim ~/.vimrc to start editing your configuration. You might see a blank file if you have never edited Vim’s configuration before. You can copy and paste the following. There’s a comment for the most important commands, so that you can understand what these lines do if you are interested.

Plugins

Now it’s time to install some plugins. We will start with Pathogen, a script to make the installation of other scripts extremely easy. To install Pathogen, just type:

mkdir -p ~/.vim/autoload ~/.vim/bundle<br /> curl https://raw.githubusercontent.com/tpope/vim-pathogen/master/autoload/pathogen.vim > ~/.vim/autoload/pathogen.vim<br />

Using Pathogen, we will install Syntastic, a wonderful plugin to identify errors in your code (linting) in the most popular programming languages. To install it, just type:

cd ~/.vim/bundle &#038;&#038; <br /> git clone https://github.com/scrooloose/syntastic.git

Gvim

Now restart Vim and type :Helptags. Linting should be working now for C/C++.

The next plugin to install is MiniBufExplorer, which will make our life easier when dealing with multiple files in Vim. To install it, simply type:

cd ~/.vim/bundle &#038;&#038; <br /> git clone https://github.com/fholgado/minibufexpl.vim.git

We also want to have some auto complete options when developing our C/C++ programs. The best plugin I’ve found is called YouCompleteMe, which is compatible with basically all the most popular programming languages to date. Type the following to install it:

cd ~/.vim/bundle &#038;&#038; <br /> git clone https://github.com/Valloric/YouCompleteMe.git<br /> cd YouCompleteMe<br /> git submodule update --init --recursive<br /> ./install.sh --clang-completer

Note: You might need to install Homebrew to install YouCompleteMe. To install it, type:

<br /> ruby -e '$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)'<br />

You will need to do some additional setup in order to get the plugin working. As you may see in the second to last line of the .vimrc above, we set up the default configuration file in ~/.vim/bundle/YouCompleteMe/.ycm_extra_conf.py. You can simply copy my .ymc_extra_conf.py in this folder. To do so, simply type:

curl /drop/.ycm_extra_conf.py > ~/.vim/bundle/YouCompleteMe/.ycm_extra_conf.py

Finally, the last plugin to install is the C Plugin, which will help us when navigating through C/C++ files, debugging, etc. This plugin does not support Pathogen installation, so we will have to do it manually. Go to the official plugin page: http://www.vim.org/scripts/script.php?script_id=213 and download the latest cvim.zip. Copy the zip file to your ~/.vim/ folder and type:

unzip cvim.zip

Before we are done, you should configure the template file with your name and affiliation. Featured charactersmicrosoft agents website. Download insanity workout full version free. Comments. To do so, edit the template file and edit the user macros, like this:

vim ~/.vim/c-support/templates/Templates

Www.mavimodel.com

My User Macros look like this:

`§ § User Macros§

If you’ve done everything correctly, you will be able to create a new .c file (e.g. vim hello.c and a nice template will be included in the top of the file. Moreover, you should be able to open multiple files (e.g. :e otherfile.c) and they will appear in the MiniBufferExplorer. And finally, if you make some errors while coding, Syntastic will tell you. As an example, see the following screenshot:

Macvim Brew

Please, let me know if you have any questions. I hope you enjoy your new IDE!