Precautions for installing and using Vim on the AIX operating system

Source: Internet
Author: User

Go to] Notes for installing Vim on the AIX operating system


Http://blog.csdn.net/chinainvent/archive/2008/07/26/2716820.aspx


In my current jobSecurecrt, Log onIBMOfAIX UnixProgramming the operating system. The two servers used for workAIXVersion is5.2And5.3. These two versions have the same situation and no difference for the issues discussed below.

 

AIXProvidedVIEditor. But I like itVimSo try to install it. The installation procedure is as follows:

1. Go to the vim Official Website: ftp://ftp.vim.org/pub/vim/unix/to download a new version.Vim-7.1.tar.bz2.


2. On the AIX service, you generally do not have the permission to directly install the software. But it doesn't matter. Find a place where you can create a directory, such as/home/myname/

CreateSoftDirectory, which is used to install your favorite software. SetVim-7.1.tar.bz2Decompress/Home/myname/soft/vim71, EnterSource codeDirectory:/Home/myname/soft/vim71/src. At this time, you have two methods to compileVim:

Method 1:UseAIXBuilt-in CompilerXlc

#1.RunConfigure

$ Export cc = xlc#UseAIXBuilt-inXlcCompiler

$ Export cflags =-q64#If your server is64BitCPUMake sure to use this option

$./Configure -- prefix = <Installation path> -- Enable-multibyte#Executable./Configure -- HelpView more options

#<Installation path> is the directory with write permission, for example,/home/myname/soft/vim71.

#Use-- Enable-multibyeCan be used.VimOfEncoding, fileecncodings.

#2.RunMake

$ Make

$ Make install#In this step1In step-- PrefixThe specified installation path installs the executable files andManFile

 

Method 1:UseGccCompile

#The first step should be changed:

#1.RunConfigure

$ Export cc = gcc#UseGccCompiler

$ Export cflags =-maix64#If your server is64BitCPUMake sure to use this option

$ Export ldflags =-maix64#If your server is64BitCPUBe sure to use this option, the linker Option

$./Configure -- prefix = <Installation path> -- Enable-multibyte

3. Check the value of the display environment variable before executing Vim (skip this step if your DISPLAY variable value is empty ).

When I openVimNo response, like getting stuck. But execute the commandKill-30 <Vim.ProgramNo.>It is activated immediately. The following is an environment variable.DisplayIt's strange.

Because the server is also installedOracle, AndOracleSome terminal login needs to be usedDisplayVariable:

 

Figure 1,

 In order not to affect the use of other colleaguesOracle <Installation path>The executable file Vim under/bin/is renamed to vim71, and<Installation path>In the/bin/directory, create a shell script named vim,For vim71Encapsulation:

-――File: Vim -----

 #! /Bin/sh

Export display =;

<Installation path>/Bin/vim71 "$ @"

Exit;

Change the use of this shell script to executable: chmod + x vim. In ~ /. Add path: path + = to the profile file.<Installation path>/Bin /.

In this way, when we executeVimThe command is actually being executedThis shellScript, and the script firstDisplayIf the variable is left emptyVim71You can start it normally. You can also encapsulate executable programs such as vimdiff.

There is also a better way to change the original executable file name. In yourCreate a bin directory under/home/myname/soft/to store links to all executable files installed by yourself. AndAdd the/home/myname/soft/bin directory ~ Path + =/home/myname/soft/bin in the PATH variable of the/. profile file. Put the shell script in this directory, and change vim71 in the shell script to vim.


4. Can Vim enable syntax highlighting on AIX?

No doubt. You can do it!

UseSecurecrt, Set the terminal typeVT100. In$ Vim/vimrc, Configure as follows:

If & term = ~ "Xterm" | & term = ~ "VT100" | & term = ~ "ANSI"

If has ("terminfo ")

Set t_co = 8

Set t_sf =^ [[3% P1 % DM

Set t_sb =^ [[4% P1 % DM

Else

Set t_co = 8

Set t_sf =^ [[3% DM

Set t_sb =^ [[4% DM

Endif

Endif

Note:^ [The input is as follows:CTRL + V,PressESCKey. For more information, seeVimRun the following command:Help xterm-color.


5. Vim is installed by default. You can view Chinese characters on Aix. But when the cursor moves over Chinese, Chinese will become garbled. What should I do?

For example, the normal display is as follows:

Figure 2,

 

When the cursor//Or when the boundary is moved, it will look like the following:

Figure 3,

After studying many methods, we finally found thatSecurecrtYou can solve this problem by changing the fontChinese_gb2312That:

Figure 4,


6. Can Vim installed on AIX delete a Chinese character at a time when running the X or backspace command?

This problem has been studied for a long time. I have mentioned settings on the Internet.Ecoding(Prerequisite for installation)VimSpecified-- Enable-multibyeOption).LinuxThe VM is valid (but the font is still required to be new ):

"Suport Chinese Language

Set fileencodings = ucs-bom, UTF-8, cp936, Latin1"VimEncoding of the opened file,Explain in order

Set encoding = cp936"VimInternal code,That is, the encoding of the files in the buffer zone.

Set fileencoding = cp936"VimEncoding used to save files

Set termencoding = cp936"Terminal encoding type

7. In Vim installed on AIX, the map ing key is invalid. What should I do?

This is caused by incorrect keyboard selection on the terminal. Solution: In securecrt, select "xterm" on the simulated keyboard ":

Figure 5,


But I am very worried that I am workingAIXOn the server, this method does not work! UseH, lCommand, you need to move twice to cross a Chinese character, useBackspaceIt takes two times to delete a Chinese character!

See this articleArticleIf you have any solutions, please leave me a message. Thank you!




Bytes ------------------------------------------------------------------------------------------------------------------------------

My compilation method:

$ Prtconf

CPU type: 64-bit

However, setting cflags =-q64 does not work. When a 32-bit library is prompted during compilation, this parameter is not set.

Set

$ Export cflags = "-qlanglvl = extc99"

$./Configure -- prefix =/home/ud090401/vim73 -- enable-multibyte -- disable-Gui -- without-X -- disable-xsmp -- With-features = huge

$ Make

$ Make install


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.