You are not logged in.
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
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
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
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
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
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
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
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
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