Vim dictionary support

Source: Internet
Author: User

 

My Ubuntu version is Ubuntu 10.10,

1. First install sdcv:

Root@linuxidc.com :~ # Apt-Get install sdcv

2. Install Dictionary data

The downloaded dictionary is: langdao-EC-GB Dictionary (En-zh_cn) langdao English-Chinese dictionary. The downloaded package name is: stardict-langdao-EC-GB-2.4.2.tar.bz2 (this package is also available in many csdn)

3. decompress the compressed package to the/usr/share/stardict/DIC directory (if this directory is not available, create it manually ).

4.

Now, you can search for words by typing sdcv on the terminal.

Root@linuxidc.com:/# sdcv star

Found 1 items, similar to star.

--> Lang Dao English-Chinese dictionary 5.0

--> Star

* [St region:]

N. stars, luck, stars

Vt. Decorated with stars and marked with asterisks to become stars

Vi. Become a star

[Medical] stars, stars

5. But we also need to use the word query function in Vim. Add the following statement in the vim configuration file:

Root@linuxidc.com:/# Vim/etc/Vim/vimrc

Add at the end:

Function! Mydict ()

Let expl = System ('sdcv-n '.

\ Expand (""))

Windo if

\ Expand ("%") = "dict-TMP" |

\ Q! | Endif

25vsp dict-TMP

Setlocal buftype = nofile bufhidden = hide noswapfile

1 S/^/\ = expl/

1

Endfunction

Nmap f: Call mydict ()

In the file opened with vim, press SHIFT + F at the cursor word, and press enter to view the word.

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.