1831614 Members
2144 Online
110027 Solutions
New Discussion

vi settings

 
ertraccia
Occasional Advisor

vi settings

Hi everyone,

I usually work with vim on 11.23 and I type everytime ":set paste" to enable the correct paste of formatted text in vim.

I found out that the same command is not available in the default HP-UX vi editor.

Someone knows if it's possible pasting formatted text into vi?
3 REPLIES 3
Bill Hassell
Honored Contributor

Re: vi settings

vim is a vi lookalike but with many enhancements. All the options that can be set are listed in the ex man page under Editor options. vi is a full screen wrapper for the ex editor, thus the interaction between the two. The ":" character is the link between the two.

To set new default values for vi, create the file: $HOME/.exrc where you can change many different features. Here are some popular ones:

set nows ic autoindent autowrite wrapmargin=2set sh=/usr/bin/sh report=1 showmode

Depending on the terminal emulator you are using, you can even assign an action to the function keys using the map keyword. Here are a couple of useful commands:

map #1 :set noai wm=0
map #2 !}exec adjust -m60
map #3 !}exec adjust -m72

The f1 key (#1 above) turns off the automatic indent feature and also turns off the wrap-margin (split by word at end of line) feature. The f2 and f3 keys will take the current line and following text to a paragraph break and adjust (based on trailing words) the right margin to less than or equal to 60 or 72 characters. This is done by piping the paragraph into the adjust program.

Note that 'formatted' text is not really meaningful for a plain ASCII editor. tabs are about the only formatting option and even these depend on a display or printer that agrees on where the tab stops are located.


Bill Hassell, sysadmin
Yogeeraj_1
Honored Contributor

Re: vi settings

hi,

you can as well install vim.

http://hpux.connect.org.uk/hppd/hpux/Editors/vim-7.1/

Do not forget to check for all the dependencies:

atk cairo expat fontconfig freetype gettext glib2 gtk+2 jpeg libXft libXrender libiconv libpng ncurses pango tiff zlib



hope this helps!
kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
ertraccia
Occasional Advisor

Re: vi settings

I have tried erasing $HOME/.exrc and now both vi & vim works fine for me (about pasting formatted text).

I have already installed vim, but using source code instead of depot.

Thank you very much.