summaryrefslogtreecommitdiffstats
path: root/runtime/ftplugin
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-04-20 19:52:53 +0200
committerBram Moolenaar <Bram@vim.org>2020-04-20 19:52:53 +0200
commit2c7f8c574f1f8723d59adca3fec8fb89c41cf8c9 (patch)
treec6ab196227058f59ad6f4cf0dbe1e782b7b715e6 /runtime/ftplugin
parent2c5ed4e3300378ce76c8d9c3818d6f73e5119f68 (diff)
Update runtime files
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r--runtime/ftplugin/fortran.vim7
-rw-r--r--runtime/ftplugin/perl.vim6
-rw-r--r--runtime/ftplugin/perl6.vim6
-rw-r--r--runtime/ftplugin/systemd.vim36
4 files changed, 45 insertions, 10 deletions
diff --git a/runtime/ftplugin/fortran.vim b/runtime/ftplugin/fortran.vim
index 5d42409fd4..385f1557de 100644
--- a/runtime/ftplugin/fortran.vim
+++ b/runtime/ftplugin/fortran.vim
@@ -1,7 +1,8 @@
" Vim settings file
" Language: Fortran 2008 (and older: Fortran 2003, 95, 90, 77, 66)
" Version: 0.50
-" Last Change: 2015 Nov. 30
+" Last Change: 2020 Apr 20
+" Patched By: Eisuke Kawashima
" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www2.unb.ca/~ajit/>
" Usage: For instructions, do :help fortran-plugin from Vim
" Credits:
@@ -31,10 +32,10 @@ if !exists("b:fortran_fixed_source")
elseif exists("fortran_fixed_source")
" User guarantees fixed source form
let b:fortran_fixed_source = 1
- elseif expand("%:e") ==? "f\<90\|95\|03\|08\>"
+ elseif expand("%:e") =~? '^f\%(90\|95\|03\|08\)$'
" Free-form file extension defaults as in Intel ifort, gcc(gfortran), NAG, Pathscale, and Cray compilers
let b:fortran_fixed_source = 0
- elseif expand("%:e") ==? "f\|f77\|for"
+ elseif expand("%:e") =~? '^\%(f\|f77\|for\)$'
" Fixed-form file extension defaults
let b:fortran_fixed_source = 1
else
diff --git a/runtime/ftplugin/perl.vim b/runtime/ftplugin/perl.vim
index e7acf654f3..603ba49502 100644
--- a/runtime/ftplugin/perl.vim
+++ b/runtime/ftplugin/perl.vim
@@ -1,9 +1,9 @@
" Vim filetype plugin file
" Language: Perl
" Maintainer: vim-perl <vim-perl@googlegroups.com>
-" Homepage: http://github.com/vim-perl/vim-perl
-" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
-" Last Change: 2015-02-09
+" Homepage: https://github.com/vim-perl/vim-perl
+" Bugs/requests: https://github.com/vim-perl/vim-perl/issues
+" Last Change: 2020 Apr 15
if exists("b:did_ftplugin") | finish | endif
let b:did_ftplugin = 1
diff --git a/runtime/ftplugin/perl6.vim b/runtime/ftplugin/perl6.vim
index 5318df63bc..0467bea0c2 100644
--- a/runtime/ftplugin/perl6.vim
+++ b/runtime/ftplugin/perl6.vim
@@ -1,9 +1,9 @@
" Vim filetype plugin file
" Language: Perl 6
" Maintainer: vim-perl <vim-perl@googlegroups.com>
-" Homepage: http://github.com/vim-perl/vim-perl
-" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
-" Last Change: 2013-07-21
+" Homepage: https://github.com/vim-perl/vim-perl
+" Bugs/requests: https://github.com/vim-perl/vim-perl/issues
+" Last Change: 2020 Apr 15
" Contributors: Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
"
" Based on ftplugin/perl.vim by Dan Sharp <dwsharp at hotmail dot com>
diff --git a/runtime/ftplugin/systemd.vim b/runtime/ftplugin/systemd.vim
index 60b3fd996d..4c5c9a1dc1 100644
--- a/runtime/ftplugin/systemd.vim
+++ b/runtime/ftplugin/systemd.vim
@@ -1,7 +1,41 @@
" Vim filetype plugin file
-" Language: systemd.unit(5)
+" Language: systemd.unit(5)
+" Keyword Lookup Support: Enno Nagel <enno.nagel+vim@gmail.com>
if !exists('b:did_ftplugin')
" Looks a lot like dosini files.
runtime! ftplugin/dosini.vim
endif
+
+if !has('unix')
+ finish
+endif
+
+if !has('gui_running')
+ command! -buffer -nargs=1 Sman silent exe '!' . KeywordLookup_systemd(<q-args>) | redraw!
+elseif has('terminal')
+ command! -buffer -nargs=1 Sman silent exe 'term ' . KeywordLookup_systemd(<q-args>)
+else
+ finish
+endif
+
+if !exists('*KeywordLookup_systemd')
+ function KeywordLookup_systemd(keyword) abort
+ let matches = matchlist(getline(search('\v^\s*\[\s*.+\s*\]\s*$', 'nbWz')), '\v^\s*\[\s*(\k+).*\]\s*$')
+ if len(matches) > 1
+ let section = matches[1]
+ return 'LESS= MANPAGER="less --pattern=''(^|,)\s+' . a:keyword . '=$'' --hilite-search" man ' . 'systemd.' . section
+ else
+ return 'LESS= MANPAGER="less --pattern=''(^|,)\s+' . a:keyword . '=$'' --hilite-search" man ' . 'systemd'
+ endif
+ endfunction
+endif
+
+setlocal iskeyword+=-
+setlocal keywordprg=:Sman
+
+if !exists('b:undo_ftplugin') || empty(b:undo_ftplugin)
+ let b:undo_ftplugin = 'setlocal keywordprg< iskeyword<'
+else
+ let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<'
+endif