I'm trying to map the enter key in Vim the first time to create a sort of... pre-mapping.
我试着在Vim中第一次映射enter键创建一个…pre-mapping。
This is basically want I want:
这基本上是我想要的:
nnoremap <cr> :nnoremap <cr>:!tmux send-keys -t :1.0 "py.test --cov" C-m <cr><cr>
But I want all of the <cr>
(except the first one) to literally be like I typed <cr>. I won't know ahead of time what tmux session:window.pane I want to send these keys to, but I don't want to have to type out that whole thing. The first time I press Enter I want it to all pop up ready for me to just move over to the right stuff, set my session, window, and pane, and just hit enter.
但是我想要所有的
But right now it's treating the others as command characters. What do I need to do here?
但是现在,它把其他人当做命令角色。我在这里需要做什么?
2 个解决方案
#1
0
You should use <lt>
to replace the first <
in each of the keys. So the command would be
您应该使用
nnoremap <cr> :nnoremap <lt>cr>:!tmux send-keys -t :1.0 "py.test --cov" C-m <lt>cr><lt>cr>
#2
0
One (likely) horrible solution is
一个(可能)可怕的解决方案是。
c<left><<right><right>r>
#1
0
You should use <lt>
to replace the first <
in each of the keys. So the command would be
您应该使用
nnoremap <cr> :nnoremap <lt>cr>:!tmux send-keys -t :1.0 "py.test --cov" C-m <lt>cr><lt>cr>
#2
0
One (likely) horrible solution is
一个(可能)可怕的解决方案是。
c<left><<right><right>r>