On 2011-04-10, Tomasz Moskal wrote: > Hey, > > I seems to have a small issue with text width when filetype plugin is > loaded. Let me explain: > I'm reading now 'Zsh Guide' and use vim for taking notes and everything > is working as it should when I stick to notes in plain English. As soon > as I include any example of code vim is loading zsh/sh plugins. I would > not mind this if it wouldn't be for text width; I got 'set textwidth=78' > in vimrc but as soon as those plugins are loaded this value is not > respected any more. I would like to keep filetype plugins in my vimrc as > indentation/syntax features they provide are more than useful but how to > force them to obey 'set textwidth'? > I'm using vim 7.3 and my (unimpressive) vimrc look like so: > > set nocompatible > set nomodeline > set textwidth=78 > set autoindent > set tabstop=8 > set shiftwidth=8 > set ruler > autocmd BufRead /usr/home/moloch/.mutt/temp/mutt* :source > ~/.vim/mail.vim > map <F9> :w!<CR>:!aspell --lang=en_GB -c --dont-backup %<CR>:e! %<CR> > filetype on > filetype plugin on > filetype indent on > colo desert > syntax on > set ofu=syntaxcomplete#Complete > > I'm still very much reading through 'Vim Manual' so any help on above > matter is appreciated.
The solution will depend on how and where 'textwidth' is being set. I don't see where 'tw' or 'textwidth' is being set in either the sh.vim or zsh.vim ftplugins. It's also odd that you say that 'textwidth' is changed "as soon as I include any example of code." Vim normally triggers filetype detection when files are read into a new buffer, not when they are read or copied into an existing buffer. You can find out where 'textwidth' is being set by executing :verbose set tw? Let us know the answer and we can proceed from there. Regards, Gary -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php