Nota: editado para proporcionar más información.
He modificado mi ~/.vimrc
significativamente (aunque algunas de mis modificaciones iniciales las hice en todo el sistema /etc/vim/vimrc
). Probablemente no importe de ninguna manera, ya que en realidad soy el único usuario de mi computadora portátil y, ciertamente, el único que edita en Vim.
De todos modos, con el paquete Vim-LaTeX, los archivos se abren con pliegues insertados automáticamente en secciones y subsecciones de .tex
los documentos. Esto está bien (y es útil de vez en cuando) siempre y cuando todos los pliegues estén abiertos cuando empiezo. Las siguientes dos líneas parecen lograr lo que quiero.cuando .vimrc
se obtiene!
set foldmethod=syntax
autocmd Syntax tex normal zR
Mi frustrante solución ha sido buscar manualmente .vimrc
cuando abro un documento para comenzar a editarlo (o al menos invocarlo zR
manualmente para abrir todos los pliegues).
Mi pregunta en cascada es:
¿Existe una variable ambiental que pueda configurar (en mi .bash_profile
, por ejemplo) que le indique a Vim que busque .vimrc
en mi directorio de inicio? ¿No debería ser este el valor predeterminado? ¿Cómo puedo solucionar esto?
EDITAR: No he podido resolver esto. He incluido la salida detallada de vim -V
. Parece que mi ~/.vimrc
fuente está siendo obtenida, pero ¿tal vez otras cosas lo están "sobrescribiendo" en la memoria?
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"
Respuesta1
Para Unix/Linux, vim busca $HOME/.vimrc
, por lo que lo primero que podría afectar esto es, por supuesto, la variable de entorno $HOME
. ¿Está esto configurado en su sistema (debería ser /home/your_user_name
.
No he visto ningún lugar que especifique dónde debería estar este archivo, por lo que la única otra forma que puedo ver sería si comienzas con la -u
opción de especificar un .vimrc diferente:
-u <vimrc> Use <vimrc> instead of any .vimrc
-U <gvimrc> Use <gvimrc> instead of any .gvimrc
Supongo que podrías intentar utilizar esto como solución alternativa, pero probablemente sería mejor solucionar el problema, si es posible. Nunca he tenido un caso en el que no leyera .vimrc
.