LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-19-2006, 12:19 AM   #1
hedpe
Member
 
Registered: Jan 2005
Location: Boston, MA
Distribution: Debian
Posts: 380

Rep: Reputation: 30
is it possible to do this in VIM with line wrap on?


Hi,

I was wondering if it is possible, in VIM, if line wrap is on, that when you move the cursor it treats it as multiple lines.

What I mean is, say line wrap is on and I have the following typed in as a single line:
Code:
I hear Gentoo is a really cool distribution
and that many people should use it because
they would be really happy.
Lets say that my cursor is at the very end of the sentence. If I hit the up arrow, my cursor would go above "I hear Gentoo..."

What I would like it to do is to go between the u and the l of "should"

Is this possible with some key combination?

Thanks!
George
 
Old 04-19-2006, 12:52 AM   #2
rhoekstra
Member
 
Registered: Aug 2004
Location: The Netherlands
Distribution: RedHat 2, 3, 4, 5, Fedora, SuSE, Gentoo
Posts: 372

Rep: Reputation: 42
Not to my knowledge.

What you COULD do is turn 'textwidth' on a certain column number, like '80'.
Code:
:set textwidth=80
This will introduce line breaks at the column you specify, causing one line be seperated in multiple lines, which will be convenient to type a whole story, not to worry about the text width (it wraps whole words).

If it is important that the line not be broken into multiple lines, you won't be able to achieve what you describe, I'm afraid.. if so, I'd be curious how...

Hope this helps in 'any' way..
 
Old 04-19-2006, 01:24 AM   #3
hedpe
Member
 
Registered: Jan 2005
Location: Boston, MA
Distribution: Debian
Posts: 380

Original Poster
Rep: Reputation: 30
well it turns out some people in #vim on freenode have been helping me, you can actually use gj and gk to do what i want, however you cannot be in insert mode.

Therefore they're trying to help me bind something like ctrl+up or ctrl+down to gj and gk to do what i want

hope this helps you too
 
Old 04-19-2006, 08:59 AM   #4
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
Try starting it up with vim +':set textwidth=80' +':set wrap' then you can do exactly that. Also you don't need to remap keys.
 
Old 04-19-2006, 12:09 PM   #5
hedpe
Member
 
Registered: Jan 2005
Location: Boston, MA
Distribution: Debian
Posts: 380

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by dive
Try starting it up with vim +':set textwidth=80' +':set wrap' then you can do exactly that. Also you don't need to remap keys.
that didn't work for me :\ it still skips lines
 
Old 04-19-2006, 06:19 PM   #6
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
Hmm. Maybe something in .vimrc is stopping it? I use that command in Mutt to edit emails and it works a charm.

Just tried it without a .vimrc and it still works. Maybe vim version?

vim --version
VIM - Vi IMproved 6.4 (2005 Oct 15, compiled Apr 16 2006 21:02:13)

Last edited by dive; 04-19-2006 at 06:29 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
multi-line command doesn't wrap correctly spiffytech Linux - Software 2 12-28-2008 06:18 PM
xterms wrap over the same line when typing! humbletech99 Linux - Software 6 12-30-2005 05:58 PM
vim text wrap problem darknails Linux - Software 1 12-06-2005 06:54 AM
VI wrap line Ephracis Linux - Newbie 4 11-17-2005 05:46 PM
Line wrap with ximian evolution nouse66 Linux - Software 3 06-18-2004 08:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration