# Vi map command

**URL:** <https://community.unix.com/t/vi-map-command/239437>\
**Category:** HP-UX\
**Created:** [May 5, 2009, 3:15pm UTC](https://community.unix.com/t/vi-map-command/239437 "2009-05-05T15:15:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sumansatpathy](https://community.unix.com/letter_avatar/sumansatpathy/32/6_449c533f586939b6e5f246632a46421f.png) [@sumansatpathy](https://community.unix.com/u/sumansatpathy)\
**Post date:** [May 5, 2009, 3:15pm UTC](https://community.unix.com/t/vi-map-command/239437/1 "2009-05-05T15:15:03Z")

</div>

Hi, I'm trying to map a vi editor key to some commands. I'm using HP-UX 11.11. the command looks like

map ~cmnt o \* Suman Satpathy : \<Esc\> :r! date "\%d\%m\%y" \<Esc\> j$J

basically my idea is to map a shortcut for my commentlines.

but when I run the shortcut it inserts the line as below

- Suman Satpathy : \<Esc\> :r! date "\%d\%m\%y" \<Esc\> j$J

I have tried ^[ in place of \<Esc\> no effect :mad:..

Anybody have any idea why this is not working?? I have checked there are no map keys for esc..

---

<div class="post-metadata">

**Author:** ![vbe](https://community.unix.com/user_avatar/community.unix.com/vbe/32/266_2.png) [@vbe](https://community.unix.com/u/vbe)\
**Post date:** [May 6, 2009, 10:04am UTC](https://community.unix.com/t/vi-map-command/239437/2 "2009-05-06T10:04:46Z")

</div>

Removed post from existing thread and opened a new thread.  
Follow the rules: no thread/post highjacking
