up vote 1 down vote favorite
share [g+] share [fb]

I would like to be able to double click on the file "_vimrc" and have it open up in vim.

However, "_vimrc" doesn't have a file extension so I can't have it open in vim based on file type.

EDIT:

This is still unanswered in my opinion. I did find a workaround as shown below, but I'd rather not affect all of the extension-less files on the computer.

link|improve this question

feedback

3 Answers

up vote 1 down vote accepted

You don't. This is really the wrong approach here. You usually open up _vimrc only from vim (and usually source it right afterwards), therefore no need for an association.

Just put this in your _vimrc:

let mapleader = ","
nmap <leader>v :e $myvimrc
nmap <leader>s :so $myvimrc

and when you need a quick setting made, you ,v - do it, then write it :w, and source it ,s. (these are my mappings, you're free to change them to your liking).

link|improve this answer
feedback

I found an article that describes how to associate all extensionless files with a given application. Not exactly what I wanted, but it may do for now. It works. I tried it.

link|improve this answer
Finally, you got it right! Works fine for me too! Thanks for the info. You deserve 10 points :) Well, 20 since I upvote your question. – r0ca Feb 25 '10 at 20:45
@r0ca. Thanks for the support. However, I'm not satisfied with my own answer. It's just a workaround. I don't really want to affect all extensionless files, just one. I would be glad to see an answer that would show me how to do this. – molecules Feb 25 '10 at 21:50
feedback

When you want to open your file, right-click on it and hit: Open with... Then, hit: Choose default program.

Then, select your VIM application and you will see "Always use the selected program to open this kind of file"

It should work!

link|improve this answer
How do you get Open with... to come up when there is no file extension? – molecules Feb 25 '10 at 19:06
Then right-click on it, hit OPEN. Then you'll be prompt to chose the program to open it. Then select "Select a program from a list of installed programs". Then, select the program you want and check at the bottom: "Always use the selected program to open this kind of file". – r0ca Feb 25 '10 at 19:14
The "Always use the selected program to open this kind of file" option is greyed out so that I cannot select it. Try creating a file that doesn't have an extension to try it out. – molecules Feb 25 '10 at 19:18
I tried it and it worked fine for me. Are you local admin? – r0ca Feb 25 '10 at 19:21
I tried logging off my standard user account and then logging in as the super user and that did not make a difference. It sounds like you have the setting "hide known file extensions" enabled. – molecules Feb 25 '10 at 19:33
show 2 more comments
feedback

Your Answer

 
or
required, but never shown

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