scott wrote:
ok, so help me out here

i've looked at filetype vim, and i see nothing that associates
_.txt modules with ft=txt

whether i enter my 'ai' modules with the script or by navigating
to where they are and, with my bloody fingers typing 'gvim
ai_200609.txt', still, inside the module, filetype is undefined

are we only supposed to use vim for exotic languages?
is 'text' deprecated?

i thought it used to suffice to have an extension of .txt

now the ground is shifting under my feet...

sc



As far as I rember checking, *.txt was associated with nothing so it was edited as, basically, free text with just a single B&W set of fg/bg colors, no auto-linebreak etc.

There is an autocommand in the vimrc_example.vim which sets 'textwidth' to 78 (causing auto-linebreak at column 78) for any files with "text" filetypes.

If you want to detect *.txt, you can:

----8<---- ~/.vimrc
" ...
runtime vimrc_example.vim
au! vimrcEx FileType
" ...etc.
---->8----

----8<---- ~/.vim/filetype.vim
augroup filetypedetect
    " ... etc ...
    au BufRead,BufNewFile *.txt setf text
    " ... etc ...
augroup END
---->8----

then write your own scripts:
~/.vim/ftplugin/text.vim (for local options using ":setlocal" and/or mappings/abbreviations using ":map <buffer>", ":abbr <buffer>" etc.), ~/.vim/syntax/text.vim (for syntax colouring if any: ":syntax" and ":hi default" commands) ~/.vim/indent/text.vim (for special indenting if any: probably ":setlocal indentexpr" to a function defined there).

(on Windows, replace /.vim/ by /vimfiles/ and .vimrc by _vimrc)


Best regards,
Tony.

Reply via email to