Mark
Mark

Reputation: 6484

vim: enabling Linux coding style per file

I enabled Linux coding style in $HOME/.vimrc as:

let g:linuxsty_patterns = [ '/home/mark/sample1', '/home/mark/sample2', '/home/mark/sample3' ]

But is it possible to enable it per file? As I know, it is possible to pass vim settings in comments in C files. Also, I tried to manually set linuxsty_patterns while editing opened file in vim, but it didn't take any effect.

What am I doing wrong?

Upvotes: 0

Views: 222

Answers (2)

John Scharber
John Scharber

Reputation: 73

I don't see file types in your example, but I use autogroup like this.

augroup go
  autocmd!
  " Write file before :make, :GoBuild, :GoTest|Func, :GoRun
  autocmd FileType go set autowrite
  " go fmt uses tabs for indentation, ts and sw only affect viewer
  autocmd FileType go setlocal noexpandtab tabstop=4 shiftwidth=4
  " Enable Vim syntax highlighting for Go template files
......
augroup END

Upvotes: 0

Luc Hermitte
Luc Hermitte

Reputation: 32946

You should have stated that your question relates to a specific plugin.

Those questions are better addressed directly to the plugin maintainer.

Now, reading its source code, it seems you just need to specific a list of regexes that match the source files to which you which to apply the plugin setting. It seems this is the only control you could expect with this plugin.

Upvotes: 1

Related Questions