1

I have added the following two lines into my .vimrc file

" stop fortran 90 from automatically insert line break beyond 80
set textwidth=0 wrapmargin=0

" stop vim wrapping beyond 80, avoid visual breaking in vim
set nowrap

but still no success. vim keeps breaking lines in my f90 source file as before, which is very annoying. Any further suggestions?

6

'textwidth' is local to the buffer. I imagine Vim's default fortran plugin ($RUNTIME/ftplugin/fortran.vim) is setting 'textwidth'.

To override this default add the following to ~/.vim/after/ftplugin/fortran.vim:

setlocal textwidth=0

You can set other fortran setting you wish to override here as well.

You can also use :verbose to see where an option was last set. e.g. :verbose set textwidth?.

For more help see:

:h 'textwidth'
:h after-directory
:h :setlocal
:h :verbose
:h :set

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.