Jump to content

MacVim doesn't read my .vimrc when started via Alfred


Recommended Posts

Since I work with a lot of ASCII text files which I like to edit with MacVim, I've set my macOS so that all files with a .txt extension are opened with MacVim.  Then, if I want to edit one on the fly, I can just type my Alfred keyboard shortcut and then type "open somefile.txt" and Alfred will open it in MacVim.  But what I've noticed is that MacVim doesn't appear to be reading my ~/.vimrc file when I open files using Alfred as the settings I have in that file aren't set in MacVim when the file is opened.  On the other hand, if I were to open and terminal window and change to the directory where the file is located and open it using MacVim from the command line "mvim -v somefile.txt", all my vim settings are present.  Has anyone else had this problem?  Is this happening because I'm opening MacVim using Alfred?  If so, is there a way to fix it?  Thanks.

Link to comment

Then it’s either your environment (Mac apps don’t use your shell environment because they aren’t launched from a shell) or the mvim command behaves differently to the MacVim app.

 

The MacVim docs say its configuration file is ~/.gvimrc. What do you have in that file? If it doesn’t exist, what happens if you symlink your ~/.vimrc to ~/.gvimrc?

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...