简体   繁体   中英

My .vimrc file is completely ignored

I have got a .vimrc file from one of my friends, however, vim ignores it. In an other topic ( Activation of `.vimrc` file ) it has turned out that the value of the VIM variable may cause problem (/usr/share/vim instead of /home/tobias). Should I change this route for the other one? If the answer is yes, how can I carry out it? Thank you for the answer.

-- edit --

$ vim --version :

VIM - Vi IMproved 7.1 (2007 May 12, compiled Oct 18 2008 09:05:15)
Included patches: 1-314
Compiled by buildd@excelsior.roeckx.be
Huge version without GUI.  Features included (+) or not (-):
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+cryptv +cscope +cursorshape +dialog_con +diff +digraphs -dnd -ebcdic
+emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path
+folding -footer +fork() +gettext -hangul_input +iconv +insert_expand +jumplist`
 +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap +menu
+mksession +modify_fname +mouse -mouseshape +mouse_dec +mouse_gpm
-mouse_jsbterm +mouse_netterm +mouse_xterm +multi_byte +multi_lang -mzscheme
-netbeans_intg -osfiletype +path_extra -perl +postscript +printer +profile
-python +quickfix +reltime +rightleft -ruby +scrollbind +signs +smartindent
-sniff +statusline -sun_workshop +syntax +tag_binary +tag_old_static
-tag_any_white -tcl +terminfo +termresponse +textobjects +title -toolbar
+user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace
+wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp
-xterm_clipboard -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -g -O2 -O2 -g -Wall
Linking: gcc   -Wl,--as-needed -L/usr/local/lib -o vim       -lncurses -lselinux -lacl -lgpm

-- endedit --

Just put your vimrc into $HOME/.vimrc . You can check whether it got sourced via :scriptnames . For troubleshooting, you can also temporarily add :echomsg "hello" in there. You don't need to mess with the $VIM variable. :help initialization has all the gruesome details, should you be interested.

In my case, my Ubuntu install only came with this tiny-vim thing installed. I solved the issue by running sudo apt install vim-gtk3

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM