view
is the readonly mode of vim
. I would like view
to read the exact same .vimrc
file for its initialization as vim
already does.
view
does not seem to read ~/.vimrc
by default (I checked by adding echo "hello, world"
at the bottom). Using view -u ~/.vimrc
does not work for me either. Reading :help initialization
it seems that there are special files for evim and eview, but not for view
.
Unsurprisingly, vim -R
reads .vimrc
files. How do I make view
do the same?
Version info
vim
$ vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jun 14 2019 11:41:55)
Included patches: 1-160, 399, 402-403, 1099
Modified by <bugzilla@redhat.com>
Compiled by <bugzilla@redhat.com>
Huge version without GUI. Features included (+) or not (-):
+acl +farsi +mouse_netterm +syntax
+arabic +file_in_path +mouse_sgr +tag_binary
+autocmd +find_in_path -mouse_sysmouse +tag_old_static
-balloon_eval +float +mouse_urxvt -tag_any_white
-browse +folding +mouse_xterm -tcl
++builtin_terms -footer +multi_byte +terminfo
+byte_offset +fork() +multi_lang +termresponse
+cindent +gettext -mzscheme +textobjects
-clientserver -hangul_input +netbeans_intg +title
-clipboard +iconv +path_extra -toolbar
+cmdline_compl +insert_expand +perl +user_commands
+cmdline_hist +jumplist +persistent_undo +vertsplit
+cmdline_info +keymap +postscript +virtualedit
+comments +langmap +printer +visual
+conceal +libcall +profile +visualextra
+cryptv +linebreak +python/dyn +viminfo
+cscope +lispindent -python3 +vreplace
+cursorbind +listcmds +quickfix +wildignore
+cursorshape +localmap +reltime +wildmenu
+dialog_con -lua +rightleft +windows
+diff +menu +ruby/dyn +writebackup
+digraphs +mksession +scrollbind -X11
-dnd +modify_fname +signs -xfontset
-ebcdic +mouse +smartindent -xim
+emacs_tags -mouseshape -sniff -xsmp
+eval +mouse_dec +startuptime -xterm_clipboard
+ex_extra +mouse_gpm +statusline -xterm_save
+extra_search -mouse_jsbterm -sun_workshop -xpm
system vimrc file: "/etc/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/etc"
f-b for $VIMRUNTIME: "/usr/share/vim/vim74"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -O2 -g -pipe -Wall -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D__linux__ -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L. -Wl,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,--enable-new-dtags -Wl,-rpath,/usr/lib64/perl5/CORE -Wl,-z,relro -L/usr/local/lib -Wl,--as-needed -o vim -lm -lnsl -lselinux -lncurses -lacl -lattr -lgpm -ldl -Wl,--enable-new-dtags -Wl,-rpath,/usr/lib64/perl5/CORE -fstack-protector -L/usr/lib64/perl5/CORE -lperl -lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
view
$ view !$
view --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jun 14 2019 11:42:11)
Included patches: 1-160, 399, 402-403, 1099
Modified by <bugzilla@redhat.com>
Compiled by <bugzilla@redhat.com>
Small version without GUI. Features included (+) or not (-):
+acl -farsi -mouse_sgr -tag_old_static
-arabic -file_in_path -mouse_sysmouse -tag_any_white
-autocmd -find_in_path -mouse_urxvt -tcl
-balloon_eval -float -mouse_xterm +terminfo
-browse -folding +multi_byte -termresponse
+builtin_terms -footer -multi_lang -textobjects
-byte_offset +fork() -mzscheme -title
-cindent -gettext -netbeans_intg -toolbar
-clientserver -hangul_input -path_extra -user_commands
-clipboard +iconv -perl -vertsplit
-cmdline_compl -insert_expand -persistent_undo -virtualedit
+cmdline_hist +jumplist -printer +visual
-cmdline_info -keymap -profile -visualextra
-comments -langmap -python -viminfo
-conceal -libcall -python3 -vreplace
-cryptv -linebreak -quickfix +wildignore
-cscope -lispindent -reltime -wildmenu
-cursorbind -listcmds -rightleft +windows
-cursorshape -localmap -ruby +writebackup
-dialog -lua -scrollbind -X11
-diff -menu -signs -xfontset
-digraphs -mksession -smartindent -xim
-dnd -modify_fname -sniff -xsmp
-ebcdic -mouse -startuptime -xterm_clipboard
-emacs_tags -mouse_dec -statusline -xterm_save
-eval -mouse_gpm -sun_workshop -xpm
-ex_extra -mouse_jsbterm -syntax
-extra_search -mouse_netterm -tag_binary
system vimrc file: "/etc/virc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/etc"
f-b for $VIMRUNTIME: "/usr/share/vim/vim74"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -O2 -g -pipe -Wall -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D__linux__ -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -Wl,-z,relro -L/usr/local/lib -Wl,--as-needed -o vim -lm -lselinux -lncurses -lacl -lattr -ldl
view
actually from Vim, and not something else (say, heirloom vi)? What doview --version
andvim --version
report?VIM - Vi IMproved 7.4
at the top. However, view reportsSmall version without GUI
compared to vim'sHuge version without GUI
. Nothing in the lists of included features (which are obviously different) suggest that initialization would be different. Both commands print similar list ofvimrc
files withview
reporting one more thanvim
:system vimrc file: "/etc/virc"
. I'll add both outputs to the question.view
is reading your.vimrc
file but you're not seeing the effects of it. For example, if you expected to see syntax highlighting, that's disabled on the "small" version of Vim in RHEL/CentOS 7. Use:scriptnames
to check which Vim script files were read by Vim (orview
), that might tell you more or confirm whether.vimrc
is being read or not...view
binary is provided by Vim, it should read your:vimrc
. Check the output of:scriptnames
to make sure.+eval
, thenechomsg()
won't work as well. @andrybak, you might need to linkview
to yourvim
binary (the huge version). Or useupdate-alternatives
, which is for Debian, so use the correct alternative for Redhat/CentOS