Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5954857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:01:50+00:00 2026-05-22T18:01:50+00:00

The official Vim python interface documentation states, that modifying buffers with python is very

  • 0

The official Vim python interface documentation states, that modifying buffers with python is very simple, basically:

:py import vim
:py vim.current.buffer[0] = "Hello world"

However, python throws an exception, when I try to do that:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: bad argument type for built-in operation

Read-only access (e.g. :py print vim.current.buffer[0] works just fine. Am I missing something here? Why can’t I modify vim buffers with python scripts?

[Note: I’m using recent Vim 7.3]

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:01:51+00:00Added an answer on May 22, 2026 at 6:01 pm

    Works for me, “Hello World” is inserted in buffer. Is your vim compiled with +python

    I’m using version 7.3.162

    EDIT

    looking in the hg log for if_python.c I see a lot issues related to python, e.g. this one:

    changeset:   2641:b803b2776880
    tag:         v7-3-062
    user:        Bram Moolenaar <bram@vim.org>
    date:        Tue Nov 16 19:26:02 2010 +0100
    files:       src/auto/configure src/configure.in src/if_python.c src/if_python3.c src/version.c
    description:
    updated for version 7.3.062
    Problem:    Python doesn't work properly when installed in another directory
            than expected.
    Solution:   Figure out home directory in configure and use Py_SetPythonHome()
            at runtime. (Roland Puntaier)
    

    Which version are you on?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Official PHP documentation states that filter_var_array() supports array filtering in the following format: $data
The official documentation states the following: . But I have noticed that there are
The official documentation states: Raw byte size (GB) of all item IDs + 45
The official documentation for TemporaryFile reads: The mode parameter defaults to 'w+b' so that
The official documentation here only lists the minimum required version for a very small
Does exist an official documentation detailing the maximum length of the string descriptor that
Does anyone know the official method for submitting feedback on C# 4.0 so that
Beyond the official documentation, are there any recommended resources for learning to build jQuery
The official documentation tells me I've to do these 3 things in order to
The official documentation says they are optional. I know COM interop requires a unique

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.