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

  • SEARCH
  • Home
  • 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 9198293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:15:12+00:00 2026-06-17T22:15:12+00:00

Python support is integrated in the latest versions of emacs. For example C-c C-z

  • 0

Python support is integrated in the latest versions of emacs. For example C-c C-z provides me an interpreter and C-c C-c automatically interprets the file I’m working on without moving to the other buffer. (Although there are some downsides to emacs’s approach)

Is this possible in vim, or as easy done as in emacs with just two keystrokes? I know I can evaluate an expression with :python, but it is not exactly what I desire.

  • 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-06-17T22:15:13+00:00Added an answer on June 17, 2026 at 10:15 pm

    To execute the current file in python, you can use the command :!python %. You can bind this to a keyboard shortcut by editing your vimrc. For example, adding nnoremap \ll :!python %<cr> to your vimrc will execute the current file in python when you type \ll in normal mode. (* see footnote for more details).

    The vim-ipython plugin lets you open an ipython window in vim. You may also be interested in tmux, which allows you to split your terminal in two, vertically (so you can have a shell and vim running in parallel).

    There are plenty of plugins that can turn vim into a really good python IDE. “pyflakes”, which automatically highlights syntax errors, is a particular favorite of mine.

    This blog post describes vim plugins for python extensively:

    http://sontek.net/blog/detail/turning-vim-into-a-modern-python-ide


    (*) As an aside, you may want to make this command specific to python files (it doesn’t really make sense to execute C++ source in a python interpreter). This can be done either by putting it in a specific python.vim file in your .vim/ftplugin directory, or by writing

    autocmd FileType python nnoremap \ll :!python %<cr>
    

    in your .vimrc. That way, you can rebind the \ll keyboard shortcut to different actions for different types of file.

    As a second aside, if you just want to execute a section of the current file, select the relevant lines in visual mode (SHIFT+v) and type the :!python % command. The lines selected will get piped to the python interpreter!

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

Sidebar

Related Questions

I setup python support for emacs using rope and yasnippet by following the tutorial
Does python support random json serialization? I get this error: Traceback (most recent call
Does Python support short-circuiting in boolean expressions?
when I use MySQLdb get this message: /var/lib/python-support/python2.6/MySQLdb/__init__.py:34: DeprecationWarning: the sets module is deprecated
Python not support adding a tuple to a list: >>> [1,2,3] + (4,5,6) Traceback
I have a setup.py that needs to support both Python 2 and 3. The
I have a version of Vim compiled with python 2.6 support enabled ( from
Does urllib2 in Python 2.6.1 support proxy via https? I've found the following at
I read that Python does not actually support 2D arrays but rather an array
Python, Perl and PHP, all support TCP stream sockets . But exactly how do

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.