set wrap in .vimrc.local not working #254

Closed
mgoffin opened this Issue Dec 19, 2012 · 9 comments

8 participants

@mgoffin

I've tried everything I can think of to prevent sidescrolling and to get lines to wrap. Using 'set wrap' in .vimrc.local doesn't seem to override the default of 'set nowrap' in .vimrc. However, using ':set wrap' when editing a file works fine. I wound up binding a key to toggle the wrapping because it's getting annoying at this point.

Here's some relevant settings in my .vimrc.local:

"Set textwrap
set wrap
set tw=80
set fo+=t
set wm=0
set linebreak
noremap :set wrap!

"Show when I should be wrapping
set cc=+1
highlight ColorColumn ctermbg=lightgrey guibg=lightgrey

@johntyree
Collaborator

.vimrc.local is called at the end of .vimrc, so it should work if it's in there.

I have a few filetypes that I have special wrapping rules for as well. I handle it like this.

" For text we have different formatting rules
"spell check when writing commit logs and latex reports, etc...
autocmd filetype mail,tex,svn,*commit* setlocal spell
" Wrap text smartly (can't show whitespace anymore unfortunately)
autocmd filetype qf,remind      setlocal nocursorline
autocmd filetype qf,remind,mail setlocal wrap
autocmd filetype qf,remind,mail setlocal nolist
autocmd filetype qf,remind      setlocal textwidth=0 "prevent autowrap
@mgoffin

Yea I have other stuff in my .vimrc.local that also work like keybindings and such, but the default wrapping fails to work.

@johntyree
Collaborator

You could try using an autocmd to set your default wrap options after all the rest of the setup as been done perhaps?

@jrobeson
Collaborator

it's been awhile. I wonder if changes since then have solved this issue.

@jrobeson jrobeson added the needinfo label Jul 11, 2014
@JoeSchr

the above posted line seems to work for me just fine.
but I couldn't get it to work we just
set wrap

@milandomeny

I think there is no problem with your settings. You only need to set in ~/.vimrc.local this -> set wrap. But what you need to do then is this: delete all content from ~/.vimviews, because there are stored all setting on files you previously opened. This works for me and I hope it will work for you ;) happy viming :D

@foges

Thanks, I had the same problem and rm ~/.vimviews/* worked for me.

@sgnl

Thanks I had the same problem on a fresh install of OSX 10.10.3 and spf13.

@foges comment above helped me resolve this issue, thank you.

@jrobeson jrobeson closed this Jun 3, 2015
@mocheng

Same issue happens to me. But it turns OK after I ran rm -rf ~/.vimviews and start vim again.
Hope it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment