Paris wrote:
> On Fri, 2009-04-03 at 20:01 -0700, Ben Fritz wrote:
>> Step 1: Download the TxtFmt plugin. This will allow you to arbitrarily
>> color plaintext in Vim.
>
> I downloaded the plugin and extracted the files to ~\.vim\plugin
> ~\.vim\ftplugin ~\.vim\doc etc...
> Should I add something to my vimrc to load the plugin? I am confused...
First, I would suggest reading the "QUICK-START TUTORIAL" section on the
download page, but see further down for some ideas on the overall setup...
>
> Also I did not quite understand this. Do I have to use a special
> filetype? How are my changes saved on a simple txt file?
There are many ways to use Txtfmt. It can be as simple as...
:set ft=txtfmt
...in the buffer you want to format. In general, though, you will
probably want to set things up so that when you open a particular file
or particular type of file, Txtfmt is loaded automatically. The way to
cause Txtfmt to be loaded for a particular file is to use a "Txtfmt
modeline". To use this method, you would put lines similar to the
following at the top or bottom of your file:
vim: ft=txtfmt
txtfmt: rng=0xE000S
The first line is a Vim modeline (:help modeline), which sets
vim-specific options and ensures that when the file is loaded,
'filetype' is set to "txtfmt". The second line is a "Txtfmt modeline"
(:help txtfmt-modeline), which sets Txtfmt-specific options. For details...
:help txtfmt-options
:help txtfmt-opt-list
:help txtfmt-Tokrange
Alternatively, you can use filetype autocommands to ensure that Txtfmt
is loaded whenever a file with a particular extension is opened. To use
this method, you could put something like the following in your
filetype.vim (e.g., in ~/.vim/filetype.vim):
au BufRead,BufNewFile *.txt setfiletype txtfmt
(Of course, you can associate Txtfmt with whatever extensions you like.)
You can even use Txtfmt in conjunction with other filetypes. I use
Txtfmt to supplement the regions defined by my electronic journal
filetype (jnl). I set it up like this:
*** in filetype.vim ***
" Use special dot-syntax to have both jnl and txtfmt filetypes load in
" sequence
au BufRead,BufNewFile *.jnl setfiletype jnl.txtfmt
*** at top of the journal file itself ***
vim:noet:tw=78:sw=4:ts=4:nojoinspaces
txtfmt:tokrange=0xE000s
Let me know if any of the above is unclear or you have any issues or
questions..
Thanks,
Brett Stahlman
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---