You are not logged in.

#1 2014-11-01 19:15:12

MoonSwan
Member
From: Great White North
Registered: 2008-01-23
Posts: 881

[Solved] I can't get vim to save my selected colour theme

Have pity upon a Vim acolyte!  I have looked through the Arch Wiki documentation and I have completed vim's excellent "vimtutor" program.  Both have been immensely helpful but I still have these issues and I'm not sure where to look for the solutions for the following two issues.

I'm trying to get to grips with Vim but I'm having an issue where my Gvim/GUI editor-of-choice will not save my choice of theme or colours that I selected within the application's GUI.  I have installed Gvim and vim-qt-git from the AUR.  I have no .vimrc file and the default .viminfo file is in my home directory.

What I have tried by picking a theme within the GUI:

  • I installed Gvim, again I picked a theme, quit and re-started the program.  Result:  Upon re-starting vim-qt-git my theme colurs are back to the default theme it uses when running it for the first time.

  • I installed *only* vim-qt-git, ran it, picked a colour theme and exited the application.  Result:  same as a above. 

  • I ran vim-qt-git and I picked a theme, made a dummy document, saved the document and quit vim-qt-git.  Result:  after re-starting it my coloured theme is once again the default theme. 

Could someone also please tell me how to get rid of the second/original screen at the bottom of my vim document when I try to invoke the ":help user-manual" command?  The manual comes up but below it is another area (is that what's referred to as a "buffer?") which is a blank space.

Edit - fixed typo in title

Last edited by MoonSwan (2014-11-01 21:17:34)

Offline

#2 2014-11-01 20:01:16

ids1024
Member
From: California
Registered: 2013-08-16
Posts: 243
Website

Re: [Solved] I can't get vim to save my selected colour theme

Vim does not save settings; that has to be done manually. To set the color scheme to "blue", add "colorscheme blue" to .vimrc.


"Only wimps use tape backup: _real_ men just upload their important stuff on ftp, and let the rest of the world mirror it."—Linus Torvalds
s/ftp/git/

https://iandouglasscott.com | https://github.org/ids1024 | https://keybase.io/ids1024

Offline

#3 2014-11-01 20:25:04

MoonSwan
Member
From: Great White North
Registered: 2008-01-23
Posts: 881

Re: [Solved] I can't get vim to save my selected colour theme

ids1024, so does that mean that a graphical vim application also will not save its colour settings?  I would have thought the gui version of vim would do so.  How incredibily non-intutive.  hmm  Now I'm wondering if this mean that the majority of my preferences must be also set by .vimrc?

Offline

#4 2014-11-01 20:36:52

ids1024
Member
From: California
Registered: 2013-08-16
Posts: 243
Website

Re: [Solved] I can't get vim to save my selected colour theme

MoonSwan wrote:

ids1024, so does that mean that a graphical vim application also will not save its colour settings?  I would have thought the gui version of vim would do so.  How incredibily non-intutive.  hmm  Now I'm wondering if this mean that the majority of my preferences must be also set by .vimrc?

As far as I am aware, all configuration is done through .vimrc. I personally do not bother with gVim and just use vim in a terminal emulator, since gVim does not add much.


"Only wimps use tape backup: _real_ men just upload their important stuff on ftp, and let the rest of the world mirror it."—Linus Torvalds
s/ftp/git/

https://iandouglasscott.com | https://github.org/ids1024 | https://keybase.io/ids1024

Offline

#5 2014-11-01 20:38:20

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [Solved] I can't get vim to save my selected colour theme

MoonSwan wrote:

ids1024, so does that mean that a graphical vim application also will not save its colour settings?  I would have thought the gui version of vim would do so.  How incredibily non-intutive.  hmm  Now I'm wondering if this mean that the majority of my preferences must be also set by .vimrc?


Well, it would have to save them somewhere...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2014-11-01 20:59:08

MoonSwan
Member
From: Great White North
Registered: 2008-01-23
Posts: 881

Re: [Solved] I can't get vim to save my selected colour theme

@ids1024, I see what you're saying.

@jwr, yes, I realise a GUI app has to save its settings somewhere.  However, even if I make a blank .vimrc file the GUI versions of Vim don't get written to it.  I did find a qVim folder under .config/Vim/qVim.conf.  Unfortunately all that is contained in that file is some sort of coding.  See here:

:~: cat .config/Vim/qVim.conf 
[mainwindow]
state=@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\0\0\0\x6@\0\0\x3\xd6\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\x1\0\0\0\x2\0\0\0\x2\0\0\0\xe\0t\0o\0o\0l\0\x62\0\x61\0r\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\xe\0t\0\x61\0\x62\0l\0i\0n\0\x65\0\0\0\x2\x9e\xff\xff\xff\xff\0\0\0\0\0\0\0\0)

So that logic does seem to point to the hypothesis (fact?)  that all configuration is done in ~/.vimrc, whether it is using a GUI or just the console version of Vim.

Offline

#7 2014-11-01 21:04:38

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [Solved] I can't get vim to save my selected colour theme

That's the fact. See the wiki page; your settings are read from /etc/vimrc (which is worth reading as well) or, if it exists, ~/.vimrc


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2014-11-01 21:16:38

MoonSwan
Member
From: Great White North
Registered: 2008-01-23
Posts: 881

Re: [Solved] I can't get vim to save my selected colour theme

Thank you, ids1024, for the help. 
@JWR, Thank you, Monsieur!  As always (or so it seems) your knowledge and answers fix my problems.  One day I'd like to repay the favour by helping you with a problem.  smile

Last edited by MoonSwan (2014-11-01 22:27:59)

Offline

#9 2014-11-01 22:05:33

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,543
Website

Re: [Solved] I can't get vim to save my selected colour theme

I've also never used gvim - frankly I'm surprised there is a menu or whatever option for color themes.  The gui could/should certainly set default fg/bg colors, and set font, font size, and other parameters that would be handled by a terminal emulator if using regular vim.  But everything else should be in vimrc.  Keeping settings in vimrc has the added benefit that if you move to another machine, another implementation of vim, or even decide to use vim in ssh sessions, you can easily use all the same settings you are used to (once you set them up in your vimrc, that is).


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#10 2014-11-01 22:08:01

progandy
Member
Registered: 2012-05-17
Posts: 5,322

Re: [Solved] I can't get vim to save my selected colour theme

Vim uses a convoluted configuration file scheme. In step 4 of the startup sequence the system and user vimrc (and exrc) are read. Then it goes on and loads some other stuff and then in step 8 only gVim loads gvimrc.
This is documented in ":help startup" and ":help gui-init"

If you want to put everything in vimrc, you can use "if has('gui_running') ... endif" There are even tests for the gui type (x11, gtk, win, mac, ...)

Last edited by progandy (2014-11-01 22:11:20)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#11 2014-11-01 22:27:34

MoonSwan
Member
From: Great White North
Registered: 2008-01-23
Posts: 881

Re: [Solved] I can't get vim to save my selected colour theme

@Trilby, I agree that the GUI editor should set all of those options if you configured it to do so.  For whatever reason GVim or qVim doesn't seem to respect that idea.  I wish I could figure out why that is too.

@progandy, thank you for the information.  When I have a few minutes I'll have a look at those help files.  I don't know if I will use that "gui test" mathingy but it's good to know that it is possible to use just the .vimrc file by itself.

And, to a answer my own question using Ctrl-W-c will kill the currently focused buffer.

Offline

Board footer

Powered by FluxBB