Skip to contentSkip to conversation

a little help about vi or vim

DISCUSSION r4mz3z 4 participants 5 messages Nov 15, 2002 – Dec 3, 2002 1 message not in the archive

lore
Share & tools
lore

r4mz3z

author
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi friends...
How do I configure my vim-editor to write just 45 characteres (or other
measure) for each line? and How do I justify the text?, because I've see a lot of txt files that are justify...

thanks.

- --
Linux User Registered #232544
my GnuPG-key at www.keyserver.net

    --- rm -rf /bin/laden ---

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE91EkRs4dF9gl05swRAuJWAJ9ybms2rKsIgUHfrkO/D6MZ83bATACfXLBr YK+gcO4pvaZYgxWLLC5aklM=
=WcDN
-----END PGP SIGNATURE-----

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

#1 lore raw
Quoted 6 lines · On Thu, Nov 14, 2002 at 08:08:27PM -0500, r4mz3z wrote:

Hi friends...
How do I configure my vim-editor to write just 45 characteres (or other
measure) for each line? and How do I justify the text?, because I've see a lot of txt files that are justify...

thanks.

To write just 45 chars for each line add the following line to your ~/.vimrc:

set textwidth=45

--
Paulo Jorge Jesus Silva
perl -we "print 'paulojjs' . (reverse 'tp.letagarb@') . \"\n\""

#2 lore raw
In reply to r4mz3z

Alternately to putting the command in your startup file, you may want to set the "textwidth" option manually for a file. Depends on how often you work with 45-column text files. If you're editing an existing file and you set that option, VIM won't automatically rearrange the characters so that there are only 45 per line. You'll probably want to write a script that will do that for you.

To justify text, you need to know a little VIM scripting (namely, how to use functions). There's a VIM script file called "justify.vim" (or something similar) in the "macros" folder somewhere in the VIM installation. If you run
that script, it'll set up the "Justify()" function and some useful user-defined commands like ":Justify" and "_j" that you can use. I've used this function, and I think it only works if you have the "lbr" option switched off (I'm talking about VIM 6.0 or above).

Yawar

----- Original Message -----
From: "r4mz3z" <[email protected]>
To: <[email protected]>
Sent: Friday, 15 November, 2002 07:08
Subject: a little help about vi or vim

Quoted 22 lines

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi friends...
How do I configure my vim-editor to write just 45 characteres (or other
measure) for each line? and How do I justify the text?, because I've see a lot of txt files that are justify...

thanks.

- --
Linux User Registered #232544
my GnuPG-key at www.keyserver.net

    --- rm -rf /bin/laden ---

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE91EkRs4dF9gl05swRAuJWAJ9ybms2rKsIgUHfrkO/D6MZ83bATACfXLBr YK+gcO4pvaZYgxWLLC5aklM=
=WcDN
-----END PGP SIGNATURE-----

Quoted 6 lines

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

Okay, now that you've located the file "justify.vim," the rest should be easy. Just open the file you want to justify, run the script by entering ":so /usr/share/vim/vim61/macros/justify.vim" in VIM, and then you have several choices for running the actual justify command. To justify a single line, the command you should use is ":[line]Justify" where [line] is the line number of the line you want to justify. To justify the line you're on currently, just leave out [line]. To justify the entire file, press "_j." There are other options as well, which are well documented within the "justify.vim" file itself. Just open that file in VIM (using the ":e" command) and you'll see what I mean.

Yawar

----- Original Message -----
From: "r4mz3z" <[email protected]>
To: "Yawar Amin" <[email protected]>
Sent: Monday, 02 December, 2002 00:59
Subject: Re: a little help about vi or vim

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi...
your help have been so useful for me... I can set textwidth in any value
depend of the document in which i'm working.
But I can execute the macro justify, please help me with one little
sample... I located this macro at: "/usr/share/vim/vim61/macros/justify.vim"
I hope don't hurt you, so very thanks.

[Pepo]

iD8DBQE96lv+s4dF9gl05swRAopaAJ40xEggop2QJfSbM3lYdFqrmiCRoACfcK2R aDUPKRqAM5JLTeZ8sb9jTH8=
=Uujz
-----END PGP SIGNATURE-----

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs