iTerm2 vim cannot map alt key

1,545

Solution 1

Since Mac OS X uses the option key to insert characters, regular <A-[key]> mappings won't work. Thus :h i_CTRL-V becomes your friend. Your right arrow mapping, for example, can be typed like this:

mapcontrolVoption<C-w>l

This will result in what looks like:

map ^[f <C-w>l

Note, however, that you can't copy and paste the above, as ^[ is one character in vim, but is here represented with two characters. Most vim users would suggest, however, that you not use the arrow keys for this (or anything). I use map <C-l> <C-w>l (and likewise for h, j, k) instead, as it keeps my hands on the keyboard.

Solution 2

See this answer of mine on a similar question. My advice is to use :h mapleader.

Share:
1,545

Related videos on Youtube

Mouna Ben Chamekh
Author by

Mouna Ben Chamekh

Updated on September 18, 2022

Comments

  • Mouna Ben Chamekh
    Mouna Ben Chamekh almost 2 years

    I'm working on a JAVA application that uses Google autoML Rest API to classify images based on a trained model (I trained the model using the web platform directly). I'm having trouble to send any request to use this API to make predictions or get the existing models, I'm always having a 404 error.

    I doubt I don't have the needed permissions to make the call, I used OAuth2 to authenticate but still having the same problem. I'm pretty sure that the authentification is correct because I tried it on another API that requires it and it worked fine.

    Furthermore, I've been working with the google video intelligence API and I didn't have this problem. for example, if i would like to get the existing models, I send the following GET request:

    Request URL : https://automl.googleapis.com/v1beta1/Project-ID/models

    Error message : The requested URL /v1beta1/Project-ID/models was not found on this server.

    Any idea of the cause of this error?

  • Mouna Ben Chamekh
    Mouna Ben Chamekh almost 6 years
    Thank you for your answer. It's not mentioned here in this documentation. But I've tried it and it's working now! thank you very much! But I don't understand why there is a difference in their docs!
  • F10
    F10 almost 6 years
    Is it working for you by doing the curl command? I've had to set the environment variable for the service account authentication
  • Mouna Ben Chamekh
    Mouna Ben Chamekh almost 6 years
    yes the environment variable GOOGLE_APPLICATION_CREDENTIALS is already set