Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow settings to be buffer-local #21

Merged
merged 2 commits into from Mar 9, 2015
Merged

Conversation

idbrii
Copy link
Contributor

@idbrii idbrii commented Feb 25, 2015

This one is a bit more radical. I want python to use spaces and everything else to use tabs.

vimrc:

let g:detectindent_preferred_expandtab = 1

after/ftplugin/python.vim:

let b:detectindent_preferred_expandtab = 0

Only applies to indent settings (not max lines etc).

Add s:GetValue() to properly grab buffer-local options. Assumes if they
are active that we should use their value (instead of assuming existence
means 1) to allow us to force settings for specific filetypes.

Add detectindent_preferred_when_mixed so we use
detectindent_preferred_indent and detectindent_preferred_expandtab when
both tabs and spaces are found. This makes it easier for users to
enforce a "correct" setting when working in messy code.
Only applies to indent settings (not max lines etc).

Add s:GetValue() to properly grab buffer-local options. Assumes if they
are active that we should use their value (instead of assuming existence
means 1) to allow us to force settings for specific filetypes.

To make most filetypes use 'expandtab', add this to vimrc:
    let g:detectindent_preferred_expandtab = 1
And for the exceptions that should use 'noexpandtab' add this to
after/ftplugin/FILETYPENAMEHERE.vim:
    let b:detectindent_preferred_expandtab = 1

Add documentation.
ciaranm added a commit that referenced this pull request Mar 9, 2015
Allow settings to be buffer-local
@ciaranm ciaranm merged commit c09ab6e into ciaranm:master Mar 9, 2015
@idbrii idbrii deleted the buffer-local branch March 9, 2015 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants