LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   vim / gvim (https://www.linuxquestions.org/questions/linux-software-2/vim-gvim-53138/)

Shak 04-02-2003 08:35 PM

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

wapcaplet 04-02-2003 09:04 PM

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.

cuckoopint 04-02-2003 10:26 PM

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.

cuckoopint 04-02-2003 10:33 PM

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...

Shak 04-03-2003 09:25 AM

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


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