- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- No line wrap in vi
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2009 10:56 AM
12-10-2009 10:56 AM
I need to work with a file that has very long lines. I dont need the whole record, just the first 30 to 80 characters of those lines. Vi wraps the lines but I need to see them line below line without the line wraps between them. It’s a basic vi (no vim mode), so :set nowrap doesn’t work. :set all shows wrapmargin=0 but if I do wrapmargin=7 nothing happens.
What can be done?
Thanks for the answers.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2009 07:44 PM
12-10-2009 07:44 PM
Re: No line wrap in vi
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2009 01:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2009 04:25 AM
12-11-2009 04:25 AM
Re: No line wrap in vi
If you really only need those characters:
# cut -c30-80 /path/to/file
Unix operates with beer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2009 04:48 AM
12-11-2009 04:48 AM
Re: No line wrap in vi
:set wm=0 doesnt help. Do I need to put it in a restart hidden file so it takes effect before vi starts (which file then)?
I want to be able to scroll the lines to the right if I need to, so cut is not good. I want to see the lines in normal size so making long column will not be convenient to work with long column. Here is my :set all
:set all
autoindent mesg noslowopen
autoprint nomodelines tabstop=8
autowrite nonumber taglength=0
nobeautify nonovice tags=tags /usr/lib/tags
directory=/var/tmp nooptimize tagstack
nodoubleescape paragraphs=IPLPPPQPP LIpplpipnpbp term=hp
noedcompatible prompt noterse
noerrorbells readonly timeout
noexrc redraw timeoutlen=500
flash remap ttytype=hp
hardtabs=8 report=1 warn
noignorecase scroll=11 window=23
keyboardedit sections=NHSHH HUuhsh+c wrapscan
nokeyboardedit! shell=/usr/bin/sh wrapmargin=0
nolisp shiftwidth=8 nowriteany
nolist showmatch
magic noshowmode
[Hit return to continue]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2009 05:16 AM
12-11-2009 05:16 AM
Re: No line wrap in vi
:set nowrap
Unix operates with beer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2009 06:56 AM
12-11-2009 06:56 AM
Re: No line wrap in vi
IF you just need to look at it without modifying it.
adjust myfile.out > boguscopy.out
vi boguscopy.out
or while in vi.....
vi myfile.out
:.,.!adjust
:q!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2009 01:29 PM
12-11-2009 01:29 PM
Re: No line wrap in vi
It sounds as if you want exactly one line per line on the screen and then be able to scroll everything to the right. vi is designed to work with real terminal windows, not GUIs that represent the text file. You can certainly put settings into $HOME/.exrc which will take effect as vi starts but it won't change the appearance of existing lines.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2009 01:38 AM
12-13-2009 01:38 AM
Re: No line wrap in vi
ok, that one for vim isn't an option for you, I just noticed it right after I posted. But another idea, if read-only mode is enough:
# less -S FILENAME
this way the long lines will be chopped, and you an navigate with arrow keys. I think that's what you want. If you want editing also, press h and see the last section of the help of less. I think somehow editing is also possible with less.
Unix operates with beer.