Vim on MacOS Incorrectly Indenting

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Vim on MacOS Incorrectly Indenting

Adrian Keister
I'm having difficulty with vim on Mac OS. It's indenting incorrectly. The attached txt file is the test file, and the two screenshots show how different they look on Mac versus Windows. The Windows gVim is the look I want. I've tried everything from brew install vim to re-installing MacVim, no joy. It does not appear to be a vimrc issue, because I've tried the troubleshotting page here, with no joy:

https://github.com/macvim-dev/macvim/wiki/Troubleshooting

Any ideas? Thanks for your time!

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/53af5562-201c-4f03-b7d7-c8fd5138fa73%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

test.txt (726 bytes) Download Attachment
Mac OS MacVim.png (87K) Download Attachment
Windows GVIM.png (447K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Vim on MacOS Incorrectly Indenting

Jürgen Krämer-4
Hi,

Adrian Keister schrieb am 17.05.2019 um 19:19:
> I'm having difficulty with vim on Mac OS. It's indenting incorrectly. The attached txt file is the test file, and the two screenshots show how different they look on Mac versus Windows. The Windows gVim is the look I want. I've tried everything from brew install vim to re-installing MacVim, no joy. It does not appear to be a vimrc issue, because I've tried the troubleshotting page here, with no joy:
>
> https://github.com/macvim-dev/macvim/wiki/Troubleshooting
>
> Any ideas? Thanks for your time!
>

your file contains tabs at the start of lines 5 to 9. On Windows the 'tabstop'
option is probably set to 4, while on Mac it seems to be 8 (the default).

Regards,
Jürgen

--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us.     (Calvin)

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/7e5386cb-2e23-67cf-9958-14b04c7c200f%40googlemail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Vim on MacOS Incorrectly Indenting

Adrian Keister
On Monday, May 20, 2019 at 2:15:08 AM UTC-5, [hidden email] wrote:

> Hi,
>
> Adrian Keister schrieb am 17.05.2019 um 19:19:
> > I'm having difficulty with vim on Mac OS. It's indenting incorrectly. The attached txt file is the test file, and the two screenshots show how different they look on Mac versus Windows. The Windows gVim is the look I want. I've tried everything from brew install vim to re-installing MacVim, no joy. It does not appear to be a vimrc issue, because I've tried the troubleshotting page here, with no joy:
> >
> > https://github.com/macvim-dev/macvim/wiki/Troubleshooting
> >
> > Any ideas? Thanks for your time!
> >
>
> your file contains tabs at the start of lines 5 to 9. On Windows the 'tabstop'
> option is probably set to 4, while on Mac it seems to be 8 (the default).
>
> Regards,
> Jürgen
>
> --
> Sometimes I think the surest sign that intelligent life exists elsewhere
> in the universe is that none of it has tried to contact us.     (Calvin)
Jürgen,

That could be it, but then I have two questions:

1. Why can't I navigate to the very beginning of the line where the indenting is different? This is behavior on the Mac, to be clear, not on Windows.

2. Why doesn't adding
set tabstop=4
in my Mac's vimrc fix the problem?

Thanks for your time!

Cheers,
Adrian

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/3c52c849-1a37-48d1-bf31-a9e1734fbd56%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Vim on MacOS Incorrectly Indenting

Jürgen Krämer-4

Hello Adrian,

Adrian Keister schrieb am 20.05.2019 um 18:22:

> On Monday, May 20, 2019 at 2:15:08 AM UTC-5, [hidden email] wrote:
>> Hi,
>>
>> Adrian Keister schrieb am 17.05.2019 um 19:19:
>>> I'm having difficulty with vim on Mac OS. It's indenting incorrectly. The attached txt file is the test file, and the two screenshots show how different they look on Mac versus Windows. The Windows gVim is the look I want. I've tried everything from brew install vim to re-installing MacVim, no joy. It does not appear to be a vimrc issue, because I've tried the troubleshotting page here, with no joy:
>>>
>>> https://github.com/macvim-dev/macvim/wiki/Troubleshooting
>>>
>>> Any ideas? Thanks for your time!
>>
>> your file contains tabs at the start of lines 5 to 9. On Windows the 'tabstop'
>> option is probably set to 4, while on Mac it seems to be 8 (the default).
>
> Jürgen,
>
> That could be it, but then I have two questions:
>
> 1. Why can't I navigate to the very beginning of the line where the indenting is different? This is behavior on the Mac, to be clear, not on Windows.

you have tabs at the start of line. Normally when on a tab the cursor is
put at the end of the tab. You can change this with the 'virtualedit'
option. Set it to 'all' and you can move through a tab cell by cell.

> 2. Why doesn't adding
> set tabstop=4
> in my Mac's vimrc fix the problem?

Maybe that option has been changed by a (filetype) plugin. If you
execute

  :verbose set tabstop?

Vim will tell you where that option was changed last.

Regards,
Jürgen

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/9caf0b9b-b957-12cf-0e7d-5fa08c61ad7c%40googlemail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Vim on MacOS Incorrectly Indenting

Adrian Keister
In reply to this post by Adrian Keister
On Friday, May 17, 2019 at 12:53:27 PM UTC-5, Adrian Keister wrote:
> I'm having difficulty with vim on Mac OS. It's indenting incorrectly. The attached txt file is the test file, and the two screenshots show how different they look on Mac versus Windows. The Windows gVim is the look I want. I've tried everything from brew install vim to re-installing MacVim, no joy. It does not appear to be a vimrc issue, because I've tried the troubleshotting page here, with no joy:
>
> https://github.com/macvim-dev/macvim/wiki/Troubleshooting
>
> Any ideas? Thanks for your time!

Jürgen,

Excellent! Alas, I won't have access to my Mac for the rest of this week, but I will try those out next week and post back here.

Thanks again!

Cheers,
Adrian

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/3507acca-0346-4023-95c0-82dd854c74b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Vim on MacOS Incorrectly Indenting

Christian Brabandt
In reply to this post by Jürgen Krämer-4

On Mo, 20 Mai 2019, 'Jürgen Krämer' via vim_use wrote:

> you have tabs at the start of line. Normally when on a tab the cursor is
> put at the end of the tab. You can change this with the 'virtualedit'
> option. Set it to 'all' and you can move through a tab cell by cell.

Also, if you enable listmode (:set list), the cursor will automatically
be positioned at the beginning of the tab, instead of the end.

Best,
Christian
--
Wenn man sein Ohr ganz leicht auf die heiße Herdplatte drückt,
kann man riechen wie blöd man ist.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20190521061728.GM2769%40256bit.org.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Vim on MacOS Incorrectly Indenting

Adrian Keister
In reply to this post by Adrian Keister
On Friday, May 17, 2019 at 12:53:27 PM UTC-5, Adrian Keister wrote:
> I'm having difficulty with vim on Mac OS. It's indenting incorrectly. The attached txt file is the test file, and the two screenshots show how different they look on Mac versus Windows. The Windows gVim is the look I want. I've tried everything from brew install vim to re-installing MacVim, no joy. It does not appear to be a vimrc issue, because I've tried the troubleshotting page here, with no joy:
>
> https://github.com/macvim-dev/macvim/wiki/Troubleshooting
>
> Any ideas? Thanks for your time!

Many thanks to Jürgen and Christian for your help! The .gvimrc file was overriding the .vimrc file for the tabstop setting, so that was one problem. Then I actually had tabs in the file, as noted by others. I don't actually want those tabs in there, so the :1,$s/\t/    /g command replaced all tabs by four spaces like I want. Now MacVim looks just like Windows.

Cheers.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/e615027d-7d36-4bfb-a273-d7f45d9b6861%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.