0

Not sure if this is the appropriate place to ask, but at work I use a laptop to SSH into a remote Linux server and do some work from there.

I want to use the server's .vimrc file for my own laptop as well but can't find any Vim-related files. If it helps it seems like the server's running on a Docker container?

Does anyone know how I would get access to the Vim configuration info?

Edit

Here's the output when I type :version within Vim:

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jan 11 2023 23:53:12)
Included patches: 1-3995, 4563, 4646, 4774, 4895, 4899, 4901, 4919
Modified by [email protected]
Compiled by [email protected]
Huge version without GUI.  Features included (+) or not (-):
+acl               -clipboard         -dnd               +gettext           +listcmds          -mouse_sysmouse    +postscript        -sound             +termresponse      +visualextra
+arabic            +cmdline_compl     -ebcdic            -hangul_input      +localmap          +mouse_urxvt       +printer           +spell             +textobjects       +vreplace
+autocmd           +cmdline_hist      +emacs_tags        +iconv             -lua               +mouse_xterm       +profile           +startuptime       +textprop          +wildignore
+autochdir         +cmdline_info      +eval              +insert_expand     +menu              +multi_byte        -python            +statusline        +timers            +wildmenu
-autoservername    +comments          +ex_extra          +ipv6              +mksession         +multi_lang        +python3           -sun_workshop      +title             +windows
-balloon_eval      +conceal           +extra_search      +job               +modify_fname      -mzscheme          +quickfix          +syntax            -toolbar           +writebackup
+balloon_eval_term +cryptv            -farsi             +jumplist          +mouse             +netbeans_intg     +reltime           +tag_binary        +user_commands     -X11
-browse            +cscope            +file_in_path      +keymap            -mouseshape        +num64             +rightleft         -tag_old_static    +vartabs           -xfontset
++builtin_terms    +cursorbind        +find_in_path      +lambda            +mouse_dec         +packages          -ruby              -tag_any_white     +vertsplit         -xim
+byte_offset       +cursorshape       +float             +langmap           +mouse_gpm         +path_extra        +scrollbind        -tcl               +vim9script        -xpm
+channel           +dialog_con        +folding           +libcall           -mouse_jsbterm     -perl              +signs             +termguicolors     +viminfo           -xsmp
+cindent           +diff              -footer            +linebreak         +mouse_netterm     +persistent_undo   +smartindent       +terminal          +virtualedit       -xterm_clipboard
-clientserver      +digraphs          +fork()            +lispindent        +mouse_sgr         +popupwin          +sodium            +terminfo          +visual            -xterm_save
   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/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -Wdate-time -g -O2 -ffile-prefix-map=/build/vim-XHiCvL/vim-8.2.3995=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wf
ormat -Werror=format-security -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim -lm -ltinfo -lselinux -lsodium -lacl -lattr -lgpm -L/usr/lib/python3.10/config-
3.10-x86_64-linux-gnu -lpython3.10 -lcrypt -ldl -lm -lm

5
  • Do you know which distro this is?
    – Friedrich
    May 10, 2023 at 9:08
  • 1
    Yes. It's Ubuntu 22.04.
    – Sean
    May 10, 2023 at 12:27
  • According to Google, Ubuntu features a vimrc template at /etc/vimrc. Anyway, please edit and share the output of :version. Might not hurt to see which vim is actually launched with ls -l /etc/alternatives/vim
    – Friedrich
    May 10, 2023 at 13:46
  • See :scriptnames
    – balki
    May 10, 2023 at 14:45
  • What is the configuration that you are missing in your laptop? Could you compare your server configuration with your laptop configuration? May 11, 2023 at 4:55

1 Answer 1

0

I would do:

:echo $MYVIMRC

You'll get also some information about what Vim consider when starting using:

:version

Here is what I get:

...
   system vimrc file: "$VIM\vimrc"
     user vimrc file: "$HOME\_vimrc"
 2nd user vimrc file: "$HOME\vimfiles\vimrc"
 3rd user vimrc file: "$VIM\_vimrc"
      user exrc file: "$HOME\_exrc"
  2nd user exrc file: "$VIM\_exrc"
  system gvimrc file: "$VIM\gvimrc"
    user gvimrc file: "$HOME\_gvimrc"
2nd user gvimrc file: "$HOME\vimfiles\gvimrc"
3rd user gvimrc file: "$VIM\_gvimrc"
       defaults file: "$VIMRUNTIME\defaults.vim"
    system menu file: "$VIMRUNTIME\menu.vim"

The :scriptnames command will tell you what file has been loaded by Vim.

5
  • What if :echo $MYVIMRC doesn't return anything?
    – Sean
    May 10, 2023 at 12:29
  • Did you perform the command within Vim? May 10, 2023 at 12:32
  • 1
    Yes, I performed it within Vim (never knew comments had a minimum character requirement).
    – Sean
    May 10, 2023 at 12:53
  • 1
    What is the version of Vim you are using (what is result of the :version command)? May 10, 2023 at 13:02
  • I believe it's version 8.2. I edited the full output when I type :version into the OP.
    – Sean
    May 10, 2023 at 21:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.