Problems with vim-pathogen on mac osx - macos

I have recently moved from Ubuntu to Mac osx. And my first thing is to bring my vim with me.
I downloaded source from vim.org and compiled with gcc.( I'll put the version output at the bottom of my post)
I added pathogen.vim to ~/.vim/autoload directory. But when I add the code in ~/.vim/vimrc:
execute pathogen#infect()
I got errors when tring to start vim, here is the error output:
Error detected while processing /Users/jack/.vim/vimrc:
line 3:
E117: Unknown function: pathogen#infect
E15: Invalid expression: pathogen#infect()
Press ENTER or type command to continue
First I though perhaps vim did not load pathogen.vim, but :scriptnames showed it did load!
1: ~/.vim/vimrc
2: ~/.vim/bundle/vim-pathogen/autoload/pathogen.vim
After I ran :function, something caught my attention, there is a "abort" after the infect function, I google around, and found it did not solve my problem either:
function pathogen#legacyjoin(...) abort
function pathogen#runtime_append_all_bundles(...) abort
function pathogen#surround(path) abort
function <SNR>2_Findcomplete(A, L, P)
function pathogen#uniq(list) abort
function pathogen#incubate(...) abort
function pathogen#glob(pattern) abort
function <SNR>2_warn(msg)
function pathogen#runtime_findfile(file, count) abort
function pathogen#separator() abort
function pathogen#runtime_prepend_subdirectories(path)
function pathogen#glob_directories(pattern) abort
function pathogen#infect(...) abort
function pathogen#is_disabled(path)
function pathogen#join(...) abort
function pathogen#cycle_filetype()
function pathogen#split(path) abort
function <SNR>2_find(count, cmd, file, lcd)
function pathogen#fnameescape(string) abort
function pathogen#execute(...) abort
function pathogen#helptags() abort
Can anyone help point out what should I do to solve this problem?
Here is the version output with command "vim --version":
JacktekiMac-Pro:.vim$ vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Dec 6 2013 17:01:30)
MacOS X (unix) version
Huge version without GUI. Features included (+) or not (-):
+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 +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
+farsi +mouse_netterm +syntax
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/usr/local/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X_UNIX -no-cpp-precomp -O2 -fno-strength-reduce -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -o vim -lm -lncurses -liconv -framework Cocoa

I found the problem.
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
I set $VIM to ~/.vim, which is the same as the 2nd user vimrc file. So the vimrc file load twice.
After I change $VIM to /etc/vim, everything turns out be good.

I had a similar problem and found that I had not created the ~/.vim directory correctly. I created it in the root by changing directory there and typing mkdir /.vim but for some reason it was not working. Then I deleted this folder and did mkdir ~/.vim and was ably to install and use pathogen.

Related

Wrong Vim syntax highlighting group in vim filetype

Hello to all Vim users,
I am running into a syntax color issue that I cannot solve: the Plugin word in my vimrc suddenly stopped being highlighted (colored) (see screenshot) for reasons that I cannot understand. I have this exact vimrc on another computer where the syntax coloring is working fine.
My configuration
MacOS Mojave
My shell emulator is ZSH
I use Vim installed from MacVim (please note that I am not using the GUI provided by MacVim, I use vim in terminal)
$VIMRUNTIME = /usr/local/Cellar/macvim/8.2-166_1/MacVim.app/Contents/Resources/vim/runtime
colorscheme set to default
$VIMRUNTIME/syntax/vim.vim is version 8.0-41 from the latest update of MacVim and I have not edited manually.
vim version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Oct 7 2020 19:37:01)
macOS version
Included patches: 1-1719
Compiled by Homebrew
Huge version with MacVim GUI. Features included (+) or not (-):
+acl +cursorshape +ipv6 -mouse_sysmouse +ruby +toolbar
+arabic +dialog_con_gui +job +mouse_urxvt +scrollbind +transparency
+autocmd +diff +jumplist +mouse_xterm +signs +user_commands
+autochdir +digraphs +keymap +multi_byte +smartindent +vartabs
-autoservername +dnd +lambda +multi_lang -sound +vertsplit
+balloon_eval -ebcdic +langmap -mzscheme +spell +virtualedit
+balloon_eval_term +emacs_tags +libcall +netbeans_intg +startuptime +visual
+browse +eval +linebreak +num64 +statusline +visualextra
++builtin_terms +ex_extra +lispindent +odbeditor -sun_workshop +viminfo
+byte_offset +extra_search +listcmds +packages +syntax +vreplace
+channel -farsi +localmap +path_extra +tag_binary +wildignore
+cindent +file_in_path +lua +perl -tag_old_static +wildmenu
+clientserver +find_in_path +menu +persistent_undo -tag_any_white +windows
+clipboard +float +mksession +popupwin +tcl +writebackup
+cmdline_compl +folding +modify_fname +postscript +termguicolors -X11
+cmdline_hist -footer +mouse +printer +terminal -xfontset
+cmdline_info +fork() +mouseshape +profile +terminfo +xim
+comments +fullscreen +mouse_dec -python +termresponse -xpm
+conceal +gettext -mouse_gpm +python3 +textobjects -xsmp
+cryptv -hangul_input -mouse_jsbterm +quickfix +textprop -xterm_clipboard
+cscope +iconv +mouse_netterm +reltime +timers -xterm_save
+cursorbind +insert_expand +mouse_sgr +rightleft +title
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: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe -DMACOS_X -DMACOS
_X_DARWIN -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl#1.
1/lib -L/usr/local/opt/readline/lib -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/l
ocal/opt/openssl#1.1/lib -L/usr/local/opt/readline/lib -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon
-lm -lncurses -liconv /usr/local/lib/libintl.a -framework AppKit -L/usr/local/opt/lua/lib -llua5.3 -fstack-protecto
r -L/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE -lperl -L/usr/local/opt/python#3.9/Frameworks/Python.fr
amework/Versions/3.9/lib/python3.9/config-3.9-darwin -lpython3.9 -framework CoreFoundation -F/System/Library/Frameworks
-framework Tcl -framework CoreFoundation -lruby.2.7
Can anyone help me on this please ?
Thank you very much,
Yoann
EDIT: This is the syntax highlighting I am trying to achieve.

Vim: running `:Explore` (netrw) results in "E492: Not an editor command: Explore"

I can't use :Explore, :Sexplore, et al in both vim or neovim. When I try, I get E492: Not an editor command: Explore.
I know it's a problem with my vimrc, because :Explore works when I run vim -u empty_file.
So, which configuration/plugin is breaking netrw?
Here's my vimrc, which is sourced in nvim's init.vim.
Yes, I know - I have a lot of plugins. I'm a recent convert and just playing the field to see what's worth keeping.
Vim and nVim were installed via homebrew and I believe they are latest stable. Here's the build info for both vim and nvim:
> vim --version
VIM - Vi IMproved 8.1 (2018 May 17, compiled May 22 2018 22:51:49)
macOS version
Included patches: 1
Compiled by Homebrew
Huge version without GUI. Features included (+) or not (-):
+acl +farsi +mouse_sgr -tag_any_white
+arabic +file_in_path -mouse_sysmouse -tcl
+autocmd +find_in_path +mouse_urxvt +termguicolors
-autoservername +float +mouse_xterm +terminal
-balloon_eval +folding +multi_byte +terminfo
+balloon_eval_term -footer +multi_lang +termresponse
-browse +fork() -mzscheme +textobjects
++builtin_terms -gettext +netbeans_intg +timers
+byte_offset -hangul_input +num64 +title
+channel +iconv +packages -toolbar
+cindent +insert_expand +path_extra +user_commands
-clientserver +job +perl +vertsplit
+clipboard +jumplist +persistent_undo +virtualedit
+cmdline_compl +keymap +postscript +visual
+cmdline_hist +lambda +printer +visualextra
+cmdline_info +langmap +profile +viminfo
+comments +libcall -python +vreplace
+conceal +linebreak +python3 +wildignore
+cryptv +lispindent +quickfix +wildmenu
+cscope +listcmds +reltime +windows
+cursorbind +localmap +rightleft +writebackup
+cursorshape -lua +ruby -X11
+dialog_con +menu +scrollbind -xfontset
+diff +mksession +signs -xim
+digraphs +modify_fname +smartindent -xpm
-dnd +mouse +startuptime -xsmp
-ebcdic -mouseshape +statusline -xterm_clipboard
+emacs_tags +mouse_dec -sun_workshop -xterm_save
+eval -mouse_gpm +syntax
+ex_extra -mouse_jsbterm +tag_binary
+extra_search +mouse_netterm +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: clang -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X -DMACOS_X_DARWIN -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib -L/usr/local/lib -o vim -lncurses -liconv -framework AppKit -mmacosx-version-min=10.13 -fstack-protector-strong -L/usr/local/lib -L/usr/local/Cellar/perl/5.26.2/lib/perl5/5.26.2/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc -L/usr/local/opt/python/Frameworks/Python.framework/Versions/3.6/lib/python3.6/config-3.6m-darwin -lpython3.6m -framework CoreFoundation -lruby.2.5.1 -lobjc
> nvim -v
NVIM v0.2.2
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/local/Homebrew/Library/Homebrew/shims/super/clang -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -I/tmp/neovim-20180209-92407-udkzoo/neovim-0.2.2/build/config -I/tmp/neovim-20180209-92407-udkzoo/neovim-0.2.2/src -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/opt/gettext/include -I/usr/include -I/tmp/neovim-20180209-92407-udkzoo/neovim-0.2.2/build/src/nvim/auto -I/tmp/neovim-20180209-92407-udkzoo/neovim-0.2.2/build/include
Compiled by brew#HighSierra.local
Features: +acl +iconv +jemalloc +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/local/Cellar/neovim/0.2.2_1/share/nvim"
Run :checkhealth for more info
Well, on a hunch, it turns out ranger.vim is the culprit.

Build vim with --remote-tab on OSX

I built vim using:
./configure --with-x --enable-pythoninterp --with-features=huge
but don't have access to vim --remote-tab. I'm using OSX version 10.11.2. I'm hoping to use Vim and not MacVim since I'm using tmux too.
Here's the output of vim --version if it's helpful:
vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Apr 5 2016 09:24:37)
MacOS X (unix) version
Included patches: 1-658
Compiled by *******
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 +viminfo
-cscope +lispindent -python3 +vreplace
+cursorbind +listcmds +quickfix +wildignore
+cursorshape +localmap +reltime +wildmenu
+dialog_con -lua +rightleft +windows
+diff +menu -ruby +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: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/usr/local/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X_UNIX -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L/usr/local/lib -o vim -lm -lncurses -liconv -framework Cocoa -framework Python

GVIM is taking time to start when invoked across different machines?

As part of my work I will have multiple terminals with logins to various machines in network. I observed that GVIM gui is taking time to start when invoked from machine different than the previous gvim invoke.
If first I invoked gvim on machine1 and next on machine2, the second gvim invoke is taking time to open gvim GUI. Now if I again invoke gvim on machine2 I am not seeing any issue and it opens fast.
I used gvim --startuptime gvim.log and found that invoking GUI is taking more time.
077.501 000.210 000.210: sourcing /cpd/misc/share/vim/vim74/plugin/vimballPlugin.vim
079.475 000.376 000.376: sourcing /cpd/misc/share/vim/vim74/plugin/zipPlugin.vim
079.541 020.108: loading plugins
079.547 000.006: inits 3
097.793 001.193 001.193: sourcing $VIMRUNTIME/menu.vim
9586.733 9505.993: starting GUI
9587.988 001.255: reading viminfo
9589.083 001.095: GUI delay
9591.074 001.991: register server name
9591.076 000.002: setting raw mode
9591.077 000.001: start termcap
9591.132 000.055: clearing screen
9591.193 000.061: opening buffers
9591.278 000.085: BufEnter autocommands
9591.283 000.005: editing files in windows
9592.790 001.507: VimEnter autocommands
9592.796 000.006: before starting main loop
9641.761 048.965: first screen update
9641.766 000.005: --- VIM STARTED ---
I am using vim 7.4
Could any one please tell me how can I fix this issue?
PS: I am not seeing this issue in emacs.
Edit: These are the option with which my gvim is compiled.
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+cryptv +cscope +cursorshape +dialog_con_gui +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

OSX Vim :set laststatus=2 shows only the filename -- but I want to see everything that Ctrl-g provides

Like the title says -- and my google fu fails me as :set laststatus=2 shows only the filename, I'd like to see everything cntrl-g provides.
example:
<relative filename> line 28 of 285 --9%-- col 5
Pretty sure I remember pulling this off with a basic :set command a decade ago, any idea what's going on? Again, all I'm seeing with :set laststatus=2 is the filename.
bar#baz:~/foo$ vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 23 2012 13:50:52)
Compiled by root#apple.com
Normal 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
-conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con +diff +digraphs
-dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path
+find_in_path +float +folding -footer +fork() -gettext -hangul_input +iconv
+insert_expand +jumplist -keymap -langmap +libcall +linebreak +lispindent
+listcmds +localmap -lua +menu +mksession +modify_fname +mouse -mouseshape
-mouse_dec -mouse_gpm -mouse_jsbterm -mouse_netterm -mouse_sysmouse
+mouse_xterm +multi_byte +multi_lang -mzscheme +netbeans_intg -osfiletype
+path_extra -perl +persistent_undo +postscript +printer -profile +python/dyn
-python3 +quickfix +reltime -rightleft +ruby/dyn +scrollbind +signs
+smartindent -sniff +startuptime +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. -D_FORTIFY_SOURCE=0 -Iproto -DHAVE_CONFIG_H -arch i386 -arch x86_64 -g -Os -pipe
Linking: gcc -arch i386 -arch x86_64 -o vim -lncurses
the option laststatus has nothing to do with "what would be displayed on my status bar". It controls, when/how to display the status-bar.
0 (never)
1 only if you have more than 2 windows, the status bar shows
2 always
if you want to control what would be shown on your status bar, you should check another option: statusline
:h statusline
will give you detailed information. you can DIY a lot.
To your question, personally I have this statusline:
https://github.com/sk1418/myConf/blob/master/common/.vimrc#L506
it shows for example:
~/.vimrc [VIM:unix:utf-8:] [ASCII:61] [row:513/715 71% col:18]
:set ruler
gives you at least some of the information you want. If you want more, read :help 'statusline'.

Resources