Hello,

I have `set spell` in my `.vimrc`. This unfortunately clashes with  
highlighting for `netrw-browse`. Therefore, I'd like to deactivate the  
setting locally for that file type (`netrw`).

Manually deactivating via `:setlocal nospell` works fine. However, it  
does not work as an autocommand. The following minimal `.vimrc` file  
reproduces the behaviour with VIM 7.0 (latest patch 237, if that's  
relevant), default settings of the version included in the CentOS  
distribution.

Steps to reproduce. (Steps 1 and 2 are sufficient to reproduce the  
unexpected behaviour. Steps 3 and 4 only act as a cross-check to  
exclude other factors.)

* Step 1: Set the following as `.vimrc` or load via `:source`:

     colors desert
     set spell
     autocmd FileType netrw colors desert    " Works
     autocmd FileType netrw setlocal nospell " Ignored
     " For reference:
     autocmd FileType html setlocal nospell  " Works

* Step 2: Load a directory listing into vim, e.g. `:e .`.

(
*Step 3: Load an arbitrary text file with invalid spelling into vim, e.g.:

     :e new.txt
     i
     Text with speling errors

* Step 4: Set file type to HTML: `:set ft=html`
)

Expected result:

- Colour scheme is switched to `default`.
- Spelling is switched off.
- After step 3: vim highlights word "speling".
- After step 4: spelling is switched off (highlighting vanishes).

Actual result (differences in all caps):

- Colour scheme is switched to `default`.
- Spelling STAYS SWITCHED ON
- After step 3: vim highlights word "speling".
- After step 4: spelling is switched off (highlighting vanishes).

For me, this indicates that both `:autocmd` and `:set nospell` work  
properly. Only the combination

- FileType `netrw`,
- use of `autocmd`,
- sets `nospell`

does not work. This is regardless of whether `:set` or `:setlocal` was  
used to set `nospell`!

Best regards,
Konrad Rudolph

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to