0

Then I open vim from terminal and open an directory like vim ., my starts in Read Only Mode.

enter image description here

I cant figure out why this happen and how I can change it.

If I start MacVim everything is fine. But then I start vim from the terminal and open a directory this screen comes. I can navigate one dir up and back again, and I have write access.

EDIT

I installed all my vim settings on Ubuntu 15.04. Now I can use Does anybody know how to change this behaviour of vim? Now I can use netw with the command vim . like I always used. enter image description here

As you can see, there is no RO (read only) mark. How can I have this in Mac on iTerm too?

DenicioCode
  • 8,668
  • 4
  • 18
  • 33

3 Answers3

1

What you see is exactly what you are supposed to see when doing $ vim .: the built-in netrw plugin displays a listing of the current directory that you can use to navigate your project.

If you don't want that listing, don't ask for it:

$ vim

or:

$ vim file
romainl
  • 186,200
  • 21
  • 280
  • 313
  • 1
    But if I use `ctl-p` to open a file, it will open in a separate window and not in the current. In MacVim I do not have this behaviour. – DenicioCode Jul 04 '15 at 12:57
  • `$ vim` opens Vim with an empty buffer while `$ vim .` opens a file listing, end of the story. If you don't want that behavior don't use that argument. If you have other troubles opening files, make your question more focused or ask another one. – romainl Jul 04 '15 at 15:06
  • 1
    I think you do not know what I mean. Maybe be problem is not detailed explained. If I open vim with listing, I can navigate and open a file, but I cannot open a file via ctrl-p, If I open an file via ctrl-p it will open vertically in a new window. This isn happen on Ubuntu, just on Mac. – DenicioCode Jul 04 '15 at 18:02
  • 2
    If you don't use netrw to open files, why do you explicitly ask Vim to show it on startup? Use `$ vim` instead of `$ vim .`. – romainl Jul 04 '15 at 19:41
  • Because I want to see the file listed. You have no clout what I mean, I will edit this question to show the problem in detail. On my iMac I can use `vim .` to use netrw and than open a file by crtl-p in the Same window. If you would just help me by answering the ask question it would help more than this discussion. Newtr opens in READ ONLY MODE, and I want to change this. If you know how, share it. MacVim has not this behavior like vim in the terminal. – DenicioCode Jul 06 '15 at 07:10
  • On Ubuntu works everything find, it must be a mac problem. – DenicioCode Jul 06 '15 at 07:32
1

ctrl-p is not mapped by netrw; on my system, its set up by the yankring plugin. If vim is doing something other than going up one line, then you have a plugin involved. Try using :map to see what its mapped to; then do a search for that in your plugins directory.

The netrw way of opening a file in the same window is to use the <enter> key, although the g:netrw_browse_split variable may be used to change that default behavior.

Netrw opens in read-only mode, and that's not going to change. The file being opened should not be in read-only mode, however, if that's what you meant. If you're having a problem of that sort, please update your netrw; the most up-to-date version is at http://www.drchip.org/astronaut/vim/index.html#NETRW .

user21497
  • 1,061
  • 8
  • 9
  • The annoying part is that that most up to date version won't fly with LTS vim. Gah. Is there... just a public repo for netrw version history or so? – sehe Feb 15 '16 at 19:52
0

After I installed macvim 7.4 Every thing works!

DenicioCode
  • 8,668
  • 4
  • 18
  • 33