[vim/vim] Where to set compiler options to read /etc/vim, ~./vimrc, and `~/.vim/`? (Discussion #13268)

8 views
Skip to first unread message

Darin Hensley

unread,
Oct 4, 2023, 9:54:27 AM10/4/23
to vim/vim, Subscribed

I am compiling VIM in Ubuntu 20.04. I tried compiling it according to this doc. However, I can not get it to read the system file /etc/vim. It also does not read ~./vimrc and does not read ~/.vim/ (contains colors, pack, plugins, etc) and does not read ~/.vimrc. Where do I set these settings so it compiles with these?


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/repo-discussions/13268@github.com>

Gary Johnson

unread,
Oct 4, 2023, 1:41:19 PM10/4/23
to reply+ACY5DGEBTU6OWA56BA...@reply.github.com, vim...@googlegroups.com
On 2023-10-04, Darin Hensley wrote:
> I am compiling VIM in Ubuntu 20.04. I tried compiling it according to this doc.
> However, I can not get it to read the system file /etc/vim. It also does not
> read ~./vimrc and does not read ~/.vim/ (contains colors, pack, plugins, etc)
> and does not read ~/.vimrc. Where do I set these settings so it compiles with
> these?

The default configuration should just work. I've never had to set
any of those when building Vim. The system I use most often is also
Ubuntu 20.04.

The output of :version or "vim --version" should contain a block
like this, where the locations of all those files are shown.

system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$VIM/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
defaults file: "$VIMRUNTIME/defaults.vim"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/usr/local/share/vim"

Does yours look like that?

Also, you can see where Vim is finding these files at startup with
the :scriptnames command. What files does that command show?

If those don't give you enough clues, then another tool to try is
strace, e.g.,

$ strace -o strace.out vim -cq

The resulting strace.out file will show you all the files that vim
checked the status of and tried to open. That would show if vim
tried to open any of those files and why it may have failed.

HTH,
Gary

vim-dev ML

unread,
Oct 4, 2023, 1:41:38 PM10/4/23
to vim/vim, vim-dev ML, Your activity

On 2023-10-04, Darin Hensley wrote:
> I am compiling VIM in Ubuntu 20.04. I tried compiling it according to this doc.
> However, I can not get it to read the system file /etc/vim. It also does not
> read ~./vimrc and does not read ~/.vim/ (contains colors, pack, plugins, etc)
> and does not read ~/.vimrc. Where do I set these settings so it compiles with
> these?


Reply to this email directly, view it on GitHub,.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/repo-discussions/13268/comments/7189823@github.com>

Darin Hensley

unread,
Oct 4, 2023, 2:52:25 PM10/4/23
to vim/vim, vim-dev ML, Comment

Thank you for the reply. It does look like what you posted. I was able to get it to read the system wide file /etc/vim/vimrc with export VIM=/etc/vim/.

However, I have 2 issues now:

  1. I get a error E484: Can't open file /etc/vim/syntax/syntax.vim. This file does not exist on my system. Should it with ver 9? I was prev using ver 8. It comes from
" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
if has("syntax")
  syntax on
endif
  1. I have ~/.vimrc but my vim session is not loading that I can see. I am missing my themes/color and auto indentions.
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Sep 27 2023 09:13:13)
Included patches: 1-1943
Compiled by one@work
Huge version without GUI.  Features included (+) or not (-):
+acl               +file_in_path      +mouse_urxvt       -tag_any_white
+arabic            +find_in_path      +mouse_xterm       -tcl
+autocmd           +float             +multi_byte        +termguicolors
+autochdir         +folding           +multi_lang        +terminal
-autoservername    -footer            -mzscheme          +terminfo
-balloon_eval      +fork()            +netbeans_intg     +termresponse
+balloon_eval_term -gettext           +num64             +textobjects
-browse            -hangul_input      +packages          +textprop
++builtin_terms    +iconv             +path_extra        +timers
+byte_offset       +insert_expand     -perl              +title
+channel           +ipv6              +persistent_undo   -toolbar
+cindent           +job               +popupwin          +user_commands
-clientserver      +jumplist          +postscript        +vartabs
-clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +vim9script
+cmdline_hist      +langmap           -python            +viminfo
+cmdline_info      +libcall           -python3           +virtualedit
+comments          +linebreak         +quickfix          +visual
+conceal           +lispindent        +reltime           +visualextra
+cryptv            +listcmds          +rightleft         +vreplace
+cscope            +localmap          -ruby              +wildignore
+cursorbind        -lua               +scrollbind        +wildmenu
+cursorshape       +menu              +signs             +windows
+dialog_con        +mksession         +smartindent       +writebackup
+diff              +modify_fname      -sodium            -X11
+digraphs          +mouse             -sound             -xfontset
-dnd               -mouseshape        +spell             -xim
-ebcdic            +mouse_dec         +startuptime       -xpm
+emacs_tags        -mouse_gpm         +statusline        -xsmp
+eval              -mouse_jsbterm     -sun_workshop      -xterm_clipboard
+ex_extra          +mouse_netterm     +syntax            -xterm_save
+extra_search      +mouse_sgr         +tag_binary        
-farsi             -mouse_sysmouse    -tag_old_static    
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -O2 -fno-strength-reduce -Wal


Reply to this email directly, view it on GitHub,.
You are receiving this because you commented.Message ID: <vim/vim/repo-discussions/13268/comments/7190447@github.com>

Christian Brabandt

unread,
Oct 4, 2023, 2:54:57 PM10/4/23
to vim/vim, vim-dev ML, Comment

check what is $VIMRUNTIME is set when running vim: :echo $VIMRUNTIME

Also just to be sure, you did use :make install? Else you would need to set the $VIMRUNTIME environment variable


Reply to this email directly, view it on GitHub,.
You are receiving this because you commented.Message ID: <vim/vim/repo-discussions/13268/comments/7190470@github.com>

Darin Hensley

unread,
Oct 8, 2023, 3:26:25 PM10/8/23
to vim/vim, vim-dev ML, Comment

:echo $VIMRUNTIME shows as /usr/local/share/vim/vim90

Here is my command history on I compiled and installed it:

34187  ./configure --prefix=/usr
34188  make distclean
34189  ./configure --prefix=/usr --enable-gui=gtk 
34190  make VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim MAKE="make -e"
34191  sudo make VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim MAKE="make -e"
34192  make install
34193  sudo make install


Reply to this email directly, view it on GitHub,.
You are receiving this because you commented.Message ID: <vim/vim/repo-discussions/13268/comments/7224545@github.com>

Reply all
Reply to author
Forward
0 new messages