LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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-02-2003, 09:35 PM   #1
Shak
Member
 
Registered: May 2002
Location: Huddersfield
Distribution: Redhat (7.2, 7.3, 8.0), Debian, Slackware, Gentoo, FreeBSD
Posts: 169

Rep: Reputation: 30
vim / gvim


Hi,

After looking through the O'Reilly Learning Vi book, I am still struggling to do the following two things in gvim:
[list=1][*]Formatting the Text so that all the words are complete (i.e. not spread over two lines [ such as re \n store])[*]Create bold headings[/list=1]

If anyone could help me do these, I'd be most grateful.

Shak
 
Old 04-02-2003, 10:04 PM   #2
wapcaplet
Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
I am not sure about the first, but you aren't going to be able to create bold headings in Vim unless you're talking about HTML code or something. Vim (and GVim) are ASCII text editors, not word processors. If you're concerned about words wrapping at the end of a line, or doing any kind of formatting, you probably want to use a word processor instead (such as Kate, KWrite, OpenOffice Write, etc.) Vim is more for writing code and other strictly ASCII stuff.
 
Old 04-02-2003, 11:26 PM   #3
cuckoopint
Member
 
Registered: Feb 2003
Distribution: Debian
Posts: 797

Rep: Reputation: 30
for #1, you need to set a width, which will make vim act more like a wordprocessor (if I understood you correctly). Don't think you want this to be permanent, but a quick hack would be to add a alias to your ~/.bashrc:

alias wvim='vim -c "set textwidth=$COLUMNS"'

then simply use 'wvim' to start vim.
 
Old 04-02-2003, 11:33 PM   #4
cuckoopint
Member
 
Registered: Feb 2003
Distribution: Debian
Posts: 797

Rep: Reputation: 30
btw, you can do all this from vim itself:

:set textwidth=30 #number of columns
:set wrapmargin=10 #right margin

Note: wrapping only occurs while TYPING. It does not format previous text. use the 'gq' command to format a paragraph:

gq4j #format next 4 lines
gqgq #shortened to 'gqq' - format a line
gq} #format paragraph. cursor must be at the beginning of paragraph
gqip #formats a paragraph. no need for cursor to be at beginning of paragraph

etc.

There's so much stuff in vim, this should give you a start...
 
Old 04-03-2003, 10:25 AM   #5
Shak
Member
 
Registered: May 2002
Location: Huddersfield
Distribution: Redhat (7.2, 7.3, 8.0), Debian, Slackware, Gentoo, FreeBSD
Posts: 169

Original Poster
Rep: Reputation: 30
Thanks.

I dont want to print bold headings, just create them I can do colours I just cant work out bold! Thanks anyways wapcaplet.

Thanks cuckoopint thats exactly what Im after

Thanks,
Shak
 
  


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
does anyone know how to enable line completions in vim or gvim Joseph Schiller Linux - Software 2 10-31-2005 10:11 PM
prompt within gvim/vim/vi zchoyt Linux - Software 6 02-02-2005 07:30 AM
vim or gvim raees Linux - General 7 03-17-2004 06:02 PM
gvim where can I get it for RH 7.3 mtint Linux - Networking 3 10-22-2002 10:04 AM
gvim where can I get it for RH 7.3 mtint Linux - Software 1 08-16-2002 02:54 PM


All times are GMT -5. The time now is 04:31 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration