I'm analyzing a lot of logs using VIM version 7.3 (2010 Aug 15, compiled Sep 24 2013 13:45:11).
Recently I obtained logs that look like this:

     3521:2015-09-28T09:18:36.922557+00:00 192 [info]  »   ERR:  00 LINUX-0-<2015-09-28T09:18:36.922555Z> 22E ERR/APP/Error, (pid:558) name : SomeApplication#015¶

but after inserting any word at the end of a line it changes to 3 lines like so:

3521:2015-09-28T09:18:36.922557+00:00 192 [info]  »   ERR:  00¶
LINUX-0-<2015-09-28T09:18:36.922555Z> 22E ERR/APP/Error, (pid:558) name :¶
SomeApplication#015 %%%¶

My .vimrc:

set cindent¶
set nowrap¶
set hidden¶
set number¶
set ignorecase¶
set tabstop=6 shiftwidth=4 softtabstop=4 expandtab¶
set listchars=tab:»\ ,eol:¶,trail:·,   " show invisible characters as in eclipse IDE¶
nmap <CR> o<Esc>¶
nnoremap <silent> <Space> :silent noh<Bar>echo<CR>¶

" user defined commands¶
command DBGPrint ! cat % <Bar> grep \%\%\% <Bar> less¶
command! -nargs=1 Filter %y z <Bar> tabnew <Bar> 0put=@z <Bar> %!grep -in "<args>"¶
command! -nargs=1 FilterSens %y z <Bar> tabnew <Bar> 0put=@z <Bar> %!grep -n "<args>"¶

I added

set textwidth=0
set wrapmargin=0

at the end of my .vimrc file but when opening log file I have it set to textwidth=78.
When I execute set textwidth=0 in open file - it works.

1 Answer 1


Try set textwidth=0 to not break up long lines. See :h tw. Note that if you set the textwidth to 0, then wrapmargin might take effect, see :h wm, so consider also using set wrapmargin=0.

  • Or actually it resolved my issue when typing "set textwidth=0" into vim. When I typed it into my .vimrc - the issue still happens. Any idea why?
    – lewiatan
    Oct 8, 2015 at 10:30
  • I use Majutsushi TagBar, and NERDTree plugins.
    – lewiatan
    Oct 8, 2015 at 10:31
  • Try putting it at the bottom of your .vimrc
    – edi9999
    Oct 8, 2015 at 12:31
  • To check the value at run time, just type set tw, so you can check if it's actually 0 or not. Oct 8, 2015 at 13:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.