Questions tagged [user-input]
The user-input tag has no usage guidance.
21
questions
2
votes
0
answers
65
views
How does neovim handle keyboard input?
In classical Vim, keyboard input is handled fairly archaically, and it's why you can't remap say <Ctrl-M> and <Enter> to different keys or commands. This is probably my biggest gripe about ...
2
votes
1
answer
294
views
Is there a way to display in the statusline when capslock is detected?
One of the biggest problems I currently have in Vim is I start working enter a few commands and suddenly all key binds and commands start acting up. After a few seconds of panic and trying to do the ...
0
votes
1
answer
37
views
How does the dialog for W11 work?
If I edit a file outside of a Vim session, then go back to the Vim session, I get this nice message:
W11: Warning: File "~/.vimrc" has changed since editing started
See ":help W11" ...
0
votes
1
answer
126
views
How to trigger callback function when input
I'm trying to write a simple plugin that let user input something, and while inputing, the plugin echos the input text in real time.
So far the script shows result after Enter pressed:
function! Test()...
1
vote
1
answer
120
views
Execute command with special characters from user input
I would like to correctly intepret the <cr> in a command that is created based on user input.
For example, this function runs correctly and it will split the line a the location where the cursor ...
0
votes
1
answer
921
views
Can't use python inputs in Vim
I'm new to Vim. I ran the code
print("Hello world")
name = input("Name: ")
print("Hello",name)
and then ran it using :w !python and got the result
Hello world
Name: ...
0
votes
2
answers
90
views
Use the buffers auto completion in an input() dialogue
I am trying to add autocompletion, with suggestions from the currently edited buffer when reading input from the user for a search string:
function! Testinput()
return input("Enter search string: ...
1
vote
0
answers
19
views
Mapping <C-[> causes input() to not be abortable
The following function, when at the prompt, if one presses <Esc>, then it will print EXIT.
function! Testinput()
let g:searchString = input("Enter search string: ", 'default', 'syntax')
...
3
votes
2
answers
281
views
What is the proper way to allow the user of a plugin to modify settings?
So I have a plugin that I am writing which should allow the user to set whether they want to enable a feature. I want the feature to be disabled by default, and allow the user to change it by adding ...
1
vote
1
answer
81
views
How to get a function to print something to colon command and let user edit it?
I need to write a function that when executed it opens colon command and paste some stuff on to it and let user edit it before executing the command.
for example
function! EditRelativePath()
:e ...
1
vote
1
answer
66
views
How to cut off user input and continue with script after a certain number of characters are entered?
I'm struggling to write a function that asks the user to input a string, but cuts it off after they've inputted a specific amount of characters (three, for example) and moves on with the rest of the ...
1
vote
1
answer
169
views
Vim bell limited to once per half a second
Since Vim 8, I've noticed that the bell can sound at most once per half a second. This annoys me. I have this solved by recompiling, but am still looking for a way to do it without.
I've searched the ...
0
votes
1
answer
312
views
Capture the next keypress under 200ms
1) I need to capture the next key press from the keyboard, if there are any in 200 millisecond. Which function should I use to achieve this?
2) Basically I need to re-send the captured key, with some ...
2
votes
1
answer
283
views
User Input in a Recording
So I am pretty new to vim, but I have started using it as my Latex editor to help get more efficient. Anyways I have a recording that I would like to prompt a user for input on that will change how ...
0
votes
2
answers
55
views
Extract JavaScript variable (feature example): how to improve it?
I am a Vim newbie with one week experience and I'm already enjoying it.
I've successfully written an (ugly) command+function+mapping with which I can extract some code to a new variable in JavaScript....
7
votes
1
answer
609
views
How to measure words per minute?
Been looking for a method to measure words per minute, with no luck. Is there any way to do this?
11
votes
2
answers
2k
views
How does vimgolf record all keystrokes?
From time to time I like to engage in a round of vimgolf. It can be enlightening.
How are they able to record all the keystrokes? That must be a vim feature. Anybody any idea how to do that. It could ...
2
votes
2
answers
2k
views
How do you pass user input to a system command?
I'm trying to write an autocmd to make a commit to a git repository. Here is some non-functional code that should illustrate what I'm trying to do:
let g: CommMsg = ''
augroup misc
autocmd!
...
2
votes
2
answers
964
views
confirm(msg, choices) without newline on msg?
Is there any way to have the confirm function place the choices on the same line as the msg prompt?
confirm("Yes no question", "&Yes\n&No", 2)
Instead of
Yes no question
(Y)es, [N]o:
it ...
3
votes
1
answer
652
views
How do I get the next n characters input by the user?
I answered a question that needed a user input using the built-in input() function, which works great.
I was wondering if it was possible to ask vim for (let say) the next 3 characters input, without ...
22
votes
2
answers
19k
views
How do I exit from input after using a `:i` command?
I got stuck in ex input mode by typing :i. Now I cannot use any commands. All there is just a string of text. Pressing escape does not get me out of it, typing :visual does not get me out of it, and ...