From 9e45c07a8d2eb77a1d276f762a448f42a33a47c6 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Wed, 14 Apr 2021 11:59:14 +0200 Subject: Update --- ftplugin/fortran.vim | 15 +++++++++++---- ftplugin/graphql.vim | 2 +- ftplugin/lisp.vim | 2 +- ftplugin/racket.vim | 2 +- ftplugin/raku.vim | 48 ++++++++++++++++-------------------------------- ftplugin/zig.vim | 4 +++- 6 files changed, 33 insertions(+), 40 deletions(-) (limited to 'ftplugin') diff --git a/ftplugin/fortran.vim b/ftplugin/fortran.vim index 3c2ebc87..bfca757e 100644 --- a/ftplugin/fortran.vim +++ b/ftplugin/fortran.vim @@ -4,14 +4,14 @@ endif " Vim settings file " Language: Fortran 2008 (and older: Fortran 2003, 95, 90, 77, 66) -" Version: (v52) 2020 October 07 +" Version: (v53) 2021 April 06 " Maintainer: Ajit J. Thakkar ; " Usage: For instructions, do :help fortran-plugin from Vim " Credits: " Version 0.1 was created in September 2000 by Ajit Thakkar. " Since then, useful suggestions and contributions have been made, in order, by: " Stefano Zacchiroli, Hendrik Merx, Ben Fritz, David Barnett, Eisuke Kawashima, -" and Doug Kearns. +" Doug Kearns, and Fritz Reese. " Only do these settings when not done yet for this buffer if exists("b:did_ftplugin") @@ -70,12 +70,19 @@ endif " Set comments and textwidth according to source type if (b:fortran_fixed_source == 1) setlocal comments=:!,:*,:C - " Fixed format requires a textwidth of 72 for code - setlocal tw=72 + " Fixed format requires a textwidth of 72 for code, + " but some vendor extensions allow longer lines + if exists("fortran_extended_line_length") + setlocal tw=132 + elseif exists("fortran_cardimage_line_length") + setlocal tw=80 + else + setlocal tw=72 " If you need to add "&" on continued lines so that the code is " compatible with both free and fixed format, then you should do so " in column 73 and uncomment the next line " setlocal tw=73 + endif else setlocal comments=:! " Free format allows a textwidth of 132 diff --git a/ftplugin/graphql.vim b/ftplugin/graphql.vim index f0615552..1f9e1df9 100644 --- a/ftplugin/graphql.vim +++ b/ftplugin/graphql.vim @@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand(':p'), 'graphql', 'ftplugin/graphql.v finish endif -" Copyright (c) 2016-2020 Jon Parise +" Copyright (c) 2016-2021 Jon Parise " " Permission is hereby granted, free of charge, to any person obtaining a copy " of this software and associated documentation files (the "Software"), to diff --git a/ftplugin/lisp.vim b/ftplugin/lisp.vim index cc86c720..e6bd3cb9 100644 --- a/ftplugin/lisp.vim +++ b/ftplugin/lisp.vim @@ -8,7 +8,7 @@ endif " URL: http://sites.google.com/site/khorser/opensource/vim " Original author: Dorai Sitaram " Original URL: http://www.ccs.neu.edu/~dorai/vimplugins/vimplugins.html -" Last Change: Oct 23, 2013 +" Last Change: Mar 10, 2021 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") diff --git a/ftplugin/racket.vim b/ftplugin/racket.vim index 8dd74d7f..f7f57a38 100644 --- a/ftplugin/racket.vim +++ b/ftplugin/racket.vim @@ -34,7 +34,7 @@ setl lispwords+=match-letrec,match-define,match-define-values setl lisp " Enable auto begin new comment line when continuing from an old comment line -setl comments+=:; +setl comments=:;;;;,:;;;,:;;,:; setl formatoptions+=r setl makeprg=raco\ make\ --\ % diff --git a/ftplugin/raku.vim b/ftplugin/raku.vim index 423dd786..ea2536b5 100644 --- a/ftplugin/raku.vim +++ b/ftplugin/raku.vim @@ -31,7 +31,7 @@ setlocal commentstring=#%s "--------------------------------------------- setlocal include=\\<\\(use\\\|require\\)\\> setlocal includeexpr=substitute(v:fname,'::','/','g') -setlocal suffixesadd=.pm6,.pm,.raku,.rakutest,.t6 +setlocal suffixesadd=.rakumod,.rakudoc,.pm6,.pm setlocal define=[^A-Za-z_] " The following line changes a global variable but is necessary to make @@ -42,39 +42,23 @@ setlocal define=[^A-Za-z_] set isfname+=: setlocal iskeyword=@,48-57,_,192-255,- -" Set this once, globally. -if !exists("perlpath") - if executable("perl6") - try - if &shellxquote != '"' - let perlpath = system('perl6 -e "@*INC.join(q/,/).say"') - else - let perlpath = system("perl6 -e '@*INC.join(q/,/).say'") - endif - let perlpath = substitute(perlpath,',.$',',,','') - catch /E145:/ - let perlpath = ".,," - endtry - else - " If we can't call perl to get its path, just default to using the - " current directory and the directory of the current file. - let perlpath = ".,," - endif -endif +" Raku exposes its CompUnits through $*REPO, but mapping module names to +" compunit paths is nontrivial. Probably it's more convenient to rely on +" people using zef, which has a handy store of sources for modules it has +" installed. +func s:compareReverseFtime(a, b) + let atime = getftime(a:a) + let btime = getftime(a:b) + return atime > btime ? -1 : atime == btime ? 0 : 1 +endfunc -" Append perlpath to the existing path value, if it is set. Since we don't -" use += to do it because of the commas in perlpath, we have to handle the -" global / local settings, too. -if &l:path == "" - if &g:path == "" - let &l:path=perlpath - else - let &l:path=&g:path.",".perlpath - endif -else - let &l:path=&l:path.",".perlpath +let &l:path = "lib,." +if exists('$RAKULIB') + let &l:path = &l:path . "," . $RAKULIB endif -"--------------------------------------------- +let &l:path = &l:path . "," . join( + \ sort(glob("~/.zef/store/*/*/lib", 0, 1), "s:compareReverseFtime"), + \ ',') " Convert ascii-based ops into their single-character unicode equivalent if get(g:, 'raku_unicode_abbrevs', 0) diff --git a/ftplugin/zig.vim b/ftplugin/zig.vim index cb2f3e84..ee5ce79e 100644 --- a/ftplugin/zig.vim +++ b/ftplugin/zig.vim @@ -47,8 +47,10 @@ if exists("*json_decode") && executable('zig') unlet! s:env endif +let &l:formatprg = 'zig fmt --stdin' + let b:undo_ftplugin = - \ 'setl isk< et< ts< sts< sw< fo< sua< mp< com< cms< inex< inc< pa<' + \ 'setl isk< et< ts< sts< sw< fo< sua< mp< com< cms< inex< inc< pa< fp<' let &cpo = s:cpo_orig unlet s:cpo_orig -- cgit v1.2.3