Re: [bug] netrw-browse/autocmd/nospell
krudo...@mi.fu-berlin.de wrote: > 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`! > Netrw's strategy has been to 1) enew/get a netrw buffer, 2) save user options, 3) impose netrw-friendly options, 4) construct the netrw buffer, and 5) to restore user options. The netrw buffer itself is left as non-modifiable, read-only. Apparently your autocmd to set nospell takes place before step 5 (probably just after netrw sets its filetype). So the options you had at the onset of using netrw are restored. I can certainly see where having spell checking of a listing is generally unwanted. However, if I rigged netrw so as to not restore your original spell option (whether via option, doau FileType netrw, etc), then any files that you subsequently selected would also not have spellchecking enabled. I'm leaning towards putting in the doau FileType netrw line, but that in turn would mean that files that you subsequently selected for editing via netrw would not have spellchecking enabled; for iexample, f you did something like :vsplit :e someotherfile which allows one to edit a file not through netrw's auspices. Its to support the previous type of sequence that I have netrw restore user options for itself. Regards, Chip Campbell --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: [bug] netrw-browse/autocmd/nospell
Charles Campbell wrote: > krudo...@mi.fu-berlin.de wrote: > >> 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`). >> [snip] Please try netrw v135p, available from my website: http://mysite.verizon.net/astronaut/vim/index.html#NETRW. Caveat: you'll need to upgrade to vim 7.2 . You can try au FileType netrw setlocal nospell Regards, Chip Campbell --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: [bug] netrw-browse/autocmd/nospell
On Friday 09 January 2009 10:48 am, Charles Campbell wrote: > Please try netrw v135p, available from my website: > http://mysite.verizon.net/astronaut/vim/index.html#NETRW. forgive me for picking nits, but you may not realize that your site still announces this as v135o sc --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: [bug] netrw-browse/autocmd/nospell
* Charles Campbell [090109 11:48]: > > Charles Campbell wrote: > > krudo...@mi.fu-berlin.de wrote: > >> 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`). > > Please try netrw v135p, available from my website: > http://mysite.verizon.net/astronaut/vim/index.html#NETRW. > Caveat: you'll need to upgrade to vim 7.2 . You can try > > au FileType netrw setlocal nospell > > Regards, > Chip Campbell Sorry to jump in so late, and after you have a solution, but wouldn't putting @NoSpell in the proper places in syntax/netrw.vim be a better solution? How often do you really want spell checking on a directory listing? We're talking about existing files; if you want spell checking on a file name, you want it when you are typing :w filename, not when you are browsing to open a file. Oh, well. ...Marvin --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: [bug] netrw-browse/autocmd/nospell
Marvin Renich wrote: > * Charles Campbell [090109 11:48]: > >> Charles Campbell wrote: >> >>> krudo...@mi.fu-berlin.de wrote: >>> 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`). >> Please try netrw v135p, available from my website: >> http://mysite.verizon.net/astronaut/vim/index.html#NETRW. >> Caveat: you'll need to upgrade to vim 7.2 . You can try >> >> au FileType netrw setlocal nospell >> >> Regards, >> Chip Campbell >> > > Sorry to jump in so late, and after you have a solution, but wouldn't > putting @NoSpell in the proper places in syntax/netrw.vim be a better > solution? How often do you really want spell checking on a directory > listing? We're talking about existing files; if you want spell checking > on a file name, you want it when you are typing :w filename, not when > you are browsing to open a file. > Good point for the spell option; however, the au FileType netrw ... allows one to generally override netrw's "safe" options, which obviously @NoSpells don't provide. (netrw v135q now available) Regards, Chip Campbell --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: [bug] netrw-browse/autocmd/nospell
* Charles Campbell [090113 11:42]: > > Marvin Renich wrote: > > Sorry to jump in so late, and after you have a solution, but wouldn't > > putting @NoSpell in the proper places in syntax/netrw.vim be a better > > solution? How often do you really want spell checking on a directory > > listing? We're talking about existing files; if you want spell checking > > on a file name, you want it when you are typing :w filename, not when > > you are browsing to open a file. > > > Good point for the spell option; however, the au FileType netrw ... > allows one to generally > override netrw's "safe" options, which obviously @NoSpells don't > provide. (netrw v135q now available) > > Regards, > Chip Campbell Thanks! However, I think it needs some fine-tuning. The latest (I tried v135r and v135) removes most, but not all, spell highlighting. I have attached the result of :w vim.netrw after :e .vim (to get the text of the netrw window). Make sure you don't have au FileType netrw ...; then, :e vim.netrw and :set ft=netrw (this should give the same syntax highlighting that netrw gives for :e .vim on my .vim directory). For me, "SearchInRuntime", "cyclecolor", "filetype", "lh", and "xml" at the beginning of the lines they are on all have SpellBad highlighting. I also note that the first character of each of those lines has synID of 0 (none?) while the second character has syntax group-name netrwPlain. ...Marvin --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~--- " " Netrw Directory Listing(netrw v135) " /home/mrvn/.vim " Sorted by name " Sort sequence: [\/]$,\,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$,\.swp$,\.bak$,\~$ " Quick Help: :help -:go up dir D:delete R:rename s:sort-by x:exec " ../ after/ autoload/ colors/ doc/ ftplugin/ keymap/ plugin/ sessions/ spell/ syntax/ .VimballRecord .netrwhist SearchInRuntime-changelog.rss SearchInRuntime-changelog.xml SearchInRuntime.xml cyclecolor-blacklist filetype.vim lh-map-tools-changelog.rss lh-map-tools-changelog.xml lh-map-tools.xml mu-template-changelog.rss mu-template-changelog.xml mu-template.filelist mu-template.xml tags xml-plugin.txt
Re: [bug] netrw-browse/autocmd/nospell
Hello *, thanks for all the feedback, this was actually rather helpful. Thanks especially to Charles for the explanation of why this happens. Since I don't have admin rights on the machine(s) in question and thus can't uninstall any old netrw versions, I've settled on the `...@nospell` option -- or rather, lazy as I am, on putting one `...@spell` in a place where it doesn't matter so as to disable spelling for the rest of the file. Best regards, Konrad Rudolph -- Konrad Ludwig Moritz Rudolph E-Mail: konrad.ludwig.moritz.rudo...@mi.fu-berlin.de WWW: http://page.mi.fu-berlin.de/krudolph PGP key: http://madrat.net/my/key --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: [bug] netrw-browse/autocmd/nospell
On 14/01/09 22:17, Konrad Ludwig Moritz Rudolph wrote: > Hello *, > > thanks for all the feedback, this was actually rather helpful. Thanks > especially to Charles for the explanation of why this happens. Since > I don't have admin rights on the machine(s) in question and thus > can't uninstall any old netrw versions, I've settled on the > `...@nospell` option -- or rather, lazy as I am, on putting one `...@spell` > in a place where it doesn't matter so as to disable spelling for the > rest of the file. > > Best regards, > > Konrad Rudolph > > -- > Konrad Ludwig Moritz Rudolph > E-Mail: konrad.ludwig.moritz.rudo...@mi.fu-berlin.de > WWW: http://page.mi.fu-berlin.de/krudolph > PGP key: http://madrat.net/my/key If you place a netrw version in the appropriate subfolders of ~/.vim (for Unix) or ~/vimfiles (for Windows), it will override any version installed by your sysadmin in $VIMRUNTIME, even if you don't uninstall it. Since these directories are under your home directory, you should have write and file-creation permissions to them. Best regards, Tony. -- Q: What's a light-year? A: One-third less calories than a regular year. --~--~-~--~~~---~--~~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---