]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - vimrc
vimrc: Disable 'list' and 'number' in help buffers.
[config/dotfiles.git] / vimrc
diff --git a/vimrc b/vimrc
index 35d84d5edc52a3005b9beb45471ed05fcb0a011f..040dad1286c37be94e92062ea81ef471b6e034da 100644 (file)
--- a/vimrc
+++ b/vimrc
@@ -249,6 +249,17 @@ if has('autocmd')
 " But not for Git commits, go to beginning of the file.
         autocmd BufReadPost COMMIT_EDITMSG normal! gg
 
+" Make sure 'list' and 'number' is disabled in help files. This is necessary
+" when switching to a help buffer which is in the background with :buffer as
+" these options are local to windows (and not only to buffers). This happens
+" because I often want to use only one window and thus the help buffer is in
+" the background.
+        autocmd BufWinEnter *.txt
+            \ if &filetype == 'help' |
+            \     setlocal nolist |
+            \     setlocal nonumber |
+            \ endif
+
 " AFTER/FTPLUGIN AUTO COMMANDS
 
 " Disable spell checking for files which don't need it.