0

I have the following lines in my .vimrc for Ubuntu. They insert the current date as a string, and insert my signature at the bottom of the currently open file, respectively:

:map <F2> "=strftime("%B %d, %Y")<CR>Pli<Return><Esc>"
:map <F3> :e ~/.sign.txt<CR>ggV/^$<CR>k"*xG$a<C-R><C-O>*<Esc>:w<CR>:bd<CR>G$a<C-M><Esc>"*P

They're not working on my Macbook, though. The F2 command results in inserting "Q\n", and the F3 command results in inserting "R\n". How can I update these mappings to work on my Mac?

Ben Quigley
  • 727
  • 4
  • 18
  • Terminal.app? By default the function keys aren't all bound the same as would be expected in other terminals. See https://github.com/google/terminal-app-function-keys – ephemient May 17 '17 at 19:52
  • Check out https://stackoverflow.com/a/12814727/5591038. It might give you a pointer on how to use function keys with VIM on mac. I believe after the mappings specified in https://stackoverflow.com/a/12814727/5591038, you would be able to use your regular , mappings. Please give it a try. – Prasanna May 29 '17 at 07:27

0 Answers0