Vim Tips Wiki


1,624pages on
this wiki
Add New Page

Use this page to discuss script 1372 ldap: Active Directory email lookup using Python and LDAP

  • Add constructive comments, bug reports, or discuss improvements (see the guideline).
  • Do not document the script here (the author should do that on
  • This page may be out of date: check the script's page above, and its release notes.


ldap.vim searches a ldap-directory for a username. If the user is found, the script returns the full name of the user along with an e-mail address to vim.

If no match is found, the script returns the string "NF".

The script uses the following default settings that you might want to change:

  • Scope: subtree
  • Searchstring: "mailNickname=%s*"
  • Field that contains full name: "name"
  • Field that contains mail address: "mail"


Fieldnames may vary in different LDAP-implementations. Therefore, you might not get the search result you expected. The easiest way to fix this is to manually search your LDAP-directory with a tool, and then configure the script with the correct fieldnames.

If you don't have a favorite LDAP-search tool, open python and replicate the open connection and login statements from the script. Then change the search string until you get a correct result. Verify that the fields containing the full name and e-mail address are correct. If not, modify the script with the correct field names.


Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Also on Fandom

Random Wiki