1

I am trying to use a variable in this mapping:

let board_ip = "192.168.100.18"                                                                      │
nnoremap <F6> :AsyncRun echo . board_ip . > /dev/pts/1 2>&1<CR>

But I cannot get it working, getting board_ip echoed all the time.

1

1 Answer 1

2

Use :execute to run a command made out of strings:

let g:board_ip = "192.168.100.18"
nnoremap <F6> :execute "AsyncRun echo " . g:board_ip . " > /dev/pts/1 2>&1"<CR>

Not the answer you're looking for? Browse other questions tagged or ask your own question.