You are not logged in.

#1 2016-11-19 14:34:36

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Official vim preset for editing PKGBUILDs?

I have noticed that when I run /usr/bin/updpkgsums, the resulting checksum array contains 10 spaces as a tabstop.  The official PKGBUILD for the linux package however contains 8 spaces as a tab stop (for example the source array) but the sha256sums are 12 spaces).  I have always used the following in my ~/.vimrc which uses tabs not spaces.

set tabstop=2
set shiftwidth=2

So is there an official or unofficial vim setting for PKGBUILDs?  If not, should there be?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#2 2016-11-19 14:40:46

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,842
Website

Re: Official vim preset for editing PKGBUILDs?

/usr/share/vim/vimfiles/syntax/PKGBUILD.vim ?


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2016-11-19 14:40:50

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,521
Website

Re: Official vim preset for editing PKGBUILDs?

graysky wrote:

So is there an official ... vim setting for PKGBUILDs?  If not, should there be?

No, there shouldn't be.  You use vim for your PKGBUILDs, great.  But vim is not required.  Others can use nano, mousepad, or even emacs if they are mentally deranged.  Officially, a PKGBUILD is just a text file, edit it in any text editor you'd like.  There could be grounds to have an official guideline of using tabs and/or spaces and how many for indentation in different places.  But this still would be entirely independent of the editor.  It's not like this is an OS where you need to use a specific VisualStupido in order to work with source code.

graysky wrote:

So is there an ... unofficial vim setting for PKGBUILDs?  If not, should there be?

Unofficially, there can be anything you want.  If you mean has someone packaged a vim plugin for working with PKGBUILDs, then not that I know of - but I don't know it'd be worth it (edit: apparently there is as noted above).  What'd it be, one or two lines in your vimrc?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2016-11-19 14:54:03

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: Official vim preset for editing PKGBUILDs?

WorMzy wrote:

/usr/share/vim/vimfiles/syntax/PKGBUILD.vim ?

I will admit to not knowing how this is applied... I added some customized stuff to /etc/vimrc so when I `vim PKGBUILD` the global config options override those in /usr/share/vim/vimfiles/syntax/PKGBUILD.vim ?  How can I see that these are in fact being applied?

Trilby wrote:

There could be grounds to have an official guideline of using tabs and/or spaces and how many for indentation in different places.

Yes, this is truly what I am asking and/or requesting.  A standardized guideline for spaces/tabs in PKGBUILDS.  Having a vim preset for PKGBUILDs would be the icing on the cake since one could just `gg=G` in vim and have them applied.

Trilby wrote:

What'd it be, one or two lines in your vimrc?

I don't know what to propose, tabs, spaces, how many tabs or spaces.  I know that python is particular about these... see the comments in this for more.  Is this something I should post to the bug tracker as a feature request or gripe to get the distro elders officially involved in the thought?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#5 2016-11-19 14:59:37

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,521
Website

Re: Official vim preset for editing PKGBUILDs?

graysky wrote:

I will admit to not knowing how this is applied.

Then learn.  Don't look for extensions for your editor if you've not yet learned how to use what is already included in your editor.  One way to put that vim file in use immediately is to simply do ":set ft=PKGBUILD".

graysky wrote:

Is this something I should post to the bug tracker as a feature request...

No.  Python has such standards as the python interpreter is fragile and will break if there is an inconsistency.  PKGBUILDs are just shell scripts.  There should be no more formatting standard for PKGBUILDs than there are for shell scripts.

Now if you want to try to set a standard for indentation in shell scripts ... well, good luck with that.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#6 2016-11-19 15:26:35

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: Official vim preset for editing PKGBUILDs?

@Trilby - I understand that about pyhon; I just bring it up as an example of how a vim preset could impact a PKGBUILD if an official standard is set.  I have no interest in setting a standard for shell scripts tongue


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

Board footer

Powered by FluxBB