ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm using gVIM at work (sadly, on a Windows machine) and want to know how to save my color theme, window size, and font settings so that I don't lose them when I close the program.
Anyone know how I can do this?
Click here to see the post LQ members have rated as the most helpful post in this thread.
> I don't know exactly what you want to modify/save.
1. font
2. color scheme
I'd like to learn how to do this as well. When I used to use gvim, I tended to run the program multiple times per day, and would have liked my font and color scheme settings to stick.
Ok folks, I found an easy way to save your font and color scheme settings in gVIM. Here goes:
First, specify your font by going to Edit > Select Font (btw, I'm on a Windows machine, so maybe the Linux menus are different).
Second, after you've selected your font, enter the command :mkvimrc!. This will write your font choice (and key mappings, etc) to your _vimrc file. This will NOT save your color settings if you're using a theme, however. To tell gVIM to use a color theme at startup, go to the next step.
Third, to specify your color theme, enter the command :e _vimrc. This will open your VIM settings file for editing. Scroll to the bottom of the file and add the line "colors blue". You can specify whatever color theme you want in place of "blue", provided you use the name of the theme itself. No file references are necessary. And it's case-insensitive too, so you could enter "colors Elflord" or "colors elflord" and be fine either way. Just make sure you write the file to disk before you quit gVIM.
Now, restart gVIM to see the fruits of your labor.
Hope this helps. If anyone can figure out how to preseve window sizes, I'd love to know.
Thanks simsjr!
One minor addition:
[...]
BTW -- why the exclamation point after the :mkvimrc? It doesn't see to make a difference for me whether I include it or not.
Da di da ba doo doo, hmmm? what? the exclamation mark? Oh yea, it OVERWRITES your .vimrc file. You know, the one you've been crafting for months!!!
Distribution: $ uname -snrvmo Linux martianpackets 3.13.0-29-generic #53-Ubuntu SMP Jun 4 2014 x86_64 GNU/Linux
Posts: 13
Rep:
don't lose hand-inserted colorscheme, etc when using mkvimrc (how?)
Howdy Folks... I read this aged thread and I cannot figure out one thing in particular. I set the colorscheme in gvim as
colorscheme Elflord
which works awesome from the command line (ie the : prompt), and so I put the same value near the bottom of the .gvimrc file (which I put in $HOME)... well, when I issue
: mkvimrc! $HOME/.gvimrc
it overwrites the existing gvimrc file as I wish, but even though I explicitly put in the colorscheme directive (or is it a command?), the colorscheme directive is removed!
Any idea how to put non-set statements (statements that arent of the form: set tabstop=4) into my gvimrc file and then issue mkvimrc! $HOME/.gvimrc without my non-set statements being removed? I know this is an old thread and it would be so awesome if we could reopen it and discuss the best solution. Thanks in advance!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.