Vim remap to change directory

0

I'd like to have a shortcut in gvim to switch directories. I have the following in my gvimrc.

"noremap <F6> :cd "c:\\project\\working\\code"<return>" 

I can't get it to work, though. What could be the problem?

tecMav

Posted 2012-11-13T14:52:44.373

Reputation: 11

Presumably the outer set of quotes aren't really there, since they would probably start a comment or if not, confuse the inner set. – noodl – 2012-11-13T15:32:45.897

I don't have the outer set of quotes. My rc file only has noremap <F6> :cd "c:\project\working\code"<return> and it was not working. Anyways I got it working. It ain't the double backslash or the forward slash, it was the quotes in the path. – tecMav – 2012-11-13T17:08:59.070

Answers

0

  1. Get rid of the quotes around the directory
  2. Change \\ to /. Even on Windows, vim can use / to navigate directories

New command

noremap <F6> :cd C:/Project/Working/Code<CR>

Ryan

Posted 2012-11-13T14:52:44.373

Reputation: 3 179