LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to avoid new line character (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-avoid-new-line-character-150844/)

dford 02-27-2004 09:54 AM

You might want to try
:set paste
This disables a bunch of the smart stuff that vi can do for you and in this case you want it to be "dumb".

How are you entering the code? Straight typing? Copy and Paste?

Are you in an Xterm, Kterm, command line (non-X environment), gvim,...?

Could you paste a short example into a message for us? Try to make the shortest XML that displays the problem.

:confused:

gschrade 02-27-2004 09:57 AM

I tried putting the line in ~/.vinrc and when I go to the file and check the sets, it does not set it to the number. I will try looking at the sites. Thanks

gschrade 02-27-2004 10:13 AM

I tried :set paste. That did not work either. I am just straight typing in command line mode.

The line I am trying to type is something like <value>jdbc:mysql://somemachine.someverylongdomainnameforaserver/somedatabase?user=someuser&password=somepassword</value>

druuna 02-27-2004 10:17 AM

Just though of something: I there a line in your xml code (at the top or bottom) that looks like:

/* vim:tw=4: */

The 4 can be another number.
If this line excists, vi will overrule all the other settings and use this (4 in the above example) as default for this document.

gschrade 02-27-2004 10:22 AM

just checked, nothing like that in the file. How can I tell if I have vim instead of vi? If it type vim at the command line, it does not recogize the command.

druuna 02-27-2004 10:32 AM

On my system (suse & slack):

/bin/vi -> vim (link to vim)
/bin/vim

dford 02-27-2004 10:38 AM

Most of the things we have been talking about only work in vim. Typically, on Linux, you have vim. When you type ":help" I think it tells you what program it is. Actually, just the fact that ":help" works indicates it is vim or a vim variant; native vi doesn't have alot of these extensions.

Unfortunately, here at work I only have access to vi. When I get home tonight I'll do some more looking.
Does arbitrary text line break?
Is it breaking on white space or always at the same point? What point does it break at?

gschrade 02-27-2004 10:45 AM

It breaks at the end of the screen. If tw was set to 255, would it still wrap or scroll to the right?

dford 02-27-2004 10:52 AM

wrap causes the display to wrap at the end of the screen.
wrapmargin and textwidth cause the data to wrap at the point specified. Although both of these break on whitespace by default.

If tw=255 and wrap is on the screen will show something like 3 full 80 characters display lines and a short 15 character line (given lucky white space). If nowrap is set the display will scroll right. Of course the above assumes the standard 80 character line, but since you said you were in the native command line that is a somewhat reasonable assumption.

dford 02-27-2004 11:14 AM

Okay, another thought.
:set compatible
make vim compatible with vi. This should override any vim special features leaving you with a smaller set of settings to worry about.


All times are GMT -5. The time now is 10:15 AM.