Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 103642 - vim auto-indenting problem for txt files
Summary: vim auto-indenting problem for txt files
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High minor
Assignee: Vim Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-24 17:31 UTC by Robert
Modified: 2005-08-25 03:03 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert 2005-08-24 17:31:31 UTC
When composing a txt file it is customary to put a tab or other such spacing to
indent a paragrah. This causes unexpected behavior (ie a bug) with the default
/etc/vim/vimrc file. On a default install, txt files (*.txt) will be auto
wrapped at 78 characters. Vim also has auto-indenting turned on by default. When
you indent your paragraph and type over 78 characters, vim auto wraps the line,
then auto-indents the line with your paragraph instead of leaving the text
aligned with the left of the 'page'. This is usually undesired. You end up with
something like:

    Blah blah ..(more blahs to get over 78 chars)
    blah blah blah....
    blah blah blah....

Instead of:

    Blay blah....
blah blah blah....
blah blah blah....

Reproducible: Always
Steps to Reproduce:
1. open a file ending in .txt
2. indent your paragraph
3. write a paragraph over 78 characters long

Actual Results:  
Malformed indention

Expected Results:  
Proper indention

To fix, one could disable auto-wrapping for txt files altogether in the default
install or unset ai (auto-indent) within the test for *.txt files:

"  autocmd BufNewFile,BufRead *.txt
"        \ if &tw == 0 && ! exists("g:leave_my_textwidth_alone") |
"        \     setlocal textwidth=78 |
"        \ endif
Comment 1 Ciaran McCreesh 2005-08-25 03:03:45 UTC
How does vim tell the difference between paragraphs with a weird first line
indent and paragraphs that are wholly indented? The latter are much more common.