[Slackbuilds-users] Vim indent settings for SlackBuilds

Erich Ritz erich.public at protonmail.com
Tue Sep 8 14:33:10 UTC 2020



‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Friday, September 4, 2020 9:09 AM, Dave Woodfall <dave at slackbuilds.org> wrote:

> On 04/09/20 15:16,
> Slackbuilds Users slackbuilds-users at slackbuilds.org put forth the proposition:
>
> > Hi list,
> > Does anyone have (or aware of) a vim formatting rules file for SlackBuilds? I recently submitted a SlackBuild that had mixed tabs and spaces... I want to avoid that oversight in the future.
> > After a quick internet search all I turned up was this, which is for automatically treating the *.info file as a shell script:
> >
> > >
> I use those settings everywhere mostly, but you can make an autocmd
> for slackbuilds something like:
>
> au BufRead,BufNewFile *.SlackBuild setl expandtab |
> \ setl tabstop=2 |
> \ setl etc...
>
> `setl' is short for`setlocal', and it only works in the buffer with
> the slackbuild open, in case you have other buffers open.
>
>
> Dave
>


Thanks everybody for the feedback.  I've appended the following to my ~/.vimrc:

---
" Options for SlackBuilds
autocmd BufEnter,BufNew *.info call CheckSlackBuildInfo()
function CheckSlackBuildInfo()
	if filereadable(expand('%:p:r'). '.SlackBuild')
		setlocal filetype=sh
	endif
endfunction
autocmd BufEnter,BufNew *.SlackBuild call SetSlackBuildType()
function SetSlackBuildType()
	setlocal filetype=sh
	setlocal expandtab
	setlocal tabstop=2
	setlocal shiftwidth=2
endfunction
---

Erich


More information about the SlackBuilds-users mailing list