Примечание: отредактировано для предоставления дополнительной информации.
Я значительно изменил свой ~/.vimrc
(хотя некоторые из моих первоначальных изменений я сделал в системном /etc/vim/vimrc
). Это, вероятно, не имеет значения, так как я на самом деле единственный пользователь на моем ноутбуке, и, безусловно, единственный, кто редактирует в Vim.
В любом случае, с пакетом Vim-LaTeX файлы открываются с автоматически вставленными сгибами в разделах и подразделах документов .tex
. Это нормально (и полезно время от времени), пока все сгибы открыты, когда я начинаю. Следующие две строки, кажется, достигают того, что я хочукогда .vimrc
получен!
set foldmethod=syntax
autocmd Syntax tex normal zR
Моим неприятным решением было вручную выбирать источник .vimrc
при открытии документа, чтобы начать редактирование (или, по крайней мере, zR
вручную открывать все сгибы).
Мой каскадный вопрос:
Есть ли переменная окружения, которую я могу задать ( .bash_profile
например, в моем ), которая скажет Vim искать .vimrc
в моем домашнем каталоге? Разве это не должно быть значением по умолчанию? Как это исправить?
РЕДАКТИРОВАТЬ: Я не смог решить эту проблему. Я включил подробный вывод vim -V
. Похоже, что мой ~/.vimrc
источник находится в источнике, но, возможно, другие вещи «перезаписывают» его в памяти?
chdir(/home/sammy)
fchdir() to previous dir
sourcing "/home/sammy/.vimrc"
Searching for "debian.vim" in "/home/sammy/.vim,/usr/share/vim/vimfiles,/usr/share/vim/vim74,/usr/share/vim/vimfiles/after,/home/sammy/.vim/after"
Searching for "/home/sammy/.vim/debian.vim"
Searching for "/usr/share/vim/vimfiles/debian.vim"
Searching for "/usr/share/vim/vim74/debian.vim"
chdir(/usr/share/vim/vim74)
fchdir() to previous dir
line 10: sourcing "/usr/share/vim/vim74/debian.vim"
finished sourcing /usr/share/vim/vim74/debian.vim
continuing in /home/sammy/.vimrc
Searching for "/usr/share/vim/vimfiles/after/debian.vim"
Searching for "/home/sammy/.vim/after/debian.vim"
chdir(/usr/share/vim/vim74/syntax)
fchdir() to previous dir
line 20: sourcing "/usr/share/vim/vim74/syntax/syntax.vim"
Searching for "syntax/synload.vim" in "/home/sammy/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim74,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,/home/sammy/.vim/after"
Searching for "/home/sammy/.vim/syntax/synload.vim"
Searching for "/var/lib/vim/addons/syntax/synload.vim"
Searching for "/usr/share/vim/vimfiles/syntax/synload.vim"
Searching for "/usr/share/vim/vim74/syntax/synload.vim"
chdir(/usr/share/vim/vim74/syntax)
fchdir() to previous dir
line 19: sourcing "/usr/share/vim/vim74/syntax/synload.vim"
Searching for "syntax/syncolor.vim" in "/home/sammy/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim74,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,/home/sammy/.vim/after"
Searching for "/home/sammy/.vim/syntax/syncolor.vim"
Searching for "/var/lib/vim/addons/syntax/syncolor.vim"
Searching for "/usr/share/vim/vimfiles/syntax/syncolor.vim"
Searching for "/usr/share/vim/vim74/syntax/syncolor.vim"
chdir(/usr/share/vim/vim74/syntax)
fchdir() to previous dir
line 21: sourcing "/usr/share/vim/vim74/syntax/syncolor.vim"
finished sourcing /usr/share/vim/vim74/syntax/syncolor.vim
continuing in /usr/share/vim/vim74/syntax/synload.vim
Searching for "/usr/share/vim/vimfiles/after/syntax/syncolor.vim"
Searching for "/var/lib/vim/addons/after/syntax/syncolor.vim"
Searching for "/home/sammy/.vim/after/syntax/syncolor.vim"
finished sourcing /usr/share/vim/vim74/syntax/synload.vim
continuing in /usr/share/vim/vim74/syntax/syntax.vim
Searching for "filetype.vim" in "/home/sammy/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim74,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,/home/sammy/.vim/after"
Searching for "/home/sammy/.vim/filetype.vim"
Searching for "/var/lib/vim/addons/filetype.vim"
Searching for "/usr/share/vim/vimfiles/filetype.vim"
Searching for "/usr/share/vim/vim74/filetype.vim"
chdir(/usr/share/vim/vim74)
fchdir() to previous dir
line 25: sourcing "/usr/share/vim/vim74/filetype.vim"
Searching for "ftdetect/*.vim" in "/home/sammy/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim74,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,/home/sammy/.vim/after"
Searching for "/home/sammy/.vim/ftdetect/*.vim"
Searching for "/var/lib/vim/addons/ftdetect/*.vim"
Searching for "/usr/share/vim/vimfiles/ftdetect/*.vim"
Searching for "/usr/share/vim/vim74/ftdetect/*.vim"
Searching for "/usr/share/vim/vimfiles/after/ftdetect/*.vim"
Searching for "/var/lib/vim/addons/after/ftdetect/*.vim"
Searching for "/home/sammy/.vim/after/ftdetect/*.vim"
not found in 'runtimepath': "ftdetect/*.vim"
finished sourcing /usr/share/vim/vim74/filetype.vim
continuing in /usr/share/vim/vim74/syntax/syntax.vim
Searching for "/usr/share/vim/vimfiles/after/filetype.vim"
Searching for "/var/lib/vim/addons/after/filetype.vim"
Searching for "/home/sammy/.vim/after/filetype.vim"
finished sourcing /usr/share/vim/vim74/syntax/syntax.vim
continuing in /home/sammy/.vimrc
Searching for "syntax/syncolor.vim" in "/home/sammy/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim74,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,/home/sammy/.vim/after"
Searching for "/home/sammy/.vim/syntax/syncolor.vim"
Searching for "/var/lib/vim/addons/syntax/syncolor.vim"
Searching for "/usr/share/vim/vimfiles/syntax/syncolor.vim"
Searching for "/usr/share/vim/vim74/syntax/syncolor.vim"
chdir(/usr/share/vim/vim74/syntax)
fchdir() to previous dir
line 25: sourcing "/usr/share/vim/vim74/syntax/syncolor.vim"
finished sourcing /usr/share/vim/vim74/syntax/syncolor.vim
continuing in /home/sammy/.vimrc
Searching for "/usr/share/vim/vimfiles/after/syntax/syncolor.vim"
Searching for "/var/lib/vim/addons/after/syntax/syncolor.vim"
Searching for "/home/sammy/.vim/after/syntax/syncolor.vim"
Searching for "filetype.vim" in "/home/sammy/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim74,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,/home/sammy/.vim/after"
Searching for "/home/sammy/.vim/filetype.vim"
Searching for "/var/lib/vim/addons/filetype.vim"
Searching for "/usr/share/vim/vimfiles/filetype.vim"
Searching for "/usr/share/vim/vim74/filetype.vim"
chdir(/usr/share/vim/vim74)
fchdir() to previous dir
line 28: sourcing "/usr/share/vim/vim74/filetype.vim"
finished sourcing /usr/share/vim/vim74/filetype.vim
continuing in /home/sammy/.vimrc
Searching for "/usr/share/vim/vimfiles/after/filetype.vim"
Searching for "/var/lib/vim/addons/after/filetype.vim"
Searching for "/home/sammy/.vim/after/filetype.vim"
Searching for "ftplugin.vim" in "/home/sammy/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim74,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,/home/sammy/.vim/after"
Searching for "/home/sammy/.vim/ftplugin.vim"
Searching for "/var/lib/vim/addons/ftplugin.vim"
Searching for "/usr/share/vim/vimfiles/ftplugin.vim"
Searching for "/usr/share/vim/vim74/ftplugin.vim"
chdir(/usr/share/vim/vim74)
fchdir() to previous dir
line 28: sourcing "/usr/share/vim/vim74/ftplugin.vim"
finished sourcing /usr/share/vim/vim74/ftplugin.vim
continuing in /home/sammy/.vimrc
Searching for "/usr/share/vim/vimfiles/after/ftplugin.vim"
Searching for "/var/lib/vim/addons/after/ftplugin.vim"
Searching for "/home/sammy/.vim/after/ftplugin.vim"
Searching for "indent.vim" in "/home/sammy/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim74,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,/home/sammy/.vim/after"
Searching for "/home/sammy/.vim/indent.vim"
Searching for "/var/lib/vim/addons/indent.vim"
Searching for "/usr/share/vim/vimfiles/indent.vim"
Searching for "/usr/share/vim/vim74/indent.vim"
chdir(/usr/share/vim/vim74)
fchdir() to previous dir
line 28: sourcing "/usr/share/vim/vim74/indent.vim"
finished sourcing /usr/share/vim/vim74/indent.vim
continuing in /home/sammy/.vimrc
Searching for "/usr/share/vim/vimfiles/after/indent.vim"
Searching for "/var/lib/vim/addons/after/indent.vim"
Searching for "/home/sammy/.vim/after/indent.vim"
finished sourcing /home/sammy/.vimrc
Searching for "plugin/**/*.vim" in "/home/sammy/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim74,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,/home/sammy/.vim/after"
Searching for "/home/sammy/.vim/plugin/**/*.vim"
Searching for "/var/lib/vim/addons/plugin/**/*.vim"
chdir(/var/lib/vim/addons/plugin)
fchdir() to previous dir
sourcing "/var/lib/vim/addons/plugin/SyntaxFolds.vim"
finished sourcing /var/lib/vim/addons/plugin/SyntaxFolds.vim
chdir(/var/lib/vim/addons/plugin)
fchdir() to previous dir
sourcing "/var/lib/vim/addons/plugin/filebrowser.vim"
finished sourcing /var/lib/vim/addons/plugin/filebrowser.vim
chdir(/var/lib/vim/addons/plugin)
fchdir() to previous dir
sourcing "/var/lib/vim/addons/plugin/imaps.vim"
finished sourcing /var/lib/vim/addons/plugin/imaps.vim
chdir(/var/lib/vim/addons/plugin)
fchdir() to previous dir
sourcing "/var/lib/vim/addons/plugin/libList.vim"
finished sourcing /var/lib/vim/addons/plugin/libList.vim
chdir(/var/lib/vim/addons/plugin)
fchdir() to previous dir
sourcing "/var/lib/vim/addons/plugin/remoteOpen.vim"
finished sourcing /var/lib/vim/addons/plugin/remoteOpen.vim
Searching for "/usr/share/vim/vimfiles/plugin/**/*.vim"
Searching for "/usr/share/vim/vim74/plugin/**/*.vim"
chdir(/usr/share/vim/vim74/plugin)
fchdir() to previous dir
sourcing "/usr/share/vim/vim74/plugin/getscriptPlugin.vim"
finished sourcing /usr/share/vim/vim74/plugin/getscriptPlugin.vim
chdir(/usr/share/vim/vim74/plugin)
fchdir() to previous dir
sourcing "/usr/share/vim/vim74/plugin/gzip.vim"
finished sourcing /usr/share/vim/vim74/plugin/gzip.vim
chdir(/usr/share/vim/vim74/plugin)
fchdir() to previous dir
sourcing "/usr/share/vim/vim74/plugin/matchparen.vim"
finished sourcing /usr/share/vim/vim74/plugin/matchparen.vim
chdir(/usr/share/vim/vim74/plugin)
fchdir() to previous dir
sourcing "/usr/share/vim/vim74/plugin/netrwPlugin.vim"
finished sourcing /usr/share/vim/vim74/plugin/netrwPlugin.vim
chdir(/usr/share/vim/vim74/plugin)
fchdir() to previous dir
sourcing "/usr/share/vim/vim74/plugin/rrhelper.vim"
finished sourcing /usr/share/vim/vim74/plugin/rrhelper.vim
chdir(/usr/share/vim/vim74/plugin)
fchdir() to previous dir
sourcing "/usr/share/vim/vim74/plugin/spellfile.vim"
finished sourcing /usr/share/vim/vim74/plugin/spellfile.vim
chdir(/usr/share/vim/vim74/plugin)
fchdir() to previous dir
sourcing "/usr/share/vim/vim74/plugin/tarPlugin.vim"
finished sourcing /usr/share/vim/vim74/plugin/tarPlugin.vim
chdir(/usr/share/vim/vim74/plugin)
fchdir() to previous dir
sourcing "/usr/share/vim/vim74/plugin/tohtml.vim"
finished sourcing /usr/share/vim/vim74/plugin/tohtml.vim
chdir(/usr/share/vim/vim74/plugin)
fchdir() to previous dir
sourcing "/usr/share/vim/vim74/plugin/vimballPlugin.vim"
finished sourcing /usr/share/vim/vim74/plugin/vimballPlugin.vim
chdir(/usr/share/vim/vim74/plugin)
fchdir() to previous dir
sourcing "/usr/share/vim/vim74/plugin/zipPlugin.vim"
finished sourcing /usr/share/vim/vim74/plugin/zipPlugin.vim
Searching for "/usr/share/vim/vimfiles/after/plugin/**/*.vim"
Searching for "/var/lib/vim/addons/after/plugin/**/*.vim"
Searching for "/home/sammy/.vim/after/plugin/**/*.vim"
решение1
Для Unix/Linux vim ищет $HOME/.vimrc
, поэтому первое, что может повлиять на это, это, конечно, переменная окружения $HOME
. Установлено ли это в вашей системе (должно быть /home/your_user_name
.
Я не видел ни одного места, где бы указывалось, где должен находиться этот файл, поэтому единственный другой способ, который я вижу, — это начать с опции -u
указания другого .vimrc:
-u <vimrc> Use <vimrc> instead of any .vimrc
-U <gvimrc> Use <gvimrc> instead of any .gvimrc
Я полагаю, что вы могли бы попробовать использовать это как обходной путь, но, вероятно, было бы лучше исправить проблему, если это возможно. У меня никогда не было случая, когда он не читал .vimrc
.