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 1006071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:24:01+00:00 2026-05-16T08:24:01+00:00

There is a vim function Send_to_Screen(text) which sends some text to a console screen

  • 0

There is a vim function Send_to_Screen(text) which sends some text to a console screen session. I have a mapping

vmap <F4> "ry :call Send_to_Screen(@r)<CR>

which calls the function with the current selection. Now I want do define another mapping which calls the function with the contents of the whole buffer, but I don’t get it to work. I tried

nmap <F5> maggVG"ry`a :call Send_to_Screen(@r)<CR> 

but it doesn’t work. So how do I define the mapping with the text of the current buffer?

  • 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-16T08:24:01+00:00Added an answer on May 16, 2026 at 8:24 am

    How about:

    nmap <F5> :call Send_to_Screen(join(getline(1,'$'), "\n"))<CR>
    

    The function getline() returns a list of lines in the selected range (1 is the first line and “$” is the last) and the function join() joins the contents of a list together with the provided separator (“\n” in this case). See:

    :help getline()
    :help join()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following Vim-function: fu! Create_file_and_write_to_it(name, text) new execute normal i . a:text
Is there a function in Vim which will switch to a buffer? For example,
Is there a shortcut in Vim for going to the next word which is
Is there a Vim plugin, script, or function out there that allows Vim search
I have a function in vim that is calling update and I'd like to
I have a function call in a program that I'm maintaining has 28 arguments
Is there a way to call a C++ shared library function from within a
Is there a plugin for vim, somewhat like Jsbeautify, which automatically generates JavaDoc like
I have a simple vim script that takes a visual block of text and
I'd like to add to my .vimrc file a function which updates the text

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.