You are not logged in.

#1 2019-03-20 21:10:52

madscience
Member
From: Ontario, Canada
Registered: 2014-02-11
Posts: 82
Website

[SOLVED]vim not applying settings from my .vimrc - fresh vim install

I'm not able to get vim to apply settings from my .vimrc, unless I manually source the file after vim has started.  I uninstalled vim, and wiped all my configuration.  vim -S shows that vim is reading my vimrc right after reading /etc/vimrc, but it doesn't apply the settings unless I manually source it.  the contents of my .vimrc are:

set t_Co=256
syntax on
set encoding=utf-8
set laststatus=2
set showtabline=2
set noshowmode
set mouse=a
set ttymouse=xterm
set number
highlight Comment cterm=italic
highlight Comment gui=italic

Does anyone have any insight?

Last edited by madscience (2019-03-22 16:36:30)

Offline

#2 2019-03-21 03:10:19

mountaineerbr
Banned
Registered: 2018-12-08
Posts: 48

Re: [SOLVED]vim not applying settings from my .vimrc - fresh vim install

Not sure.... But a workaround while you do not figure that out is you can add 'source /path/to/usr/.vimrc' to the end of file at the system vimrc... Would you mind posting  the output of :scriptnames ? Also, t I could find on the internet is that if you use sudo vim, then it will not source your config, but root's. Would there be any aliases in your bashrc that may interfere with calling full vim? In one comment, someone says that vim 7.4 does not read .vimrc but I think that it is hardly your case... You can also run 'vim -V' for the verbose mode and see if there is something draws you attention.. Plugins may overwrite your settings!

Now, in this reference below, they say defaults.vim may be your problem. Check that out.
https://github.com/vim/vim/issues/2042

Good luck.

Offline

#3 2019-03-21 14:06:01

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,494

Re: [SOLVED]vim not applying settings from my .vimrc - fresh vim install

Really, I have no idea what the exact problem is could be anything, like mountaineerbr said.
But if you put this statement in '/etc/vimrc' you'll be sure the same vimrc is used 'everywhere'
change 'source' to where your vimrc is located

if !filereadable("~/.vimrc")
  source /home/user/.vimrc
endif

edit: add ! and remove else continue;)

Last edited by qinohe (2019-03-21 14:18:39)

Offline

#4 2019-03-21 14:49:24

seth
Member
Registered: 2012-09-03
Posts: 51,271

Re: [SOLVED]vim not applying settings from my .vimrc - fresh vim install

Does "vim -S" mean that there's some Session.vim involved?
How did you determine that your settings are not applied? Did you check all(!) variables or is this because Feature™ isn't activated?
Did you try to strace vim to see whether
a) your vimrc is opened
b) something else is opened afterwards?

Online

#5 2019-03-22 16:36:02

madscience
Member
From: Ontario, Canada
Registered: 2014-02-11
Posts: 82
Website

Re: [SOLVED]vim not applying settings from my .vimrc - fresh vim install

I set an italic font for syntax - italics work in URxvt (I tested).  When vim opens, no italics unless I manually :source ~./vimrc and then it works.  I can see from vim -V that my config is being sourced second, and then a bunch of stuff in /etc, which makes me think that my vimrc is being overridden.  I tried this with a fresh vim install to check, no plugins.  It does work with the above block added to .vimrc, so I'm marking it solved.

Offline

#6 2019-03-22 20:01:32

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,494

Re: [SOLVED]vim not applying settings from my .vimrc - fresh vim install

Not actually solved, workable!, you may find the time to find out why.
Italics in vim? I know there exists a plugin 'vim-notes' that make that possible.
You know Vim is not the same as 'LibreOffice Writer'?;)

Offline

#7 2019-03-22 20:10:57

seth
Member
Registered: 2012-09-03
Posts: 51,271

Re: [SOLVED]vim not applying settings from my .vimrc - fresh vim install

print "\e[3mfoo\e[23m"

Whether that prints italic text largely depends on your TE. If it does, the stanza in his vimrc will print italic comments.

I'd still watch for files being read after the vimrc, these things should™ not reset themselves.
Also ensure /etc/vimrc is the default one (pacman -Qkk vim)

Online

#8 2019-03-22 20:17:06

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,494

Re: [SOLVED]vim not applying settings from my .vimrc - fresh vim install

Ah cool, I didn't know it was possible that way,  looks like bash...

edit: of course t's bash..  I read TE = Text Editor != Terminal Emulator it's late, I'm done;)

Last edited by qinohe (2019-03-22 20:51:44)

Offline

#9 2022-02-03 09:02:29

GreatSUN
Member
Registered: 2022-02-03
Posts: 1

Re: [SOLVED]vim not applying settings from my .vimrc - fresh vim install

Hey guys, I just came across this issue when I have been wondering why my .vimrc was not taken (or did not have effect though loaded).

Meanwhile I found a proper workaround as vim -V shows off where it's trying to load files and when:

$HOME/.vim/after/plugin/ directory is loaded after plugins which might override settings from .vimrc which is loaded earlier.


Hope this helps someone else to solve the issue faster ;-)

Offline

Board footer

Powered by FluxBB