Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Echo a function call from vim command line

Tags:

vim

How would I do something like:

:echo call MyFunction()

so that I can see the result of calling the function?

like image 595
Juniper Belmont Avatar asked Feb 05 '13 00:02

Juniper Belmont


People also ask

How to call a function in Vim?

Calling A Function Vim has a :call command to call a function. The call command does not output the return value. Let's call it with echo . To clear any confusion, you have just used two different call commands: the :call command-line command and the call() function.

How do I echo in Vim?

Try out echo by running the following command: :echo "Hello, world!" You should see Hello, world! appear at the bottom of the window.

What is let G in Vim?

l: local to a function. g: global. :help internal-variables. Follow this answer to receive notifications.

How do I run a script in vim?

You can always execute Vimscript by running each command in command mode (the one you prefix with : ), or by executing the file with commands using a :source command. Historically, Vim scripts have a . vim extension. Here, :so is a short version of :source , and % refers to the currently open file.


1 Answers

Use something like this:

:echo Myfunction()

like image 194
1983 Avatar answered Oct 08 '22 20:10

1983