Sunday, August 28, 2016

Re: How to reference characters within visually selected text within a function?

On Sunday, August 28, 2016 at 10:51:48 PM UTC, jf...@worcester.edu wrote:
> Hi,
>
> I have a question. I am trying to create a function that uses visually selected text.

So basically what I'm trying to do is create a very simple context menu with copy, cut and paste options. (See code below)

function ContextMenu() range
let choice = confirm("Context Menu", "copy\ncut\npaste")
if choice == 1
<selected_text>yank
elseif choice == 2
<selected_text>delete
elseif choice == 3
<selected_text>put
endif
endfunction

But as you can see from all my <selected_text> pseudo code, I don't know how to access the selected text from within the function.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment