Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- git/usr/share/vim/vim92/ftplugin/remind.vim +14 -0
- git/usr/share/vim/vim92/ftplugin/requirements.vim +47 -0
- git/usr/share/vim/vim92/ftplugin/rescript.vim +13 -0
- git/usr/share/vim/vim92/ftplugin/reva.vim +28 -0
- git/usr/share/vim/vim92/ftplugin/rhelp.vim +35 -0
- git/usr/share/vim/vim92/ftplugin/rmd.vim +87 -0
- git/usr/share/vim/vim92/ftplugin/rnc.vim +19 -0
- git/usr/share/vim/vim92/ftplugin/rnoweb.vim +63 -0
- git/usr/share/vim/vim92/ftplugin/roc.vim +14 -0
- git/usr/share/vim/vim92/ftplugin/routeros.vim +34 -0
- git/usr/share/vim/vim92/ftplugin/rpl.vim +23 -0
- git/usr/share/vim/vim92/ftplugin/rrst.vim +61 -0
- git/usr/share/vim/vim92/ftplugin/rst.vim +52 -0
- git/usr/share/vim/vim92/ftplugin/ruby.vim +461 -0
- git/usr/share/vim/vim92/ftplugin/rust.vim +243 -0
- git/usr/share/vim/vim92/ftplugin/samba.vim +14 -0
- git/usr/share/vim/vim92/ftplugin/sass.vim +42 -0
- git/usr/share/vim/vim92/ftplugin/sbt.vim +14 -0
- git/usr/share/vim/vim92/ftplugin/scala.vim +38 -0
- git/usr/share/vim/vim92/ftplugin/scdoc.vim +23 -0
- git/usr/share/vim/vim92/ftplugin/scheme.vim +61 -0
- git/usr/share/vim/vim92/ftplugin/screen.vim +19 -0
- git/usr/share/vim/vim92/ftplugin/scss.vim +13 -0
- git/usr/share/vim/vim92/ftplugin/sed.vim +33 -0
- git/usr/share/vim/vim92/ftplugin/sensors.vim +19 -0
- git/usr/share/vim/vim92/ftplugin/services.vim +19 -0
- git/usr/share/vim/vim92/ftplugin/setserial.vim +19 -0
- git/usr/share/vim/vim92/ftplugin/sexplib.vim +18 -0
- git/usr/share/vim/vim92/ftplugin/sgml.vim +47 -0
- git/usr/share/vim/vim92/ftplugin/sh.vim +80 -0
- git/usr/share/vim/vim92/ftplugin/shaderslang.vim +54 -0
- git/usr/share/vim/vim92/ftplugin/sieve.vim +23 -0
- git/usr/share/vim/vim92/ftplugin/skhd.vim +20 -0
- git/usr/share/vim/vim92/ftplugin/slint.vim +15 -0
- git/usr/share/vim/vim92/ftplugin/slpconf.vim +20 -0
- git/usr/share/vim/vim92/ftplugin/slpreg.vim +20 -0
- git/usr/share/vim/vim92/ftplugin/slpspi.vim +20 -0
- git/usr/share/vim/vim92/ftplugin/sml.vim +41 -0
- git/usr/share/vim/vim92/ftplugin/snakemake.vim +13 -0
- git/usr/share/vim/vim92/ftplugin/solidity.vim +15 -0
- git/usr/share/vim/vim92/ftplugin/solution.vim +41 -0
- git/usr/share/vim/vim92/ftplugin/soy.vim +14 -0
- git/usr/share/vim/vim92/ftplugin/spajson.vim +14 -0
- git/usr/share/vim/vim92/ftplugin/spec.vim +225 -0
- git/usr/share/vim/vim92/ftplugin/sql.vim +550 -0
- git/usr/share/vim/vim92/ftplugin/squirrel.vim +17 -0
- git/usr/share/vim/vim92/ftplugin/ssa.vim +13 -0
- git/usr/share/vim/vim92/ftplugin/sshconfig.vim +27 -0
- git/usr/share/vim/vim92/ftplugin/sshdconfig.vim +10 -0
- git/usr/share/vim/vim92/ftplugin/stylus.vim +54 -0
git/usr/share/vim/vim92/ftplugin/remind.vim
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: Remind - a sophisticated calendar and alarm
|
| 3 |
+
" Maintainer: Joe Reynolds <joereynolds952@gmail.com>
|
| 4 |
+
" Latest Revision: 2025 April 08
|
| 5 |
+
" License: Vim (see :h license)
|
| 6 |
+
|
| 7 |
+
if exists("b:did_ftplugin")
|
| 8 |
+
finish
|
| 9 |
+
endif
|
| 10 |
+
let b:did_ftplugin = 1
|
| 11 |
+
|
| 12 |
+
setlocal comments=:# commentstring=#\ %s
|
| 13 |
+
|
| 14 |
+
let b:undo_ftplugin = "setl cms< com<"
|
git/usr/share/vim/vim92/ftplugin/requirements.vim
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" the Requirements File Format syntax support for Vim
|
| 2 |
+
" Version: 1.8.0
|
| 3 |
+
" Author: raimon <raimon49@hotmail.com>
|
| 4 |
+
" Upstream: https://github.com/raimon49/requirements.txt.vim
|
| 5 |
+
" License: MIT LICENSE
|
| 6 |
+
" The MIT License (MIT)
|
| 7 |
+
"
|
| 8 |
+
" Copyright (c) 2015 raimon
|
| 9 |
+
"
|
| 10 |
+
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 11 |
+
" of this software and associated documentation files (the "Software"), to deal
|
| 12 |
+
" in the Software without restriction, including without limitation the rights
|
| 13 |
+
" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 14 |
+
" copies of the Software, and to permit persons to whom the Software is
|
| 15 |
+
" furnished to do so, subject to the following conditions:
|
| 16 |
+
"
|
| 17 |
+
" The above copyright notice and this permission notice shall be included in all
|
| 18 |
+
" copies or substantial portions of the Software.
|
| 19 |
+
"
|
| 20 |
+
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 21 |
+
" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 22 |
+
" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 23 |
+
" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 24 |
+
" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 25 |
+
" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 26 |
+
" SOFTWARE.
|
| 27 |
+
if exists("b:did_ftplugin")
|
| 28 |
+
finish
|
| 29 |
+
endif
|
| 30 |
+
let b:did_ftplugin = 1
|
| 31 |
+
|
| 32 |
+
let s:save_cpoptions = &cpoptions
|
| 33 |
+
set cpoptions&vim
|
| 34 |
+
|
| 35 |
+
let b:undo_ftplugin = "setl iskeyword< commentstring<"
|
| 36 |
+
" pip options contain "-"
|
| 37 |
+
setlocal iskeyword+=-
|
| 38 |
+
setlocal commentstring=#\ %s
|
| 39 |
+
|
| 40 |
+
if !exists('current_compiler')
|
| 41 |
+
let b:undo_ftplugin ..= "| compiler make"
|
| 42 |
+
compiler pip_compile
|
| 43 |
+
endif
|
| 44 |
+
|
| 45 |
+
let &cpoptions = s:save_cpoptions
|
| 46 |
+
unlet s:save_cpoptions
|
| 47 |
+
" vim: et sw=4 ts=4 sts=4:
|
git/usr/share/vim/vim92/ftplugin/rescript.vim
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin
|
| 2 |
+
" Language: rescript
|
| 3 |
+
" Maintainer: Riley Bruins <ribru17@gmail.com>
|
| 4 |
+
" Last Change: 2024 May 21
|
| 5 |
+
|
| 6 |
+
if exists('b:did_ftplugin')
|
| 7 |
+
finish
|
| 8 |
+
endif
|
| 9 |
+
let b:did_ftplugin = 1
|
| 10 |
+
|
| 11 |
+
setl comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// commentstring=//\ %s
|
| 12 |
+
|
| 13 |
+
let b:undo_ftplugin = 'setl com< cms<'
|
git/usr/share/vim/vim92/ftplugin/reva.vim
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim ftplugin file
|
| 2 |
+
" Language: Reva Forth
|
| 3 |
+
" Version: 7.1
|
| 4 |
+
" Last Change: 2025 Jun 08
|
| 5 |
+
" Maintainer: Ron Aaron <ron@ronware.org>
|
| 6 |
+
" URL: https://github.com/ronaaron/reva
|
| 7 |
+
" Filetypes: *.rf *.frt
|
| 8 |
+
" NOTE: Forth allows any non-whitespace in a name, so you need to do:
|
| 9 |
+
" setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255
|
| 10 |
+
"
|
| 11 |
+
" This goes with the syntax/reva.vim file.
|
| 12 |
+
|
| 13 |
+
" Only do this when not done yet for this buffer
|
| 14 |
+
if exists("b:did_ftplugin")
|
| 15 |
+
finish
|
| 16 |
+
endif
|
| 17 |
+
|
| 18 |
+
" Don't load another plugin for this buffer
|
| 19 |
+
let b:did_ftplugin = 1
|
| 20 |
+
|
| 21 |
+
setlocal sts=4 sw=4
|
| 22 |
+
setlocal com=s1:/*,mb:*,ex:*/,:\|,:\\
|
| 23 |
+
setlocal cms=//\ %s
|
| 24 |
+
setlocal fo=tcrqol
|
| 25 |
+
setlocal matchpairs+=\::;
|
| 26 |
+
setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255
|
| 27 |
+
|
| 28 |
+
let b:undo_ftplugin = "setlocal sts< sw< com< cms< fo< mps< isk<"
|
git/usr/share/vim/vim92/ftplugin/rhelp.vim
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: R help file
|
| 3 |
+
" Maintainer: This runtime file is looking for a new maintainer.
|
| 4 |
+
" Former Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
|
| 5 |
+
" Former Repository: https://github.com/jalvesaq/R-Vim-runtime
|
| 6 |
+
" Last Change: 2024 Feb 28 by Vim Project
|
| 7 |
+
|
| 8 |
+
" Only do this when not yet done for this buffer
|
| 9 |
+
if exists("b:did_ftplugin")
|
| 10 |
+
finish
|
| 11 |
+
endif
|
| 12 |
+
|
| 13 |
+
" Don't load another plugin for this buffer
|
| 14 |
+
let b:did_ftplugin = 1
|
| 15 |
+
|
| 16 |
+
let s:cpo_save = &cpo
|
| 17 |
+
set cpo&vim
|
| 18 |
+
|
| 19 |
+
setlocal iskeyword=@,48-57,_,.
|
| 20 |
+
|
| 21 |
+
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
| 22 |
+
let b:browsefilter = "R Source Files (*.R, *.Rnw, *.Rd, *.Rmd, *.Rrst, *.qmd)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst;*.qmd\n"
|
| 23 |
+
if has("win32")
|
| 24 |
+
let b:browsefilter .= "All Files (*.*)\t*\n"
|
| 25 |
+
else
|
| 26 |
+
let b:browsefilter .= "All Files (*)\t*\n"
|
| 27 |
+
endif
|
| 28 |
+
endif
|
| 29 |
+
|
| 30 |
+
let b:undo_ftplugin = "setl isk< | unlet! b:browsefilter"
|
| 31 |
+
|
| 32 |
+
let &cpo = s:cpo_save
|
| 33 |
+
unlet s:cpo_save
|
| 34 |
+
|
| 35 |
+
" vim: sw=2
|
git/usr/share/vim/vim92/ftplugin/rmd.vim
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: R Markdown file
|
| 3 |
+
" Maintainer: This runtime file is looking for a new maintainer.
|
| 4 |
+
" Former Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
|
| 5 |
+
" Former Repository: https://github.com/jalvesaq/R-Vim-runtime
|
| 6 |
+
" Last Change:
|
| 7 |
+
" 2024 Feb 28 by Vim Project
|
| 8 |
+
" 2024 Sep 23 by Vim Project: properly restore fex option
|
| 9 |
+
" Original work by Alex Zvoleff (adjusted from R help for rmd by Michel Kuhlmann)
|
| 10 |
+
|
| 11 |
+
" Only do this when not yet done for this buffer
|
| 12 |
+
if exists("b:did_ftplugin")
|
| 13 |
+
finish
|
| 14 |
+
endif
|
| 15 |
+
|
| 16 |
+
if exists('g:rmd_include_html') && g:rmd_include_html
|
| 17 |
+
runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
|
| 18 |
+
endif
|
| 19 |
+
|
| 20 |
+
setlocal comments=fb:*,fb:-,fb:+,n:>
|
| 21 |
+
setlocal commentstring=#\ %s
|
| 22 |
+
setlocal formatoptions+=tcqln
|
| 23 |
+
setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+
|
| 24 |
+
setlocal iskeyword=@,48-57,_,.
|
| 25 |
+
|
| 26 |
+
let s:cpo_save = &cpo
|
| 27 |
+
set cpo&vim
|
| 28 |
+
|
| 29 |
+
function FormatRmd()
|
| 30 |
+
if search("^[ \t]*```[ ]*{r", "bncW") > search("^[ \t]*```$", "bncW")
|
| 31 |
+
setlocal comments=:#',:###,:##,:#
|
| 32 |
+
else
|
| 33 |
+
setlocal comments=fb:*,fb:-,fb:+,n:>
|
| 34 |
+
endif
|
| 35 |
+
return 1
|
| 36 |
+
endfunction
|
| 37 |
+
|
| 38 |
+
let s:last_line = 0
|
| 39 |
+
function SetRmdCommentStr()
|
| 40 |
+
if line('.') == s:last_line
|
| 41 |
+
return
|
| 42 |
+
endif
|
| 43 |
+
let s:last_line = line('.')
|
| 44 |
+
|
| 45 |
+
if (search("^[ \t]*```[ ]*{r", "bncW") > search("^[ \t]*```$", "bncW")) || ((search('^---$', 'Wn') || search('^\.\.\.$', 'Wn')) && search('^---$', 'bnW'))
|
| 46 |
+
set commentstring=#\ %s
|
| 47 |
+
else
|
| 48 |
+
set commentstring=<!--\ %s\ -->
|
| 49 |
+
endif
|
| 50 |
+
endfunction
|
| 51 |
+
|
| 52 |
+
" If you do not want both 'comments' and 'commentstring' dynamically defined,
|
| 53 |
+
" put in your vimrc: let g:rmd_dynamic_comments = 0
|
| 54 |
+
if !exists("g:rmd_dynamic_comments") || (exists("g:rmd_dynamic_comments") && g:rmd_dynamic_comments == 1)
|
| 55 |
+
setlocal formatexpr=FormatRmd()
|
| 56 |
+
augroup RmdCStr
|
| 57 |
+
autocmd!
|
| 58 |
+
autocmd CursorMoved <buffer> call SetRmdCommentStr()
|
| 59 |
+
augroup END
|
| 60 |
+
endif
|
| 61 |
+
|
| 62 |
+
" Enables pandoc if it is installed
|
| 63 |
+
unlet! b:did_ftplugin
|
| 64 |
+
runtime ftplugin/pandoc.vim
|
| 65 |
+
|
| 66 |
+
" Don't load another plugin for this buffer
|
| 67 |
+
let b:did_ftplugin = 1
|
| 68 |
+
|
| 69 |
+
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
| 70 |
+
let b:browsefilter = "R Source Files (*.R, *.Rnw, *.Rd, *.Rmd, *.Rrst, *.qmd)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst;*.qmd\n"
|
| 71 |
+
if has("win32")
|
| 72 |
+
let b:browsefilter .= "All Files (*.*)\t*\n"
|
| 73 |
+
else
|
| 74 |
+
let b:browsefilter .= "All Files (*)\t*\n"
|
| 75 |
+
endif
|
| 76 |
+
endif
|
| 77 |
+
|
| 78 |
+
if exists('b:undo_ftplugin')
|
| 79 |
+
let b:undo_ftplugin .= " | setl cms< com< fo< flp< isk< fex< | unlet! b:browsefilter"
|
| 80 |
+
else
|
| 81 |
+
let b:undo_ftplugin = "setl cms< com< fo< flp< isk< fex< | unlet! b:browsefilter"
|
| 82 |
+
endif
|
| 83 |
+
|
| 84 |
+
let &cpo = s:cpo_save
|
| 85 |
+
unlet s:cpo_save
|
| 86 |
+
|
| 87 |
+
" vim: sw=2
|
git/usr/share/vim/vim92/ftplugin/rnc.vim
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: Relax NG compact syntax
|
| 3 |
+
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
| 4 |
+
" Latest Revision: 2008-07-09
|
| 5 |
+
|
| 6 |
+
if exists("b:did_ftplugin")
|
| 7 |
+
finish
|
| 8 |
+
endif
|
| 9 |
+
let b:did_ftplugin = 1
|
| 10 |
+
|
| 11 |
+
let s:cpo_save = &cpo
|
| 12 |
+
set cpo&vim
|
| 13 |
+
|
| 14 |
+
let b:undo_ftplugin = "setl com< cms< fo<"
|
| 15 |
+
|
| 16 |
+
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
|
| 17 |
+
|
| 18 |
+
let &cpo = s:cpo_save
|
| 19 |
+
unlet s:cpo_save
|
git/usr/share/vim/vim92/ftplugin/rnoweb.vim
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: Rnoweb
|
| 3 |
+
" Maintainer: This runtime file is looking for a new maintainer.
|
| 4 |
+
" Former Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
|
| 5 |
+
" Former Repository: https://github.com/jalvesaq/R-Vim-runtime
|
| 6 |
+
" Last Change: 2024 Feb 28 by Vim Project
|
| 7 |
+
|
| 8 |
+
" Only do this when not yet done for this buffer
|
| 9 |
+
if exists("b:did_ftplugin")
|
| 10 |
+
finish
|
| 11 |
+
endif
|
| 12 |
+
|
| 13 |
+
let s:cpo_save = &cpo
|
| 14 |
+
set cpo&vim
|
| 15 |
+
|
| 16 |
+
runtime! ftplugin/tex.vim
|
| 17 |
+
|
| 18 |
+
" Don't load another plugin for this buffer
|
| 19 |
+
let b:did_ftplugin = 1
|
| 20 |
+
|
| 21 |
+
" Enables Vim-Latex-Suite, LaTeX-Box if installed
|
| 22 |
+
runtime ftplugin/tex_*.vim
|
| 23 |
+
|
| 24 |
+
setlocal iskeyword=@,48-57,_,.
|
| 25 |
+
setlocal suffixesadd=.bib,.tex
|
| 26 |
+
setlocal comments=b:%,b:#,b:##,b:###,b:#'
|
| 27 |
+
|
| 28 |
+
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
| 29 |
+
let b:browsefilter = "R Source Files (*.R, *.Rnw, *.Rd, *.Rmd, *.Rrst, *.qmd)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst;*.qmd\n"
|
| 30 |
+
if has("win32")
|
| 31 |
+
let b:browsefilter .= "All Files (*.*)\t*\n"
|
| 32 |
+
else
|
| 33 |
+
let b:browsefilter .= "All Files (*)\t*\n"
|
| 34 |
+
endif
|
| 35 |
+
endif
|
| 36 |
+
|
| 37 |
+
function SetRnwCommentStr()
|
| 38 |
+
if (search("^\s*<<.*>>=", "bncW") > search("^@", "bncW"))
|
| 39 |
+
set commentstring=#\ %s
|
| 40 |
+
else
|
| 41 |
+
set commentstring=%\ %s
|
| 42 |
+
endif
|
| 43 |
+
endfunction
|
| 44 |
+
|
| 45 |
+
" If you do not want both 'comments' and 'commentstring' dynamically defined,
|
| 46 |
+
" put in your vimrc: let g:rnw_dynamic_comments = 0
|
| 47 |
+
if !exists("g:rnw_dynamic_comments") || (exists("g:rnw_dynamic_comments") && g:rnw_dynamic_comments == 1)
|
| 48 |
+
augroup RnwCStr
|
| 49 |
+
autocmd!
|
| 50 |
+
autocmd CursorMoved <buffer> call SetRnwCommentStr()
|
| 51 |
+
augroup END
|
| 52 |
+
endif
|
| 53 |
+
|
| 54 |
+
if exists('b:undo_ftplugin')
|
| 55 |
+
let b:undo_ftplugin .= " | setl isk< sua< com< cms< | unlet! b:browsefilter"
|
| 56 |
+
else
|
| 57 |
+
let b:undo_ftplugin = "setl isk< sua< com< cms< | unlet! b:browsefilter"
|
| 58 |
+
endif
|
| 59 |
+
|
| 60 |
+
let &cpo = s:cpo_save
|
| 61 |
+
unlet s:cpo_save
|
| 62 |
+
|
| 63 |
+
" vim: sw=2
|
git/usr/share/vim/vim92/ftplugin/roc.vim
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Roc filetype plugin file
|
| 2 |
+
" Language: Roc
|
| 3 |
+
" Maintainer: nat-418 <93013864+nat-418@users.noreply.github.com>
|
| 4 |
+
" Latest Revision: 2024-04-5
|
| 5 |
+
|
| 6 |
+
if exists("b:did_ftplugin")
|
| 7 |
+
finish
|
| 8 |
+
endif
|
| 9 |
+
let b:did_ftplugin = 1
|
| 10 |
+
|
| 11 |
+
setlocal comments=:##,:#
|
| 12 |
+
setlocal commentstring=#\ %s
|
| 13 |
+
|
| 14 |
+
let b:undo_ftplugin = "setl com< cms<"
|
git/usr/share/vim/vim92/ftplugin/routeros.vim
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: MikroTik RouterOS Script
|
| 3 |
+
" Maintainer: zainin <z@wintr.dev>
|
| 4 |
+
" Last Change: 2021 Nov 14
|
| 5 |
+
" 2024 Jan 14 by Vim Project (browsefilter)
|
| 6 |
+
|
| 7 |
+
if exists("b:did_ftplugin")
|
| 8 |
+
finish
|
| 9 |
+
endif
|
| 10 |
+
let b:did_ftplugin = 1
|
| 11 |
+
|
| 12 |
+
let s:save_cpo = &cpo
|
| 13 |
+
set cpo-=C
|
| 14 |
+
|
| 15 |
+
setlocal comments=:#
|
| 16 |
+
setlocal commentstring=#\ %s
|
| 17 |
+
setlocal formatoptions-=t formatoptions+=croql
|
| 18 |
+
|
| 19 |
+
let b:undo_ftplugin = "setlocal com< cms< fo<"
|
| 20 |
+
|
| 21 |
+
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
| 22 |
+
let b:browsefilter = "RouterOS Script Files (*.rsc)\t*.rsc\n"
|
| 23 |
+
if has("win32")
|
| 24 |
+
let b:browsefilter ..= "All Files (*.*)\t*\n"
|
| 25 |
+
else
|
| 26 |
+
let b:browsefilter ..= "All Files (*)\t*\n"
|
| 27 |
+
endif
|
| 28 |
+
let b:undo_ftplugin ..= " | unlet! b:browsefilter"
|
| 29 |
+
endif
|
| 30 |
+
|
| 31 |
+
let &cpo = s:save_cpo
|
| 32 |
+
unlet! s:save_cpo
|
| 33 |
+
|
| 34 |
+
" vim: nowrap sw=2 sts=2 ts=8 noet:
|
git/usr/share/vim/vim92/ftplugin/rpl.vim
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: RPL/2
|
| 3 |
+
" Maintainer: Joël BERTRAND <rpl2@free.fr>
|
| 4 |
+
" Last Change: 2025 Jun 08
|
| 5 |
+
" Version: 0.1
|
| 6 |
+
|
| 7 |
+
" Only do this when not done yet for this buffer
|
| 8 |
+
if exists("b:did_ftplugin")
|
| 9 |
+
finish
|
| 10 |
+
endif
|
| 11 |
+
|
| 12 |
+
" Don't load another plugin for this buffer
|
| 13 |
+
let b:did_ftplugin = 1
|
| 14 |
+
|
| 15 |
+
" Set 'formatoptions' to break comment lines but not other lines,
|
| 16 |
+
" and insert the comment leader when hitting <CR> or using "o".
|
| 17 |
+
setlocal fo-=t fo+=croql
|
| 18 |
+
|
| 19 |
+
" Set 'comments' to format dashed lists in comments.
|
| 20 |
+
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
|
| 21 |
+
setlocal commentstring=//\ %s
|
| 22 |
+
|
| 23 |
+
let b:undo_ftplugin = "setlocal fo< comments< commentstring<"
|
git/usr/share/vim/vim92/ftplugin/rrst.vim
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: reStructuredText documentation format with R code
|
| 3 |
+
" Maintainer: This runtime file is looking for a new maintainer.
|
| 4 |
+
" Former Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
|
| 5 |
+
" Former Repository: https://github.com/jalvesaq/R-Vim-runtime
|
| 6 |
+
" Last Change:
|
| 7 |
+
" 2024 Feb 28 by Vim Project
|
| 8 |
+
" 2024 Sep 23 by Vim Project: properly restore fex option
|
| 9 |
+
" Original work by Alex Zvoleff
|
| 10 |
+
|
| 11 |
+
" Only do this when not yet done for this buffer
|
| 12 |
+
if exists("b:did_ftplugin")
|
| 13 |
+
finish
|
| 14 |
+
endif
|
| 15 |
+
|
| 16 |
+
" Don't load another plugin for this buffer
|
| 17 |
+
let b:did_ftplugin = 1
|
| 18 |
+
|
| 19 |
+
let s:cpo_save = &cpo
|
| 20 |
+
set cpo&vim
|
| 21 |
+
|
| 22 |
+
setlocal comments=fb:*,fb:-,fb:+,n:>
|
| 23 |
+
setlocal commentstring=#\ %s
|
| 24 |
+
setlocal formatoptions+=tcqln
|
| 25 |
+
setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+
|
| 26 |
+
setlocal iskeyword=@,48-57,_,.
|
| 27 |
+
|
| 28 |
+
function FormatRrst()
|
| 29 |
+
if search('^\.\. {r', "bncW") > search('^\.\. \.\.$', "bncW")
|
| 30 |
+
setlocal comments=:#',:###,:##,:#
|
| 31 |
+
else
|
| 32 |
+
setlocal comments=fb:*,fb:-,fb:+,n:>
|
| 33 |
+
endif
|
| 34 |
+
return 1
|
| 35 |
+
endfunction
|
| 36 |
+
|
| 37 |
+
" If you do not want 'comments' dynamically defined, put in your vimrc:
|
| 38 |
+
" let g:rrst_dynamic_comments = 0
|
| 39 |
+
if !exists("g:rrst_dynamic_comments") || (exists("g:rrst_dynamic_comments") && g:rrst_dynamic_comments == 1)
|
| 40 |
+
setlocal formatexpr=FormatRrst()
|
| 41 |
+
endif
|
| 42 |
+
|
| 43 |
+
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
| 44 |
+
let b:browsefilter = "R Source Files (*.R, *.Rnw, *.Rd, *.Rmd, *.Rrst, *.qmd)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst;*.qmd\n"
|
| 45 |
+
if has("win32")
|
| 46 |
+
let b:browsefilter .= "All Files (*.*)\t*\n"
|
| 47 |
+
else
|
| 48 |
+
let b:browsefilter .= "All Files (*)\t*\n"
|
| 49 |
+
endif
|
| 50 |
+
endif
|
| 51 |
+
|
| 52 |
+
if exists('b:undo_ftplugin')
|
| 53 |
+
let b:undo_ftplugin .= " | setl cms< com< fo< flp< isk< fex< | unlet! b:browsefilter"
|
| 54 |
+
else
|
| 55 |
+
let b:undo_ftplugin = "setl cms< com< fo< flp< isk< fex< | unlet! b:browsefilter"
|
| 56 |
+
endif
|
| 57 |
+
|
| 58 |
+
let &cpo = s:cpo_save
|
| 59 |
+
unlet s:cpo_save
|
| 60 |
+
|
| 61 |
+
" vim: sw=2
|
git/usr/share/vim/vim92/ftplugin/rst.vim
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" reStructuredText filetype plugin file
|
| 2 |
+
" Language: reStructuredText documentation format
|
| 3 |
+
" Maintainer: Marshall Ward <marshall.ward@gmail.com>
|
| 4 |
+
" Original Maintainer: Nikolai Weibull <now@bitwi.se>
|
| 5 |
+
" Website: https://github.com/marshallward/vim-restructuredtext
|
| 6 |
+
" Latest Revision: 2020-03-31
|
| 7 |
+
" 2025 Oct 13 by Vim project: update b:undo_ftplugin #18566
|
| 8 |
+
" 2026 Jan 11 by Vim project: set suffixesadd #19149
|
| 9 |
+
|
| 10 |
+
if exists("b:did_ftplugin")
|
| 11 |
+
finish
|
| 12 |
+
endif
|
| 13 |
+
let b:did_ftplugin = 1
|
| 14 |
+
|
| 15 |
+
let s:cpo_save = &cpo
|
| 16 |
+
set cpo&vim
|
| 17 |
+
|
| 18 |
+
"Disable folding
|
| 19 |
+
if !exists('g:rst_fold_enabled')
|
| 20 |
+
let g:rst_fold_enabled = 0
|
| 21 |
+
endif
|
| 22 |
+
|
| 23 |
+
let b:undo_ftplugin = "setlocal comments< commentstring< expandtab< formatoptions< suffixesadd<"
|
| 24 |
+
|
| 25 |
+
setlocal comments=fb:.. commentstring=..\ %s expandtab
|
| 26 |
+
setlocal formatoptions+=tcroql
|
| 27 |
+
setlocal suffixesadd=.rst
|
| 28 |
+
|
| 29 |
+
" reStructuredText standard recommends that tabs be expanded to 8 spaces
|
| 30 |
+
" The choice of 3-space indentation is to provide slightly better support for
|
| 31 |
+
" directives (..) and ordered lists (1.), although it can cause problems for
|
| 32 |
+
" many other cases.
|
| 33 |
+
"
|
| 34 |
+
" More sophisticated indentation rules should be revisited in the future.
|
| 35 |
+
|
| 36 |
+
if exists("g:rst_style") && g:rst_style != 0
|
| 37 |
+
setlocal expandtab shiftwidth=3 softtabstop=3 tabstop=8
|
| 38 |
+
let b:undo_ftplugin .= " | setlocal softtabstop< shiftwidth< tabstop<"
|
| 39 |
+
endif
|
| 40 |
+
|
| 41 |
+
if g:rst_fold_enabled != 0
|
| 42 |
+
setlocal foldmethod=expr
|
| 43 |
+
setlocal foldexpr=RstFold#GetRstFold()
|
| 44 |
+
setlocal foldtext=RstFold#GetRstFoldText()
|
| 45 |
+
augroup RstFold
|
| 46 |
+
autocmd TextChanged,InsertLeave <buffer> unlet! b:RstFoldCache
|
| 47 |
+
augroup END
|
| 48 |
+
let b:undo_ftplugin .= " | setlocal foldexpr< foldmethod< foldtext<"
|
| 49 |
+
endif
|
| 50 |
+
|
| 51 |
+
let &cpo = s:cpo_save
|
| 52 |
+
unlet s:cpo_save
|
git/usr/share/vim/vim92/ftplugin/ruby.vim
ADDED
|
@@ -0,0 +1,461 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin
|
| 2 |
+
" Language: Ruby
|
| 3 |
+
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
| 4 |
+
" URL: https://github.com/vim-ruby/vim-ruby
|
| 5 |
+
" Last Change: 2023 Dec 31
|
| 6 |
+
" 2024 Jan 14 by Vim Project (browsefilter)
|
| 7 |
+
|
| 8 |
+
if (exists("b:did_ftplugin"))
|
| 9 |
+
finish
|
| 10 |
+
endif
|
| 11 |
+
let b:did_ftplugin = 1
|
| 12 |
+
|
| 13 |
+
let s:cpo_save = &cpo
|
| 14 |
+
set cpo&vim
|
| 15 |
+
|
| 16 |
+
if has("gui_running") && !has("gui_win32")
|
| 17 |
+
setlocal keywordprg=ri\ -T\ -f\ bs
|
| 18 |
+
else
|
| 19 |
+
setlocal keywordprg=ri
|
| 20 |
+
endif
|
| 21 |
+
|
| 22 |
+
" Matchit support
|
| 23 |
+
if exists("loaded_matchit") && !exists("b:match_words")
|
| 24 |
+
let b:match_ignorecase = 0
|
| 25 |
+
|
| 26 |
+
let b:match_words =
|
| 27 |
+
\ '{\|\<\%(if\|unless\|case\|while\|until\|for\|do\|class\|module\|def\|=\@<!begin\)\>=\@!' .
|
| 28 |
+
\ ':' .
|
| 29 |
+
\ '\<\%(else\|elsif\|ensure\|when\|rescue\|break\|redo\|next\|retry\)\>' .
|
| 30 |
+
\ ':' .
|
| 31 |
+
\ '}\|\%(^\|[^.\:@$=]\)\@<=\<end\:\@!\>' .
|
| 32 |
+
\ ',^=begin\>:^=end\>,' .
|
| 33 |
+
\ ',\[:\],(:)'
|
| 34 |
+
|
| 35 |
+
let b:match_skip =
|
| 36 |
+
\ "synIDattr(synID(line('.'),col('.'),0),'name') =~ '" .
|
| 37 |
+
\ "\\<ruby\\%(String\\|.\+Delimiter\\|Character\\|.\+Escape\\|" .
|
| 38 |
+
\ "Regexp\\|Interpolation\\|Comment\\|Documentation\\|" .
|
| 39 |
+
\ "ConditionalModifier\\|RepeatModifier\\|RescueModifier\\|OptionalDo\\|" .
|
| 40 |
+
\ "MethodName\\|BlockArgument\\|KeywordAsMethod\\|ClassVariable\\|" .
|
| 41 |
+
\ "InstanceVariable\\|GlobalVariable\\|Symbol\\)\\>'"
|
| 42 |
+
endif
|
| 43 |
+
|
| 44 |
+
setlocal formatoptions-=t formatoptions+=croql
|
| 45 |
+
|
| 46 |
+
setlocal include=^\\s*\\<\\(load\\>\\\|require\\>\\\|autoload\\s*:\\=[\"']\\=\\h\\w*[\"']\\=,\\)
|
| 47 |
+
setlocal suffixesadd=.rb
|
| 48 |
+
|
| 49 |
+
if exists("&ofu") && has("ruby")
|
| 50 |
+
setlocal omnifunc=rubycomplete#Complete
|
| 51 |
+
endif
|
| 52 |
+
|
| 53 |
+
" TODO:
|
| 54 |
+
"setlocal define=^\\s*def
|
| 55 |
+
|
| 56 |
+
setlocal comments=b:#
|
| 57 |
+
setlocal commentstring=#\ %s
|
| 58 |
+
|
| 59 |
+
if !exists('g:ruby_version_paths')
|
| 60 |
+
let g:ruby_version_paths = {}
|
| 61 |
+
endif
|
| 62 |
+
|
| 63 |
+
let s:path_split = has('win32') ? ';' : ':'
|
| 64 |
+
|
| 65 |
+
function! s:query_path(root) abort
|
| 66 |
+
" Disabled by default for security reasons.
|
| 67 |
+
if !get(g:, 'ruby_exec', get(g:, 'plugin_exec', 0)) || empty(a:root)
|
| 68 |
+
return map(split($RUBYLIB, s:path_split), 'v:val ==# "." ? "" : v:val')
|
| 69 |
+
endif
|
| 70 |
+
let code = "print $:.join %q{,}"
|
| 71 |
+
if &shellxquote == "'"
|
| 72 |
+
let args = ' --disable-gems -e "' . code . '"'
|
| 73 |
+
else
|
| 74 |
+
let args = " --disable-gems -e '" . code . "'"
|
| 75 |
+
endif
|
| 76 |
+
|
| 77 |
+
let cd = haslocaldir() ? 'lcd' : exists(':tcd') && haslocaldir(-1) ? 'tcd' : 'cd'
|
| 78 |
+
let cwd = fnameescape(getcwd())
|
| 79 |
+
try
|
| 80 |
+
exe cd fnameescape(a:root)
|
| 81 |
+
for dir in split($PATH, s:path_split)
|
| 82 |
+
if dir !=# '.' && executable(dir . '/ruby') == 1
|
| 83 |
+
let exepath = dir . '/ruby'
|
| 84 |
+
break
|
| 85 |
+
endif
|
| 86 |
+
endfor
|
| 87 |
+
if exists('l:exepath')
|
| 88 |
+
let path = split(system(exepath . args),',')
|
| 89 |
+
if v:shell_error
|
| 90 |
+
let path = []
|
| 91 |
+
endif
|
| 92 |
+
else
|
| 93 |
+
let path = []
|
| 94 |
+
endif
|
| 95 |
+
exe cd cwd
|
| 96 |
+
return path
|
| 97 |
+
finally
|
| 98 |
+
exe cd cwd
|
| 99 |
+
endtry
|
| 100 |
+
endfunction
|
| 101 |
+
|
| 102 |
+
function! s:build_path(path) abort
|
| 103 |
+
let path = join(map(copy(a:path), 'v:val ==# "." ? "" : v:val'), ',')
|
| 104 |
+
if &g:path =~# '\v^%(\.,)=%(/%(usr|emx)/include,)=,$'
|
| 105 |
+
let path = path . ',.,,'
|
| 106 |
+
elseif &g:path =~# ',\.,,$'
|
| 107 |
+
let path = &g:path[0:-4] . path . ',.,,'
|
| 108 |
+
elseif &g:path =~# ',,$'
|
| 109 |
+
let path = &g:path[0:-2] . path . ',,'
|
| 110 |
+
else
|
| 111 |
+
let path = substitute(&g:path, '[^,]\zs$', ',', '') . path
|
| 112 |
+
endif
|
| 113 |
+
return path
|
| 114 |
+
endfunction
|
| 115 |
+
|
| 116 |
+
if !exists('b:ruby_version') && !exists('g:ruby_path') && isdirectory(expand('%:p:h'))
|
| 117 |
+
let s:version_file = findfile('.ruby-version', '.;')
|
| 118 |
+
if !empty(s:version_file) && filereadable(s:version_file)
|
| 119 |
+
let b:ruby_version = get(readfile(s:version_file, '', 1), '')
|
| 120 |
+
if !has_key(g:ruby_version_paths, b:ruby_version)
|
| 121 |
+
let g:ruby_version_paths[b:ruby_version] = s:query_path(fnamemodify(s:version_file, ':p:h'))
|
| 122 |
+
endif
|
| 123 |
+
endif
|
| 124 |
+
endif
|
| 125 |
+
|
| 126 |
+
if exists("g:ruby_path")
|
| 127 |
+
let s:ruby_path = type(g:ruby_path) == type([]) ? join(g:ruby_path, ',') : g:ruby_path
|
| 128 |
+
elseif has_key(g:ruby_version_paths, get(b:, 'ruby_version', ''))
|
| 129 |
+
let s:ruby_paths = g:ruby_version_paths[b:ruby_version]
|
| 130 |
+
let s:ruby_path = s:build_path(s:ruby_paths)
|
| 131 |
+
else
|
| 132 |
+
if !exists('g:ruby_default_path')
|
| 133 |
+
if has("ruby") && has("win32")
|
| 134 |
+
ruby ::VIM::command( 'let g:ruby_default_path = split("%s",",")' % $:.join(%q{,}) )
|
| 135 |
+
else
|
| 136 |
+
let g:ruby_default_path = s:query_path($HOME)
|
| 137 |
+
endif
|
| 138 |
+
endif
|
| 139 |
+
let s:ruby_paths = g:ruby_default_path
|
| 140 |
+
let s:ruby_path = s:build_path(s:ruby_paths)
|
| 141 |
+
endif
|
| 142 |
+
|
| 143 |
+
if stridx(&l:path, s:ruby_path) == -1
|
| 144 |
+
let &l:path = s:ruby_path
|
| 145 |
+
endif
|
| 146 |
+
if exists('s:ruby_paths') && stridx(&l:tags, join(map(copy(s:ruby_paths),'v:val."/tags"'),',')) == -1
|
| 147 |
+
let &l:tags = &tags . ',' . join(map(copy(s:ruby_paths),'v:val."/tags"'),',')
|
| 148 |
+
endif
|
| 149 |
+
|
| 150 |
+
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
| 151 |
+
let b:browsefilter = "Ruby Source Files (*.rb)\t*.rb\n"
|
| 152 |
+
if has("win32")
|
| 153 |
+
let b:browsefilter .= "All Files (*.*)\t*\n"
|
| 154 |
+
else
|
| 155 |
+
let b:browsefilter .= "All Files (*)\t*\n"
|
| 156 |
+
endif
|
| 157 |
+
endif
|
| 158 |
+
|
| 159 |
+
let b:undo_ftplugin = "setl inc= sua= path= tags= fo< com< cms< kp="
|
| 160 |
+
\."| unlet! b:browsefilter b:match_ignorecase b:match_words b:match_skip"
|
| 161 |
+
\."| if exists('&ofu') && has('ruby') | setl ofu< | endif"
|
| 162 |
+
|
| 163 |
+
if get(g:, 'ruby_recommended_style', 1)
|
| 164 |
+
setlocal shiftwidth=2 softtabstop=2 expandtab
|
| 165 |
+
let b:undo_ftplugin .= ' | setl sw< sts< et<'
|
| 166 |
+
endif
|
| 167 |
+
|
| 168 |
+
" To activate, :set ballooneval
|
| 169 |
+
if exists('+balloonexpr') && get(g:, 'ruby_balloonexpr')
|
| 170 |
+
setlocal balloonexpr=RubyBalloonexpr()
|
| 171 |
+
let b:undo_ftplugin .= "| setl bexpr="
|
| 172 |
+
endif
|
| 173 |
+
|
| 174 |
+
function! s:map(mode, flags, map) abort
|
| 175 |
+
let from = matchstr(a:map, '\S\+')
|
| 176 |
+
if empty(mapcheck(from, a:mode))
|
| 177 |
+
exe a:mode.'map' '<buffer>' a:flags a:map
|
| 178 |
+
let b:undo_ftplugin .= '|sil! '.a:mode.'unmap <buffer> '.from
|
| 179 |
+
endif
|
| 180 |
+
endfunction
|
| 181 |
+
|
| 182 |
+
cmap <buffer><script><expr> <Plug><ctag> substitute(RubyCursorTag(),'^$',"\022\027",'')
|
| 183 |
+
cmap <buffer><script><expr> <Plug><cfile> substitute(RubyCursorFile(),'^$',"\022\006",'')
|
| 184 |
+
let b:undo_ftplugin .= "| sil! cunmap <buffer> <Plug><ctag>| sil! cunmap <buffer> <Plug><cfile>"
|
| 185 |
+
|
| 186 |
+
if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
|
| 187 |
+
nmap <buffer><script> <SID>: :<C-U>
|
| 188 |
+
nmap <buffer><script> <SID>c: :<C-U><C-R>=v:count ? v:count : ''<CR>
|
| 189 |
+
cmap <buffer> <SID><cfile> <Plug><cfile>
|
| 190 |
+
cmap <buffer> <SID><ctag> <Plug><ctag>
|
| 191 |
+
|
| 192 |
+
nnoremap <silent> <buffer> [m :<C-U>call <SID>searchsyn('\<def\>',['rubyDefine'],'b','n')<CR>
|
| 193 |
+
nnoremap <silent> <buffer> ]m :<C-U>call <SID>searchsyn('\<def\>',['rubyDefine'],'','n')<CR>
|
| 194 |
+
nnoremap <silent> <buffer> [M :<C-U>call <SID>searchsyn('\<end\>',['rubyDefine'],'b','n')<CR>
|
| 195 |
+
nnoremap <silent> <buffer> ]M :<C-U>call <SID>searchsyn('\<end\>',['rubyDefine'],'','n')<CR>
|
| 196 |
+
xnoremap <silent> <buffer> [m :<C-U>call <SID>searchsyn('\<def\>',['rubyDefine'],'b','v')<CR>
|
| 197 |
+
xnoremap <silent> <buffer> ]m :<C-U>call <SID>searchsyn('\<def\>',['rubyDefine'],'','v')<CR>
|
| 198 |
+
xnoremap <silent> <buffer> [M :<C-U>call <SID>searchsyn('\<end\>',['rubyDefine'],'b','v')<CR>
|
| 199 |
+
xnoremap <silent> <buffer> ]M :<C-U>call <SID>searchsyn('\<end\>',['rubyDefine'],'','v')<CR>
|
| 200 |
+
|
| 201 |
+
nnoremap <silent> <buffer> [[ :<C-U>call <SID>searchsyn('\<\%(class\<Bar>module\)\>',['rubyModule','rubyClass'],'b','n')<CR>
|
| 202 |
+
nnoremap <silent> <buffer> ]] :<C-U>call <SID>searchsyn('\<\%(class\<Bar>module\)\>',['rubyModule','rubyClass'],'','n')<CR>
|
| 203 |
+
nnoremap <silent> <buffer> [] :<C-U>call <SID>searchsyn('\<end\>',['rubyModule','rubyClass'],'b','n')<CR>
|
| 204 |
+
nnoremap <silent> <buffer> ][ :<C-U>call <SID>searchsyn('\<end\>',['rubyModule','rubyClass'],'','n')<CR>
|
| 205 |
+
xnoremap <silent> <buffer> [[ :<C-U>call <SID>searchsyn('\<\%(class\<Bar>module\)\>',['rubyModule','rubyClass'],'b','v')<CR>
|
| 206 |
+
xnoremap <silent> <buffer> ]] :<C-U>call <SID>searchsyn('\<\%(class\<Bar>module\)\>',['rubyModule','rubyClass'],'','v')<CR>
|
| 207 |
+
xnoremap <silent> <buffer> [] :<C-U>call <SID>searchsyn('\<end\>',['rubyModule','rubyClass'],'b','v')<CR>
|
| 208 |
+
xnoremap <silent> <buffer> ][ :<C-U>call <SID>searchsyn('\<end\>',['rubyModule','rubyClass'],'','v')<CR>
|
| 209 |
+
|
| 210 |
+
let b:undo_ftplugin = b:undo_ftplugin
|
| 211 |
+
\."| sil! exe 'unmap <buffer> [[' | sil! exe 'unmap <buffer> ]]' | sil! exe 'unmap <buffer> []' | sil! exe 'unmap <buffer> ]['"
|
| 212 |
+
\."| sil! exe 'unmap <buffer> [m' | sil! exe 'unmap <buffer> ]m' | sil! exe 'unmap <buffer> [M' | sil! exe 'unmap <buffer> ]M'"
|
| 213 |
+
|
| 214 |
+
if maparg('im','x') == '' && maparg('im','o') == '' && maparg('am','x') == '' && maparg('am','o') == ''
|
| 215 |
+
onoremap <silent> <buffer> im :<C-U>call <SID>wrap_i('[m',']M')<CR>
|
| 216 |
+
onoremap <silent> <buffer> am :<C-U>call <SID>wrap_a('[m',']M')<CR>
|
| 217 |
+
xnoremap <silent> <buffer> im :<C-U>call <SID>wrap_i('[m',']M')<CR>
|
| 218 |
+
xnoremap <silent> <buffer> am :<C-U>call <SID>wrap_a('[m',']M')<CR>
|
| 219 |
+
let b:undo_ftplugin = b:undo_ftplugin
|
| 220 |
+
\."| sil! exe 'ounmap <buffer> im' | sil! exe 'ounmap <buffer> am'"
|
| 221 |
+
\."| sil! exe 'xunmap <buffer> im' | sil! exe 'xunmap <buffer> am'"
|
| 222 |
+
endif
|
| 223 |
+
|
| 224 |
+
if maparg('iM','x') == '' && maparg('iM','o') == '' && maparg('aM','x') == '' && maparg('aM','o') == ''
|
| 225 |
+
onoremap <silent> <buffer> iM :<C-U>call <SID>wrap_i('[[','][')<CR>
|
| 226 |
+
onoremap <silent> <buffer> aM :<C-U>call <SID>wrap_a('[[','][')<CR>
|
| 227 |
+
xnoremap <silent> <buffer> iM :<C-U>call <SID>wrap_i('[[','][')<CR>
|
| 228 |
+
xnoremap <silent> <buffer> aM :<C-U>call <SID>wrap_a('[[','][')<CR>
|
| 229 |
+
let b:undo_ftplugin = b:undo_ftplugin
|
| 230 |
+
\."| sil! exe 'ounmap <buffer> iM' | sil! exe 'ounmap <buffer> aM'"
|
| 231 |
+
\."| sil! exe 'xunmap <buffer> iM' | sil! exe 'xunmap <buffer> aM'"
|
| 232 |
+
endif
|
| 233 |
+
|
| 234 |
+
call s:map('c', '', '<C-R><C-F> <Plug><cfile>')
|
| 235 |
+
|
| 236 |
+
cmap <buffer><script><expr> <SID>tagzv &foldopen =~# 'tag' ? '<Bar>norm! zv' : ''
|
| 237 |
+
call s:map('n', '<script><silent>', '<C-]> <SID>:exe v:count1."tag <SID><ctag>"<SID>tagzv<CR>')
|
| 238 |
+
call s:map('n', '<script><silent>', 'g<C-]> <SID>:exe "tjump <SID><ctag>"<SID>tagzv<CR>')
|
| 239 |
+
call s:map('n', '<script><silent>', 'g] <SID>:exe "tselect <SID><ctag>"<SID>tagzv<CR>')
|
| 240 |
+
call s:map('n', '<script><silent>', '<C-W>] <SID>:exe v:count1."stag <SID><ctag>"<SID>tagzv<CR>')
|
| 241 |
+
call s:map('n', '<script><silent>', '<C-W><C-]> <SID>:exe v:count1."stag <SID><ctag>"<SID>tagzv<CR>')
|
| 242 |
+
call s:map('n', '<script><silent>', '<C-W>g<C-]> <SID>:exe "stjump <SID><ctag>"<SID>tagzv<CR>')
|
| 243 |
+
call s:map('n', '<script><silent>', '<C-W>g] <SID>:exe "stselect <SID><ctag>"<SID>tagzv<CR>')
|
| 244 |
+
call s:map('n', '<script><silent>', '<C-W>} <SID>:exe v:count1."ptag <SID><ctag>"<CR>')
|
| 245 |
+
call s:map('n', '<script><silent>', '<C-W>g} <SID>:exe "ptjump <SID><ctag>"<CR>')
|
| 246 |
+
|
| 247 |
+
call s:map('n', '<script><silent>', 'gf <SID>c:find <SID><cfile><CR>')
|
| 248 |
+
call s:map('n', '<script><silent>', '<C-W>f <SID>c:sfind <SID><cfile><CR>')
|
| 249 |
+
call s:map('n', '<script><silent>', '<C-W><C-F> <SID>c:sfind <SID><cfile><CR>')
|
| 250 |
+
call s:map('n', '<script><silent>', '<C-W>gf <SID>c:tabfind <SID><cfile><CR>')
|
| 251 |
+
endif
|
| 252 |
+
|
| 253 |
+
let &cpo = s:cpo_save
|
| 254 |
+
unlet s:cpo_save
|
| 255 |
+
|
| 256 |
+
if exists("g:did_ruby_ftplugin_functions")
|
| 257 |
+
finish
|
| 258 |
+
endif
|
| 259 |
+
let g:did_ruby_ftplugin_functions = 1
|
| 260 |
+
|
| 261 |
+
function! RubyBalloonexpr() abort
|
| 262 |
+
if !exists('s:ri_found')
|
| 263 |
+
let s:ri_found = executable('ri')
|
| 264 |
+
endif
|
| 265 |
+
if s:ri_found
|
| 266 |
+
let line = getline(v:beval_lnum)
|
| 267 |
+
let b = matchstr(strpart(line,0,v:beval_col),'\%(\w\|[:.]\)*$')
|
| 268 |
+
let a = substitute(matchstr(strpart(line,v:beval_col),'^\w*\%([?!]\|\s*=\)\?'),'\s\+','','g')
|
| 269 |
+
let str = b.a
|
| 270 |
+
let before = strpart(line,0,v:beval_col-strlen(b))
|
| 271 |
+
let after = strpart(line,v:beval_col+strlen(a))
|
| 272 |
+
if str =~ '^\.'
|
| 273 |
+
let str = substitute(str,'^\.','#','g')
|
| 274 |
+
if before =~ '\]\s*$'
|
| 275 |
+
let str = 'Array'.str
|
| 276 |
+
elseif before =~ '}\s*$'
|
| 277 |
+
" False positives from blocks here
|
| 278 |
+
let str = 'Hash'.str
|
| 279 |
+
elseif before =~ "[\"'`]\\s*$" || before =~ '\$\d\+\s*$'
|
| 280 |
+
let str = 'String'.str
|
| 281 |
+
elseif before =~ '\$\d\+\.\d\+\s*$'
|
| 282 |
+
let str = 'Float'.str
|
| 283 |
+
elseif before =~ '\$\d\+\s*$'
|
| 284 |
+
let str = 'Integer'.str
|
| 285 |
+
elseif before =~ '/\s*$'
|
| 286 |
+
let str = 'Regexp'.str
|
| 287 |
+
else
|
| 288 |
+
let str = substitute(str,'^#','.','')
|
| 289 |
+
endif
|
| 290 |
+
endif
|
| 291 |
+
let str = substitute(str,'.*\.\s*to_f\s*\.\s*','Float#','')
|
| 292 |
+
let str = substitute(str,'.*\.\s*to_i\%(nt\)\=\s*\.\s*','Integer#','')
|
| 293 |
+
let str = substitute(str,'.*\.\s*to_s\%(tr\)\=\s*\.\s*','String#','')
|
| 294 |
+
let str = substitute(str,'.*\.\s*to_sym\s*\.\s*','Symbol#','')
|
| 295 |
+
let str = substitute(str,'.*\.\s*to_a\%(ry\)\=\s*\.\s*','Array#','')
|
| 296 |
+
let str = substitute(str,'.*\.\s*to_proc\s*\.\s*','Proc#','')
|
| 297 |
+
if str !~ '^\w'
|
| 298 |
+
return ''
|
| 299 |
+
endif
|
| 300 |
+
silent! let res = substitute(system("ri -f rdoc -T \"".str.'"'),'\n$','','')
|
| 301 |
+
if res =~ '^Nothing known about' || res =~ '^Bad argument:' || res =~ '^More than one method'
|
| 302 |
+
return ''
|
| 303 |
+
endif
|
| 304 |
+
return res
|
| 305 |
+
else
|
| 306 |
+
return ""
|
| 307 |
+
endif
|
| 308 |
+
endfunction
|
| 309 |
+
|
| 310 |
+
function! s:searchsyn(pattern, syn, flags, mode) abort
|
| 311 |
+
let cnt = v:count1
|
| 312 |
+
norm! m'
|
| 313 |
+
if a:mode ==# 'v'
|
| 314 |
+
norm! gv
|
| 315 |
+
endif
|
| 316 |
+
let i = 0
|
| 317 |
+
call map(a:syn, 'hlID(v:val)')
|
| 318 |
+
while i < cnt
|
| 319 |
+
let i = i + 1
|
| 320 |
+
let line = line('.')
|
| 321 |
+
let col = col('.')
|
| 322 |
+
let pos = search(a:pattern,'W'.a:flags)
|
| 323 |
+
while pos != 0 && index(a:syn, s:synid()) < 0
|
| 324 |
+
let pos = search(a:pattern,'W'.a:flags)
|
| 325 |
+
endwhile
|
| 326 |
+
if pos == 0
|
| 327 |
+
call cursor(line,col)
|
| 328 |
+
return
|
| 329 |
+
endif
|
| 330 |
+
endwhile
|
| 331 |
+
endfunction
|
| 332 |
+
|
| 333 |
+
function! s:synid() abort
|
| 334 |
+
return synID(line('.'),col('.'),0)
|
| 335 |
+
endfunction
|
| 336 |
+
|
| 337 |
+
function! s:wrap_i(back,forward) abort
|
| 338 |
+
execute 'norm! k'
|
| 339 |
+
execute 'norm '.a:forward
|
| 340 |
+
let line = line('.')
|
| 341 |
+
execute 'norm '.a:back
|
| 342 |
+
if line('.') == line - 1
|
| 343 |
+
return s:wrap_a(a:back,a:forward)
|
| 344 |
+
endif
|
| 345 |
+
execute 'norm! jV'
|
| 346 |
+
execute 'norm '.a:forward
|
| 347 |
+
execute 'norm! k'
|
| 348 |
+
endfunction
|
| 349 |
+
|
| 350 |
+
function! s:wrap_a(back,forward) abort
|
| 351 |
+
execute 'norm '.a:forward
|
| 352 |
+
if line('.') < line('$') && getline(line('.')+1) ==# ''
|
| 353 |
+
let after = 1
|
| 354 |
+
endif
|
| 355 |
+
execute 'norm '.a:back
|
| 356 |
+
while getline(line('.')-1) =~# '^\s*#' && line('.')
|
| 357 |
+
-
|
| 358 |
+
endwhile
|
| 359 |
+
if exists('after')
|
| 360 |
+
execute 'norm! V'
|
| 361 |
+
execute 'norm '.a:forward
|
| 362 |
+
execute 'norm! j'
|
| 363 |
+
elseif line('.') > 1 && getline(line('.')-1) =~# '^\s*$'
|
| 364 |
+
execute 'norm! kV'
|
| 365 |
+
execute 'norm '.a:forward
|
| 366 |
+
else
|
| 367 |
+
execute 'norm! V'
|
| 368 |
+
execute 'norm '.a:forward
|
| 369 |
+
endif
|
| 370 |
+
endfunction
|
| 371 |
+
|
| 372 |
+
function! RubyCursorIdentifier() abort
|
| 373 |
+
let asciicode = '\%(\w\|[]})\"'."'".']\)\@<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)\)'
|
| 374 |
+
let number = '\%(\%(\w\|[]})\"'."'".']\s*\)\@<!-\)\=\%(\<[[:digit:]_]\+\%(\.[[:digit:]_]\+\)\=\%([Ee][[:digit:]_]\+\)\=\>\|\<0[xXbBoOdD][[:xdigit:]_]\+\>\)\|'.asciicode
|
| 375 |
+
let operator = '\%(\[\]\|<<\|<=>\|[!<>]=\=\|===\=\|[!=]\~\|>>\|\*\*\|\.\.\.\=\|=>\|[~^&|*/%+-]\)'
|
| 376 |
+
let method = '\%(\.[_a-zA-Z]\w*\s*=>\@!\|\<[_a-zA-Z]\w*\>[?!]\=\)'
|
| 377 |
+
let global = '$\%([!$&"'."'".'*+,./:;<=>?@\`~]\|-\=\w\+\>\)'
|
| 378 |
+
let symbolizable = '\%(\%(@@\=\)\w\+\>\|'.global.'\|'.method.'\|'.operator.'\)'
|
| 379 |
+
let pattern = '\C\s*\%('.number.'\|\%(:\@<!:\)\='.symbolizable.'\)'
|
| 380 |
+
let [lnum, col] = searchpos(pattern,'bcn',line('.'))
|
| 381 |
+
let raw = matchstr(getline('.')[col-1 : ],pattern)
|
| 382 |
+
let stripped = substitute(substitute(raw,'\s\+=$','=',''),'^\s*[:.]\=','','')
|
| 383 |
+
return stripped == '' ? expand("<cword>") : stripped
|
| 384 |
+
endfunction
|
| 385 |
+
|
| 386 |
+
function! RubyCursorTag() abort
|
| 387 |
+
return substitute(RubyCursorIdentifier(), '^[$@]*', '', '')
|
| 388 |
+
endfunction
|
| 389 |
+
|
| 390 |
+
function! RubyCursorFile() abort
|
| 391 |
+
let isfname = &isfname
|
| 392 |
+
try
|
| 393 |
+
set isfname+=:
|
| 394 |
+
let cfile = expand('<cfile>')
|
| 395 |
+
finally
|
| 396 |
+
let isfname = &isfname
|
| 397 |
+
endtry
|
| 398 |
+
let pre = matchstr(strpart(getline('.'), 0, col('.')-1), '.*\f\@<!')
|
| 399 |
+
let post = matchstr(strpart(getline('.'), col('.')), '\f\@!.*')
|
| 400 |
+
if s:synid() ==# hlID('rubyConstant')
|
| 401 |
+
let cfile = substitute(cfile,'\.\w\+[?!=]\=$','','')
|
| 402 |
+
let cfile = substitute(cfile,'^::','','')
|
| 403 |
+
let cfile = substitute(cfile,'::','/','g')
|
| 404 |
+
let cfile = substitute(cfile,'\(\u\+\)\(\u\l\)','\1_\2', 'g')
|
| 405 |
+
let cfile = substitute(cfile,'\(\l\|\d\)\(\u\)','\1_\2', 'g')
|
| 406 |
+
return tolower(cfile) . '.rb'
|
| 407 |
+
elseif getline('.') =~# '^\s*require_relative\s*\(["'']\).*\1\s*$'
|
| 408 |
+
let cfile = expand('%:p:h') . '/' . matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1')
|
| 409 |
+
let cfile .= cfile !~# '\.rb$' ? '.rb' : ''
|
| 410 |
+
elseif getline('.') =~# '^\s*\%(require[( ]\|load[( ]\|autoload[( ]:\w\+,\)\s*\%(::\)\=File\.expand_path(\(["'']\)\.\./.*\1,\s*__FILE__)\s*$'
|
| 411 |
+
let target = matchstr(getline('.'),'\(["'']\)\.\.\zs/.\{-\}\ze\1')
|
| 412 |
+
let cfile = expand('%:p:h') . target
|
| 413 |
+
let cfile .= cfile !~# '\.rb$' ? '.rb' : ''
|
| 414 |
+
elseif getline('.') =~# '^\s*\%(require \|load \|autoload :\w\+,\)\s*\(["'']\).*\1\s*$'
|
| 415 |
+
let cfile = matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1')
|
| 416 |
+
let cfile .= cfile !~# '\.rb$' ? '.rb' : ''
|
| 417 |
+
elseif pre.post =~# '\<File.expand_path[( ].*[''"]\{2\}, *__FILE__\>' && cfile =~# '^\.\.'
|
| 418 |
+
let cfile = expand('%:p:h') . strpart(cfile, 2)
|
| 419 |
+
else
|
| 420 |
+
return substitute(cfile, '\C\v^(.*):(\d+)%(:in)=$', '+\2 \1', '')
|
| 421 |
+
endif
|
| 422 |
+
let cwdpat = '^\M' . substitute(getcwd(), '[\/]', '\\[\\/]', 'g').'\ze\[\/]'
|
| 423 |
+
let cfile = substitute(cfile, cwdpat, '.', '')
|
| 424 |
+
if fnameescape(cfile) !=# cfile
|
| 425 |
+
return '+ '.fnameescape(cfile)
|
| 426 |
+
else
|
| 427 |
+
return cfile
|
| 428 |
+
endif
|
| 429 |
+
endfunction
|
| 430 |
+
|
| 431 |
+
"
|
| 432 |
+
" Instructions for enabling "matchit" support:
|
| 433 |
+
"
|
| 434 |
+
" 1. Look for the latest "matchit" plugin at
|
| 435 |
+
"
|
| 436 |
+
" http://www.vim.org/scripts/script.php?script_id=39
|
| 437 |
+
"
|
| 438 |
+
" It is also packaged with Vim, in the $VIMRUNTIME/macros directory.
|
| 439 |
+
"
|
| 440 |
+
" 2. Copy "matchit.txt" into a "doc" directory (e.g. $HOME/.vim/doc).
|
| 441 |
+
"
|
| 442 |
+
" 3. Copy "matchit.vim" into a "plugin" directory (e.g. $HOME/.vim/plugin).
|
| 443 |
+
"
|
| 444 |
+
" 4. Ensure this file (ftplugin/ruby.vim) is installed.
|
| 445 |
+
"
|
| 446 |
+
" 5. Ensure you have this line in your $HOME/.vimrc:
|
| 447 |
+
" filetype plugin on
|
| 448 |
+
"
|
| 449 |
+
" 6. Restart Vim and create the matchit documentation:
|
| 450 |
+
"
|
| 451 |
+
" :helptags ~/.vim/doc
|
| 452 |
+
"
|
| 453 |
+
" Now you can do ":help matchit", and you should be able to use "%" on Ruby
|
| 454 |
+
" keywords. Try ":echo b:match_words" to be sure.
|
| 455 |
+
"
|
| 456 |
+
" Thanks to Mark J. Reed for the instructions. See ":help vimrc" for the
|
| 457 |
+
" locations of plugin directories, etc., as there are several options, and it
|
| 458 |
+
" differs on Windows. Email gsinclair@soyabean.com.au if you need help.
|
| 459 |
+
"
|
| 460 |
+
|
| 461 |
+
" vim: nowrap sw=2 sts=2 ts=8:
|
git/usr/share/vim/vim92/ftplugin/rust.vim
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Language: Rust
|
| 2 |
+
" Description: Vim ftplugin for Rust
|
| 3 |
+
" Maintainer: Chris Morgan <me@chrismorgan.info>
|
| 4 |
+
" Last Change: 2024 Mar 17
|
| 5 |
+
" 2024 May 23 by Riley Bruins <ribru17@gmail.com ('commentstring')
|
| 6 |
+
" 2025 Dec 09 update 'textwidth# to 100 #18892
|
| 7 |
+
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
| 8 |
+
|
| 9 |
+
if exists("b:did_ftplugin")
|
| 10 |
+
finish
|
| 11 |
+
endif
|
| 12 |
+
let b:did_ftplugin = 1
|
| 13 |
+
|
| 14 |
+
" vint: -ProhibitAbbreviationOption
|
| 15 |
+
let s:save_cpo = &cpo
|
| 16 |
+
set cpo&vim
|
| 17 |
+
" vint: +ProhibitAbbreviationOption
|
| 18 |
+
|
| 19 |
+
if get(b:, 'current_compiler', '') ==# ''
|
| 20 |
+
if strlen(findfile('Cargo.toml', '.;')) > 0
|
| 21 |
+
compiler cargo
|
| 22 |
+
else
|
| 23 |
+
compiler rustc
|
| 24 |
+
endif
|
| 25 |
+
endif
|
| 26 |
+
|
| 27 |
+
" Variables {{{1
|
| 28 |
+
|
| 29 |
+
" The rust source code at present seems to typically omit a leader on /*!
|
| 30 |
+
" comments, so we'll use that as our default, but make it easy to switch.
|
| 31 |
+
" This does not affect indentation at all (I tested it with and without
|
| 32 |
+
" leader), merely whether a leader is inserted by default or not.
|
| 33 |
+
if get(g:, 'rust_bang_comment_leader', 0)
|
| 34 |
+
" Why is the `,s0:/*,mb:\ ,ex:*/` there, you ask? I don't understand why,
|
| 35 |
+
" but without it, */ gets indented one space even if there were no
|
| 36 |
+
" leaders. I'm fairly sure that's a Vim bug.
|
| 37 |
+
setlocal comments=s1:/*,mb:*,ex:*/,s0:/*,mb:\ ,ex:*/,:///,://!,://
|
| 38 |
+
else
|
| 39 |
+
setlocal comments=s0:/*!,ex:*/,s1:/*,mb:*,ex:*/,:///,://!,://
|
| 40 |
+
endif
|
| 41 |
+
setlocal commentstring=//\ %s
|
| 42 |
+
setlocal formatoptions-=t formatoptions+=croqnl
|
| 43 |
+
" j was only added in 7.3.541, so stop complaints about its nonexistence
|
| 44 |
+
silent! setlocal formatoptions+=j
|
| 45 |
+
|
| 46 |
+
" smartindent will be overridden by indentexpr if filetype indent is on, but
|
| 47 |
+
" otherwise it's better than nothing.
|
| 48 |
+
setlocal smartindent nocindent
|
| 49 |
+
|
| 50 |
+
if get(g:, 'rust_recommended_style', 1)
|
| 51 |
+
let b:rust_set_style = 1
|
| 52 |
+
setlocal shiftwidth=4 softtabstop=4 expandtab
|
| 53 |
+
setlocal textwidth=100
|
| 54 |
+
endif
|
| 55 |
+
|
| 56 |
+
setlocal include=\\v^\\s*(pub\\s+)?use\\s+\\zs(\\f\|:)+
|
| 57 |
+
setlocal includeexpr=rust#IncludeExpr(v:fname)
|
| 58 |
+
|
| 59 |
+
setlocal suffixesadd=.rs
|
| 60 |
+
|
| 61 |
+
if exists("g:ftplugin_rust_source_path")
|
| 62 |
+
let &l:path=g:ftplugin_rust_source_path . ',' . &l:path
|
| 63 |
+
endif
|
| 64 |
+
|
| 65 |
+
if exists("g:loaded_delimitMate")
|
| 66 |
+
if exists("b:delimitMate_excluded_regions")
|
| 67 |
+
let b:rust_original_delimitMate_excluded_regions = b:delimitMate_excluded_regions
|
| 68 |
+
endif
|
| 69 |
+
|
| 70 |
+
augroup rust.vim.DelimitMate
|
| 71 |
+
autocmd!
|
| 72 |
+
|
| 73 |
+
autocmd User delimitMate_map :call rust#delimitmate#onMap()
|
| 74 |
+
autocmd User delimitMate_unmap :call rust#delimitmate#onUnmap()
|
| 75 |
+
augroup END
|
| 76 |
+
endif
|
| 77 |
+
|
| 78 |
+
" Integration with auto-pairs (https://github.com/jiangmiao/auto-pairs)
|
| 79 |
+
if exists("g:AutoPairsLoaded") && !get(g:, 'rust_keep_autopairs_default', 0)
|
| 80 |
+
let b:AutoPairs = {'(':')', '[':']', '{':'}','"':'"', '`':'`'}
|
| 81 |
+
endif
|
| 82 |
+
|
| 83 |
+
if has("folding") && get(g:, 'rust_fold', 0)
|
| 84 |
+
let b:rust_set_foldmethod=1
|
| 85 |
+
setlocal foldmethod=syntax
|
| 86 |
+
if g:rust_fold == 2
|
| 87 |
+
setlocal foldlevel<
|
| 88 |
+
else
|
| 89 |
+
setlocal foldlevel=99
|
| 90 |
+
endif
|
| 91 |
+
endif
|
| 92 |
+
|
| 93 |
+
if has('conceal') && get(g:, 'rust_conceal', 0)
|
| 94 |
+
let b:rust_set_conceallevel=1
|
| 95 |
+
setlocal conceallevel=2
|
| 96 |
+
endif
|
| 97 |
+
|
| 98 |
+
" Motion Commands {{{1
|
| 99 |
+
if !exists("g:no_plugin_maps") && !exists("g:no_rust_maps")
|
| 100 |
+
" Bind motion commands to support hanging indents
|
| 101 |
+
nnoremap <silent> <buffer> [[ :call rust#Jump('n', 'Back')<CR>
|
| 102 |
+
nnoremap <silent> <buffer> ]] :call rust#Jump('n', 'Forward')<CR>
|
| 103 |
+
xnoremap <silent> <buffer> [[ :call rust#Jump('v', 'Back')<CR>
|
| 104 |
+
xnoremap <silent> <buffer> ]] :call rust#Jump('v', 'Forward')<CR>
|
| 105 |
+
onoremap <silent> <buffer> [[ :call rust#Jump('o', 'Back')<CR>
|
| 106 |
+
onoremap <silent> <buffer> ]] :call rust#Jump('o', 'Forward')<CR>
|
| 107 |
+
endif
|
| 108 |
+
|
| 109 |
+
" Commands {{{1
|
| 110 |
+
|
| 111 |
+
" See |:RustRun| for docs
|
| 112 |
+
command! -nargs=* -complete=file -bang -buffer RustRun call rust#Run(<bang>0, <q-args>)
|
| 113 |
+
|
| 114 |
+
" See |:RustExpand| for docs
|
| 115 |
+
command! -nargs=* -complete=customlist,rust#CompleteExpand -bang -buffer RustExpand call rust#Expand(<bang>0, <q-args>)
|
| 116 |
+
|
| 117 |
+
" See |:RustEmitIr| for docs
|
| 118 |
+
command! -nargs=* -buffer RustEmitIr call rust#Emit("llvm-ir", <q-args>)
|
| 119 |
+
|
| 120 |
+
" See |:RustEmitAsm| for docs
|
| 121 |
+
command! -nargs=* -buffer RustEmitAsm call rust#Emit("asm", <q-args>)
|
| 122 |
+
|
| 123 |
+
" See |:RustPlay| for docs
|
| 124 |
+
command! -range=% -buffer RustPlay :call rust#Play(<count>, <line1>, <line2>, <f-args>)
|
| 125 |
+
|
| 126 |
+
" See |:RustFmt| for docs
|
| 127 |
+
command! -bar -buffer RustFmt call rustfmt#Format()
|
| 128 |
+
|
| 129 |
+
" See |:RustFmtRange| for docs
|
| 130 |
+
command! -range -buffer RustFmtRange call rustfmt#FormatRange(<line1>, <line2>)
|
| 131 |
+
|
| 132 |
+
" See |:RustInfo| for docs
|
| 133 |
+
command! -bar -buffer RustInfo call rust#debugging#Info()
|
| 134 |
+
|
| 135 |
+
" See |:RustInfoToClipboard| for docs
|
| 136 |
+
command! -bar -buffer RustInfoToClipboard call rust#debugging#InfoToClipboard()
|
| 137 |
+
|
| 138 |
+
" See |:RustInfoToFile| for docs
|
| 139 |
+
command! -bar -nargs=1 -buffer RustInfoToFile call rust#debugging#InfoToFile(<f-args>)
|
| 140 |
+
|
| 141 |
+
" See |:RustTest| for docs
|
| 142 |
+
command! -buffer -nargs=* -count -bang RustTest call rust#Test(<q-mods>, <count>, <bang>0, <q-args>)
|
| 143 |
+
|
| 144 |
+
if !exists("b:rust_last_rustc_args") || !exists("b:rust_last_args")
|
| 145 |
+
let b:rust_last_rustc_args = []
|
| 146 |
+
let b:rust_last_args = []
|
| 147 |
+
endif
|
| 148 |
+
|
| 149 |
+
" Cleanup {{{1
|
| 150 |
+
|
| 151 |
+
let b:undo_ftplugin = "
|
| 152 |
+
\ compiler make |
|
| 153 |
+
\ setlocal formatoptions< comments< commentstring< include< includeexpr< suffixesadd<
|
| 154 |
+
\|if exists('b:rust_set_style')
|
| 155 |
+
\|setlocal tabstop< shiftwidth< softtabstop< expandtab< textwidth<
|
| 156 |
+
\|endif
|
| 157 |
+
\|if exists('b:rust_original_delimitMate_excluded_regions')
|
| 158 |
+
\|let b:delimitMate_excluded_regions = b:rust_original_delimitMate_excluded_regions
|
| 159 |
+
\|unlet b:rust_original_delimitMate_excluded_regions
|
| 160 |
+
\|else
|
| 161 |
+
\|unlet! b:delimitMate_excluded_regions
|
| 162 |
+
\|endif
|
| 163 |
+
\|if exists('b:rust_set_foldmethod')
|
| 164 |
+
\|setlocal foldmethod< foldlevel<
|
| 165 |
+
\|unlet b:rust_set_foldmethod
|
| 166 |
+
\|endif
|
| 167 |
+
\|if exists('b:rust_set_conceallevel')
|
| 168 |
+
\|setlocal conceallevel<
|
| 169 |
+
\|unlet b:rust_set_conceallevel
|
| 170 |
+
\|endif
|
| 171 |
+
\|unlet! b:rust_last_rustc_args b:rust_last_args
|
| 172 |
+
\|delcommand -buffer RustRun
|
| 173 |
+
\|delcommand -buffer RustExpand
|
| 174 |
+
\|delcommand -buffer RustEmitIr
|
| 175 |
+
\|delcommand -buffer RustEmitAsm
|
| 176 |
+
\|delcommand -buffer RustPlay
|
| 177 |
+
\|delcommand -buffer RustFmt
|
| 178 |
+
\|delcommand -buffer RustFmtRange
|
| 179 |
+
\|delcommand -buffer RustInfo
|
| 180 |
+
\|delcommand -buffer RustInfoToClipboard
|
| 181 |
+
\|delcommand -buffer RustInfoToFile
|
| 182 |
+
\|delcommand -buffer RustTest
|
| 183 |
+
\|silent! nunmap <buffer> [[
|
| 184 |
+
\|silent! nunmap <buffer> ]]
|
| 185 |
+
\|silent! xunmap <buffer> [[
|
| 186 |
+
\|silent! xunmap <buffer> ]]
|
| 187 |
+
\|silent! ounmap <buffer> [[
|
| 188 |
+
\|silent! ounmap <buffer> ]]
|
| 189 |
+
\|setlocal matchpairs-=<:>
|
| 190 |
+
\|unlet b:match_skip
|
| 191 |
+
\"
|
| 192 |
+
|
| 193 |
+
" }}}1
|
| 194 |
+
|
| 195 |
+
" Code formatting on save
|
| 196 |
+
augroup rust.vim.PreWrite
|
| 197 |
+
autocmd!
|
| 198 |
+
autocmd BufWritePre *.rs silent! call rustfmt#PreWrite()
|
| 199 |
+
augroup END
|
| 200 |
+
|
| 201 |
+
setlocal matchpairs+=<:>
|
| 202 |
+
" For matchit.vim (rustArrow stops `Fn() -> X` messing things up)
|
| 203 |
+
let b:match_skip = 's:comment\|string\|rustCharacter\|rustArrow'
|
| 204 |
+
|
| 205 |
+
command! -buffer -nargs=+ Cargo call cargo#cmd(<q-args>)
|
| 206 |
+
command! -buffer -nargs=* Cbuild call cargo#build(<q-args>)
|
| 207 |
+
command! -buffer -nargs=* Ccheck call cargo#check(<q-args>)
|
| 208 |
+
command! -buffer -nargs=* Cclean call cargo#clean(<q-args>)
|
| 209 |
+
command! -buffer -nargs=* Cdoc call cargo#doc(<q-args>)
|
| 210 |
+
command! -buffer -nargs=+ Cnew call cargo#new(<q-args>)
|
| 211 |
+
command! -buffer -nargs=* Cinit call cargo#init(<q-args>)
|
| 212 |
+
command! -buffer -nargs=* Crun call cargo#run(<q-args>)
|
| 213 |
+
command! -buffer -nargs=* Ctest call cargo#test(<q-args>)
|
| 214 |
+
command! -buffer -nargs=* Cbench call cargo#bench(<q-args>)
|
| 215 |
+
command! -buffer -nargs=* Cupdate call cargo#update(<q-args>)
|
| 216 |
+
command! -buffer -nargs=* Csearch call cargo#search(<q-args>)
|
| 217 |
+
command! -buffer -nargs=* Cpublish call cargo#publish(<q-args>)
|
| 218 |
+
command! -buffer -nargs=* Cinstall call cargo#install(<q-args>)
|
| 219 |
+
command! -buffer -nargs=* Cruntarget call cargo#runtarget(<q-args>)
|
| 220 |
+
|
| 221 |
+
let b:undo_ftplugin .= '
|
| 222 |
+
\|delcommand -buffer Cargo
|
| 223 |
+
\|delcommand -buffer Cbuild
|
| 224 |
+
\|delcommand -buffer Ccheck
|
| 225 |
+
\|delcommand -buffer Cclean
|
| 226 |
+
\|delcommand -buffer Cdoc
|
| 227 |
+
\|delcommand -buffer Cnew
|
| 228 |
+
\|delcommand -buffer Cinit
|
| 229 |
+
\|delcommand -buffer Crun
|
| 230 |
+
\|delcommand -buffer Ctest
|
| 231 |
+
\|delcommand -buffer Cbench
|
| 232 |
+
\|delcommand -buffer Cupdate
|
| 233 |
+
\|delcommand -buffer Csearch
|
| 234 |
+
\|delcommand -buffer Cpublish
|
| 235 |
+
\|delcommand -buffer Cinstall
|
| 236 |
+
\|delcommand -buffer Cruntarget'
|
| 237 |
+
|
| 238 |
+
" vint: -ProhibitAbbreviationOption
|
| 239 |
+
let &cpo = s:save_cpo
|
| 240 |
+
unlet s:save_cpo
|
| 241 |
+
" vint: +ProhibitAbbreviationOption
|
| 242 |
+
|
| 243 |
+
" vim: set et sw=4 sts=4 ts=8:
|
git/usr/share/vim/vim92/ftplugin/samba.vim
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin
|
| 2 |
+
" Language: smb.conf(5) configuration file
|
| 3 |
+
" Maintainer: Matt Perry <matt@mattperry.com>
|
| 4 |
+
" Last Change: 2025 Feb 13
|
| 5 |
+
|
| 6 |
+
if exists('b:did_ftplugin')
|
| 7 |
+
finish
|
| 8 |
+
endif
|
| 9 |
+
let b:did_ftplugin = 1
|
| 10 |
+
|
| 11 |
+
setlocal comments=:;,:# commentstring=#\ %s
|
| 12 |
+
setlocal formatoptions-=t formatoptions+=croql
|
| 13 |
+
|
| 14 |
+
let b:undo_ftplugin = 'setl com< cms< fo<'
|
git/usr/share/vim/vim92/ftplugin/sass.vim
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin
|
| 2 |
+
" Language: Sass
|
| 3 |
+
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
| 4 |
+
" Last Change: 2023 Dec 28
|
| 5 |
+
|
| 6 |
+
" Only do this when not done yet for this buffer
|
| 7 |
+
if exists("b:did_ftplugin")
|
| 8 |
+
finish
|
| 9 |
+
endif
|
| 10 |
+
let b:did_ftplugin = 1
|
| 11 |
+
|
| 12 |
+
let b:undo_ftplugin = "setl com< cms< def< inc< inex< ofu< sua<"
|
| 13 |
+
|
| 14 |
+
setlocal comments=://
|
| 15 |
+
setlocal commentstring=//\ %s
|
| 16 |
+
setlocal includeexpr=SassIncludeExpr(v:fname)
|
| 17 |
+
setlocal omnifunc=csscomplete#CompleteCSS
|
| 18 |
+
setlocal suffixesadd=.sass,.scss,.css
|
| 19 |
+
if &filetype =~# '\<s[ac]ss]\>'
|
| 20 |
+
setlocal iskeyword+=-
|
| 21 |
+
setlocal iskeyword+=$
|
| 22 |
+
setlocal iskeyword+=%
|
| 23 |
+
let b:undo_ftplugin .= ' isk<'
|
| 24 |
+
endif
|
| 25 |
+
|
| 26 |
+
if get(g:, 'sass_recommended_style', 1)
|
| 27 |
+
setlocal shiftwidth=2 softtabstop=2 expandtab
|
| 28 |
+
let b:undo_ftplugin .= ' sw< sts< et<'
|
| 29 |
+
endif
|
| 30 |
+
|
| 31 |
+
let &l:define = '^\C\v\s*%(\@function|\@mixin|\=)|^\s*%(\$[[:alnum:]-]+:|[%.][:alnum:]-]+\s*%(\{|$))@='
|
| 32 |
+
let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\='
|
| 33 |
+
|
| 34 |
+
function! SassIncludeExpr(file) abort
|
| 35 |
+
let partial = substitute(a:file, '\%(.*/\|^\)\zs', '_', '')
|
| 36 |
+
if !empty(findfile(partial))
|
| 37 |
+
return partial
|
| 38 |
+
endif
|
| 39 |
+
return a:file
|
| 40 |
+
endfunction
|
| 41 |
+
|
| 42 |
+
" vim:set sw=2:
|
git/usr/share/vim/vim92/ftplugin/sbt.vim
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: sbt
|
| 3 |
+
" Maintainer: Steven Dobay <stevendobay at protonmail.com>
|
| 4 |
+
" License: Same as Vim
|
| 5 |
+
" Last Change: 2017.04.30
|
| 6 |
+
" ----------------------------------------------------------------------------
|
| 7 |
+
|
| 8 |
+
if exists('b:did_ftplugin') || &cp
|
| 9 |
+
finish
|
| 10 |
+
endif
|
| 11 |
+
|
| 12 |
+
runtime! ftplugin/scala.vim
|
| 13 |
+
|
| 14 |
+
let b:did_ftplugin = 1
|
git/usr/share/vim/vim92/ftplugin/scala.vim
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: Scala
|
| 3 |
+
" Maintainer: Derek Wyatt
|
| 4 |
+
" URL: https://github.com/derekwyatt/vim-scala
|
| 5 |
+
" License: Same as Vim
|
| 6 |
+
" Last Change: 11 August 2021
|
| 7 |
+
" 2023 Aug 28 by Vim Project (undo_ftplugin)
|
| 8 |
+
" ----------------------------------------------------------------------------
|
| 9 |
+
|
| 10 |
+
if exists('b:did_ftplugin') || &cp
|
| 11 |
+
finish
|
| 12 |
+
endif
|
| 13 |
+
let b:did_ftplugin = 1
|
| 14 |
+
|
| 15 |
+
" j is fairly new in Vim, so don't complain if it's not there
|
| 16 |
+
setlocal formatoptions-=t formatoptions+=croqnl
|
| 17 |
+
silent! setlocal formatoptions+=j
|
| 18 |
+
|
| 19 |
+
" Just like c.vim, but additionally doesn't wrap text onto /** line when
|
| 20 |
+
" formatting. Doesn't bungle bulleted lists when formatting.
|
| 21 |
+
if get(g:, 'scala_scaladoc_indent', 0)
|
| 22 |
+
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s2:/**,mb:*,ex:*/,s1:/*,mb:*,ex:*/,://
|
| 23 |
+
else
|
| 24 |
+
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/**,mb:*,ex:*/,s1:/*,mb:*,ex:*/,://
|
| 25 |
+
endif
|
| 26 |
+
setlocal commentstring=//\ %s
|
| 27 |
+
|
| 28 |
+
setlocal shiftwidth=2 softtabstop=2 expandtab
|
| 29 |
+
|
| 30 |
+
setlocal include=^\\s*import
|
| 31 |
+
setlocal includeexpr=substitute(v:fname,'\\.','/','g')
|
| 32 |
+
|
| 33 |
+
setlocal path+=src/main/scala,src/test/scala
|
| 34 |
+
setlocal suffixesadd=.scala
|
| 35 |
+
|
| 36 |
+
let b:undo_ftplugin = "setlocal cms< com< et< fo< inc< inex< pa< sts< sua< sw<"
|
| 37 |
+
|
| 38 |
+
" vim:set sw=2 sts=2 ts=8 et:
|
git/usr/share/vim/vim92/ftplugin/scdoc.vim
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" scdoc filetype plugin
|
| 2 |
+
" Maintainer: Gregory Anders <contact@gpanders.com>
|
| 3 |
+
" Last Updated: 2022 May 09
|
| 4 |
+
" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring')
|
| 5 |
+
" Upstream: https://github.com/gpanders/vim-scdoc
|
| 6 |
+
|
| 7 |
+
" Only do this when not done yet for this buffer
|
| 8 |
+
if exists('b:did_ftplugin')
|
| 9 |
+
finish
|
| 10 |
+
endif
|
| 11 |
+
|
| 12 |
+
" Don't load another plugin for this buffer
|
| 13 |
+
let b:did_ftplugin = 1
|
| 14 |
+
|
| 15 |
+
setlocal comments=b:;
|
| 16 |
+
setlocal commentstring=;\ %s
|
| 17 |
+
setlocal formatoptions+=t
|
| 18 |
+
setlocal noexpandtab
|
| 19 |
+
setlocal shiftwidth=0
|
| 20 |
+
setlocal softtabstop=0
|
| 21 |
+
setlocal textwidth=80
|
| 22 |
+
|
| 23 |
+
let b:undo_ftplugin = 'setl com< cms< fo< et< sw< sts< tw<'
|
git/usr/share/vim/vim92/ftplugin/scheme.vim
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: Scheme (R7RS)
|
| 3 |
+
" Last Change: 2024 Jun 21
|
| 4 |
+
" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring')
|
| 5 |
+
" Author: Evan Hanson <evhan@foldling.org>
|
| 6 |
+
" Maintainer: Evan Hanson <evhan@foldling.org>
|
| 7 |
+
" Previous Maintainer: Sergey Khorev <sergey.khorev@gmail.com>
|
| 8 |
+
" Repository: https://git.foldling.org/vim-scheme.git
|
| 9 |
+
" URL: https://foldling.org/vim/ftplugin/scheme.vim
|
| 10 |
+
|
| 11 |
+
if exists('b:did_ftplugin')
|
| 12 |
+
finish
|
| 13 |
+
endif
|
| 14 |
+
|
| 15 |
+
let s:cpo = &cpo
|
| 16 |
+
set cpo&vim
|
| 17 |
+
|
| 18 |
+
setl lisp
|
| 19 |
+
setl comments=:;;;;,:;;;,:;;,:;,sr:#\|,mb:\|,ex:\|#
|
| 20 |
+
setl commentstring=;\ %s
|
| 21 |
+
setl define=^\\s*(def\\k*
|
| 22 |
+
setl iskeyword=33,35-39,42-43,45-58,60-90,94,95,97-122,126
|
| 23 |
+
setl formatoptions-=t
|
| 24 |
+
|
| 25 |
+
let b:undo_ftplugin = 'setl lisp< comments< commentstring< define< iskeyword< formatoptions<'
|
| 26 |
+
|
| 27 |
+
setl lispwords+=case
|
| 28 |
+
setl lispwords+=define
|
| 29 |
+
setl lispwords+=define-library
|
| 30 |
+
setl lispwords+=define-record-type
|
| 31 |
+
setl lispwords+=define-syntax
|
| 32 |
+
setl lispwords+=define-values
|
| 33 |
+
setl lispwords+=do
|
| 34 |
+
setl lispwords+=guard
|
| 35 |
+
setl lispwords+=lambda
|
| 36 |
+
setl lispwords+=let
|
| 37 |
+
setl lispwords+=let*
|
| 38 |
+
setl lispwords+=let*-values
|
| 39 |
+
setl lispwords+=let-syntax
|
| 40 |
+
setl lispwords+=let-values
|
| 41 |
+
setl lispwords+=letrec
|
| 42 |
+
setl lispwords+=letrec*
|
| 43 |
+
setl lispwords+=letrec-syntax
|
| 44 |
+
setl lispwords+=parameterize
|
| 45 |
+
setl lispwords+=set!
|
| 46 |
+
setl lispwords+=syntax-rules
|
| 47 |
+
setl lispwords+=unless
|
| 48 |
+
setl lispwords+=when
|
| 49 |
+
|
| 50 |
+
let b:undo_ftplugin = b:undo_ftplugin . ' lispwords<'
|
| 51 |
+
|
| 52 |
+
let b:did_scheme_ftplugin = 1
|
| 53 |
+
|
| 54 |
+
if exists('b:is_chicken') || exists('g:is_chicken')
|
| 55 |
+
runtime! ftplugin/chicken.vim
|
| 56 |
+
endif
|
| 57 |
+
|
| 58 |
+
unlet b:did_scheme_ftplugin
|
| 59 |
+
let b:did_ftplugin = 1
|
| 60 |
+
let &cpo = s:cpo
|
| 61 |
+
unlet s:cpo
|
git/usr/share/vim/vim92/ftplugin/screen.vim
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: screen(1) configuration file
|
| 3 |
+
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
| 4 |
+
" Latest Revision: 2008-07-09
|
| 5 |
+
|
| 6 |
+
if exists("b:did_ftplugin")
|
| 7 |
+
finish
|
| 8 |
+
endif
|
| 9 |
+
let b:did_ftplugin = 1
|
| 10 |
+
|
| 11 |
+
let s:cpo_save = &cpo
|
| 12 |
+
set cpo&vim
|
| 13 |
+
|
| 14 |
+
let b:undo_ftplugin = "setl com< cms< fo<"
|
| 15 |
+
|
| 16 |
+
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
|
| 17 |
+
|
| 18 |
+
let &cpo = s:cpo_save
|
| 19 |
+
unlet s:cpo_save
|
git/usr/share/vim/vim92/ftplugin/scss.vim
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin
|
| 2 |
+
" Language: SCSS
|
| 3 |
+
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
| 4 |
+
" Last Change: 2016 Aug 29
|
| 5 |
+
|
| 6 |
+
if exists("b:did_ftplugin")
|
| 7 |
+
finish
|
| 8 |
+
endif
|
| 9 |
+
|
| 10 |
+
runtime! ftplugin/sass.vim
|
| 11 |
+
setlocal comments=s1:/*,mb:*,ex:*/,://
|
| 12 |
+
|
| 13 |
+
" vim:set sw=2:
|
git/usr/share/vim/vim92/ftplugin/sed.vim
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: sed
|
| 3 |
+
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
| 4 |
+
" Last Change: 2024 Jan 14
|
| 5 |
+
|
| 6 |
+
if exists("b:did_ftplugin")
|
| 7 |
+
finish
|
| 8 |
+
endif
|
| 9 |
+
let b:did_ftplugin = 1
|
| 10 |
+
|
| 11 |
+
let s:cpo_save = &cpo
|
| 12 |
+
set cpo&vim
|
| 13 |
+
|
| 14 |
+
setlocal comments=:#
|
| 15 |
+
setlocal commentstring=#\ %s
|
| 16 |
+
setlocal formatoptions-=t formatoptions+=croql
|
| 17 |
+
|
| 18 |
+
let b:undo_ftplugin = "setl com< cms< fo<"
|
| 19 |
+
|
| 20 |
+
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
| 21 |
+
let b:browsefilter = "sed Script Files (*.sed)\t*.sed\n"
|
| 22 |
+
if has("win32")
|
| 23 |
+
let b:browsefilter ..= "All Files (*.*)\t*\n"
|
| 24 |
+
else
|
| 25 |
+
let b:browsefilter ..= "All Files (*)\t*\n"
|
| 26 |
+
endif
|
| 27 |
+
let b:undo_ftplugin ..= " | unlet! b:browsefilter"
|
| 28 |
+
endif
|
| 29 |
+
|
| 30 |
+
let &cpo = s:cpo_save
|
| 31 |
+
unlet s:cpo_save
|
| 32 |
+
|
| 33 |
+
" vim: nowrap sw=2 sts=2 ts=8
|
git/usr/share/vim/vim92/ftplugin/sensors.vim
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: sensors.conf(5) - libsensors configuration file
|
| 3 |
+
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
| 4 |
+
" Latest Revision: 2008-07-09
|
| 5 |
+
|
| 6 |
+
if exists("b:did_ftplugin")
|
| 7 |
+
finish
|
| 8 |
+
endif
|
| 9 |
+
let b:did_ftplugin = 1
|
| 10 |
+
|
| 11 |
+
let s:cpo_save = &cpo
|
| 12 |
+
set cpo&vim
|
| 13 |
+
|
| 14 |
+
let b:undo_ftplugin = "setl com< cms< fo<"
|
| 15 |
+
|
| 16 |
+
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
|
| 17 |
+
|
| 18 |
+
let &cpo = s:cpo_save
|
| 19 |
+
unlet s:cpo_save
|
git/usr/share/vim/vim92/ftplugin/services.vim
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: services(5) - Internet network services list
|
| 3 |
+
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
| 4 |
+
" Latest Revision: 2008-07-09
|
| 5 |
+
|
| 6 |
+
if exists("b:did_ftplugin")
|
| 7 |
+
finish
|
| 8 |
+
endif
|
| 9 |
+
let b:did_ftplugin = 1
|
| 10 |
+
|
| 11 |
+
let s:cpo_save = &cpo
|
| 12 |
+
set cpo&vim
|
| 13 |
+
|
| 14 |
+
let b:undo_ftplugin = "setl com< cms< fo<"
|
| 15 |
+
|
| 16 |
+
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
|
| 17 |
+
|
| 18 |
+
let &cpo = s:cpo_save
|
| 19 |
+
unlet s:cpo_save
|
git/usr/share/vim/vim92/ftplugin/setserial.vim
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: setserial(8) configuration file
|
| 3 |
+
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
| 4 |
+
" Latest Revision: 2008-07-09
|
| 5 |
+
|
| 6 |
+
if exists("b:did_ftplugin")
|
| 7 |
+
finish
|
| 8 |
+
endif
|
| 9 |
+
let b:did_ftplugin = 1
|
| 10 |
+
|
| 11 |
+
let s:cpo_save = &cpo
|
| 12 |
+
set cpo&vim
|
| 13 |
+
|
| 14 |
+
let b:undo_ftplugin = "setl com< cms< fo<"
|
| 15 |
+
|
| 16 |
+
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
|
| 17 |
+
|
| 18 |
+
let &cpo = s:cpo_save
|
| 19 |
+
unlet s:cpo_save
|
git/usr/share/vim/vim92/ftplugin/sexplib.vim
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: Sexplib
|
| 3 |
+
" Maintainer: Markus Mottl <markus.mottl@gmail.com>
|
| 4 |
+
" URL: https://github.com/ocaml/vim-ocaml
|
| 5 |
+
" Last Change:
|
| 6 |
+
" 2023 Aug 28 - Added undo_ftplugin (Vim Project)
|
| 7 |
+
" 2017 Apr 12 - First version (MM)
|
| 8 |
+
|
| 9 |
+
if exists("b:did_ftplugin")
|
| 10 |
+
finish
|
| 11 |
+
endif
|
| 12 |
+
let b:did_ftplugin=1
|
| 13 |
+
|
| 14 |
+
" Comment string
|
| 15 |
+
setl commentstring=;\ %s
|
| 16 |
+
setl comments=:;
|
| 17 |
+
|
| 18 |
+
let b:undo_ftplugin = "setl cms< com<"
|
git/usr/share/vim/vim92/ftplugin/sgml.vim
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: sgml
|
| 3 |
+
"
|
| 4 |
+
" This runtime file is looking for a new maintainer.
|
| 5 |
+
"
|
| 6 |
+
" Former maintainer: Dan Sharp
|
| 7 |
+
" Last Change: 2009 Jan 20
|
| 8 |
+
" 2024 Jan 14 by Vim Project (browsefilter)
|
| 9 |
+
|
| 10 |
+
if exists("b:did_ftplugin") | finish | endif
|
| 11 |
+
|
| 12 |
+
" Make sure the continuation lines below do not cause problems in
|
| 13 |
+
" compatibility mode.
|
| 14 |
+
let s:save_cpo = &cpo
|
| 15 |
+
set cpo-=C
|
| 16 |
+
|
| 17 |
+
" Define some defaults in case the included ftplugins don't set them.
|
| 18 |
+
let s:undo_ftplugin = ""
|
| 19 |
+
let s:browsefilter = "XML Files (*.xml)\t*.xml\n"
|
| 20 |
+
if has("win32")
|
| 21 |
+
let s:browsefilter .= "All Files (*.*)\t*\n"
|
| 22 |
+
else
|
| 23 |
+
let s:browsefilter .= "All Files (*)\t*\n"
|
| 24 |
+
endif
|
| 25 |
+
|
| 26 |
+
runtime! ftplugin/xml.vim ftplugin/xml_*.vim ftplugin/xml/*.vim
|
| 27 |
+
let b:did_ftplugin = 1
|
| 28 |
+
|
| 29 |
+
" Override our defaults if these were set by an included ftplugin.
|
| 30 |
+
if exists("b:undo_ftplugin")
|
| 31 |
+
let s:undo_ftplugin = b:undo_ftplugin
|
| 32 |
+
endif
|
| 33 |
+
if exists("b:browsefilter")
|
| 34 |
+
let s:browsefilter = b:browsefilter
|
| 35 |
+
endif
|
| 36 |
+
|
| 37 |
+
" Change the :browse e filter to primarily show xml-related files.
|
| 38 |
+
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
| 39 |
+
let b:browsefilter="SGML Files (*.sgml,*.sgm)\t*.sgm*\n" . s:browsefilter
|
| 40 |
+
endif
|
| 41 |
+
|
| 42 |
+
" Undo the stuff we changed.
|
| 43 |
+
let b:undo_ftplugin = "unlet! b:browsefilter | " . s:undo_ftplugin
|
| 44 |
+
|
| 45 |
+
" Restore the saved compatibility options.
|
| 46 |
+
let &cpo = s:save_cpo
|
| 47 |
+
unlet s:save_cpo
|
git/usr/share/vim/vim92/ftplugin/sh.vim
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: sh
|
| 3 |
+
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
| 4 |
+
" Previous Maintainer: Dan Sharp
|
| 5 |
+
" Contributor: Enno Nagel <ennonagel+vim@gmail.com>
|
| 6 |
+
" Eisuke Kawashima
|
| 7 |
+
" Last Change: 2024 Sep 19 by Vim Project (compiler shellcheck)
|
| 8 |
+
" 2024 Dec 29 by Vim Project (improve setting shellcheck compiler)
|
| 9 |
+
" 2025 Mar 09 by Vim Project (set b:match_skip)
|
| 10 |
+
" 2025 Jul 22 by phanium (use :hor term #17822)
|
| 11 |
+
|
| 12 |
+
if exists("b:did_ftplugin")
|
| 13 |
+
finish
|
| 14 |
+
endif
|
| 15 |
+
let b:did_ftplugin = 1
|
| 16 |
+
|
| 17 |
+
let s:save_cpo = &cpo
|
| 18 |
+
set cpo-=C
|
| 19 |
+
|
| 20 |
+
setlocal comments=b:#
|
| 21 |
+
setlocal commentstring=#\ %s
|
| 22 |
+
setlocal formatoptions-=t formatoptions+=croql
|
| 23 |
+
|
| 24 |
+
let b:undo_ftplugin = "setl com< cms< fo<"
|
| 25 |
+
|
| 26 |
+
" Shell: thanks to Johannes Zellner
|
| 27 |
+
if exists("loaded_matchit") && !exists("b:match_words")
|
| 28 |
+
let b:match_ignorecase = 0
|
| 29 |
+
let s:sol = '\%(;\s*\|^\s*\)\@<=' " start of line
|
| 30 |
+
let b:match_words =
|
| 31 |
+
\ s:sol .. 'if\>:' .. s:sol.'elif\>:' .. s:sol.'else\>:' .. s:sol .. 'fi\>,' ..
|
| 32 |
+
\ s:sol .. '\%(for\|while\)\>:' .. s:sol .. 'done\>,' ..
|
| 33 |
+
\ s:sol .. 'case\>:' .. s:sol .. 'esac\>'
|
| 34 |
+
unlet s:sol
|
| 35 |
+
let b:match_skip = "synIDattr(synID(line('.'),col('.'),0),'name') =~ 'shSnglCase'"
|
| 36 |
+
let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words b:match_skip"
|
| 37 |
+
endif
|
| 38 |
+
|
| 39 |
+
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
| 40 |
+
let b:browsefilter = "Bourne Shell Scripts (*.sh)\t*.sh\n" ..
|
| 41 |
+
\ "Korn Shell Scripts (*.ksh)\t*.ksh\n" ..
|
| 42 |
+
\ "Bash Shell Scripts (*.bash)\t*.bash\n"
|
| 43 |
+
if has("win32")
|
| 44 |
+
let b:browsefilter ..= "All Files (*.*)\t*\n"
|
| 45 |
+
else
|
| 46 |
+
let b:browsefilter ..= "All Files (*)\t*\n"
|
| 47 |
+
endif
|
| 48 |
+
let b:undo_ftplugin ..= " | unlet! b:browsefilter"
|
| 49 |
+
endif
|
| 50 |
+
|
| 51 |
+
let s:is_sh = get(b:, "is_sh", get(g:, "is_sh", 0))
|
| 52 |
+
let s:is_bash = get(b:, "is_bash", get(g:, "is_bash", 0))
|
| 53 |
+
let s:is_kornshell = get(b:, "is_kornshell", get(g:, "is_kornshell", 0))
|
| 54 |
+
|
| 55 |
+
if s:is_bash
|
| 56 |
+
if exists(':terminal') == 2
|
| 57 |
+
command! -buffer -nargs=1 ShKeywordPrg silent exe ':hor term bash -c "help "<args>" 2>/dev/null || man "<args>""'
|
| 58 |
+
else
|
| 59 |
+
command! -buffer -nargs=1 ShKeywordPrg echo system('bash -c "help <args>" 2>/dev/null || MANPAGER= man "<args>"')
|
| 60 |
+
endif
|
| 61 |
+
setlocal keywordprg=:ShKeywordPrg
|
| 62 |
+
let b:undo_ftplugin ..= " | setl kp< | sil! delc -buffer ShKeywordPrg"
|
| 63 |
+
endif
|
| 64 |
+
|
| 65 |
+
if (s:is_sh || s:is_bash || s:is_kornshell) && executable('shellcheck')
|
| 66 |
+
if !exists('current_compiler')
|
| 67 |
+
compiler shellcheck
|
| 68 |
+
let b:undo_ftplugin ..= ' | compiler make'
|
| 69 |
+
endif
|
| 70 |
+
elseif s:is_bash
|
| 71 |
+
if !exists('current_compiler')
|
| 72 |
+
compiler bash
|
| 73 |
+
let b:undo_ftplugin ..= ' | compiler make'
|
| 74 |
+
endif
|
| 75 |
+
endif
|
| 76 |
+
|
| 77 |
+
let &cpo = s:save_cpo
|
| 78 |
+
unlet s:save_cpo s:is_sh s:is_bash s:is_kornshell
|
| 79 |
+
|
| 80 |
+
" vim: nowrap sw=2 sts=2 ts=8 noet:
|
git/usr/share/vim/vim92/ftplugin/shaderslang.vim
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: Slang
|
| 3 |
+
" Maintainer: Austin Shijo <epestr@proton.me>
|
| 4 |
+
" Last Change: 2025 Jan 05
|
| 5 |
+
|
| 6 |
+
" Only do this when not done yet for this buffer
|
| 7 |
+
if exists("b:did_ftplugin")
|
| 8 |
+
finish
|
| 9 |
+
endif
|
| 10 |
+
|
| 11 |
+
" Don't load another plugin for this buffer
|
| 12 |
+
let b:did_ftplugin = 1
|
| 13 |
+
|
| 14 |
+
" Using line continuation here.
|
| 15 |
+
let s:cpo_save = &cpo
|
| 16 |
+
set cpo-=C
|
| 17 |
+
|
| 18 |
+
let b:undo_ftplugin = "setl fo< com< cms< inc<"
|
| 19 |
+
|
| 20 |
+
" Set 'formatoptions' to break comment lines but not other lines,
|
| 21 |
+
" and insert the comment leader when hitting <CR> or using "o".
|
| 22 |
+
setlocal fo-=t fo+=croql
|
| 23 |
+
|
| 24 |
+
" Set comment string (Slang uses C-style comments)
|
| 25 |
+
setlocal commentstring=//\ %s
|
| 26 |
+
|
| 27 |
+
" Set 'comments' to format dashed lists in comments
|
| 28 |
+
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,://
|
| 29 |
+
|
| 30 |
+
" When the matchit plugin is loaded, this makes the % command skip parens and
|
| 31 |
+
" braces in comments properly, and adds support for shader-specific keywords
|
| 32 |
+
if exists("loaded_matchit")
|
| 33 |
+
" Add common shader control structures
|
| 34 |
+
let b:match_words = '{\|^\s*\<\(if\|for\|while\|switch\|struct\|class\)\>:}\|^\s*\<break\>,' ..
|
| 35 |
+
\ '^\s*#\s*if\(\|def\|ndef\)\>:^\s*#\s*elif\>:^\s*#\s*else\>:^\s*#\s*endif\>,' ..
|
| 36 |
+
\ '\[:\]'
|
| 37 |
+
let b:match_skip = 's:comment\|string\|character\|special'
|
| 38 |
+
let b:match_ignorecase = 0
|
| 39 |
+
let b:undo_ftplugin ..= " | unlet! b:match_skip b:match_words b:match_ignorecase"
|
| 40 |
+
endif
|
| 41 |
+
|
| 42 |
+
" Win32 and GTK can filter files in the browse dialog
|
| 43 |
+
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
| 44 |
+
let b:browsefilter = "Slang Source Files (*.slang)\t*.slang\n"
|
| 45 |
+
if has("win32")
|
| 46 |
+
let b:browsefilter ..= "All Files (*.*)\t*\n"
|
| 47 |
+
else
|
| 48 |
+
let b:browsefilter ..= "All Files (*)\t*\n"
|
| 49 |
+
endif
|
| 50 |
+
let b:undo_ftplugin ..= " | unlet! b:browsefilter"
|
| 51 |
+
endif
|
| 52 |
+
|
| 53 |
+
let &cpo = s:cpo_save
|
| 54 |
+
unlet s:cpo_save
|
git/usr/share/vim/vim92/ftplugin/sieve.vim
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: Sieve filtering language input file
|
| 3 |
+
" Maintainer: This runtime file is looking for a new maintainer.
|
| 4 |
+
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
| 5 |
+
" Latest Revision: 2025 Feb 20
|
| 6 |
+
" 2026 Jan 09 by Vim Project: preserve line endings for existing files #19144
|
| 7 |
+
|
| 8 |
+
if exists("b:did_ftplugin")
|
| 9 |
+
finish
|
| 10 |
+
endif
|
| 11 |
+
let b:did_ftplugin = 1
|
| 12 |
+
|
| 13 |
+
let b:undo_ftplugin = "setl com< cms< fo< ff<"
|
| 14 |
+
|
| 15 |
+
setlocal comments=s1:/*,mb:*,ex:*/,:# commentstring=#\ %s
|
| 16 |
+
setlocal formatoptions-=t formatoptions+=croql
|
| 17 |
+
|
| 18 |
+
" https://datatracker.ietf.org/doc/html/rfc5228#section-2.2 says
|
| 19 |
+
" "newlines (CRLF, never just CR or LF)"
|
| 20 |
+
" Use CRLF for new files only; preserve existing line endings
|
| 21 |
+
if expand('%:p') !=# '' && !filereadable(expand('%:p'))
|
| 22 |
+
setlocal fileformat=dos
|
| 23 |
+
endif
|
git/usr/share/vim/vim92/ftplugin/skhd.vim
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: skhd(simple hotkey daemon for macOS) configuration file
|
| 3 |
+
" Maintainer: Kiyoon Kim <https://github.com/kiyoon>
|
| 4 |
+
" Last Change: 2026 Jan 23
|
| 5 |
+
|
| 6 |
+
if exists("b:did_ftplugin")
|
| 7 |
+
finish
|
| 8 |
+
endif
|
| 9 |
+
let b:did_ftplugin = 1
|
| 10 |
+
|
| 11 |
+
let s:cpo_save = &cpo
|
| 12 |
+
set cpo&vim
|
| 13 |
+
|
| 14 |
+
setlocal comments=:# commentstring=#\ %s
|
| 15 |
+
setlocal formatoptions-=t formatoptions+=croql
|
| 16 |
+
|
| 17 |
+
let b:undo_ftplugin = "setl com< cms< fo<"
|
| 18 |
+
|
| 19 |
+
let &cpo = s:cpo_save
|
| 20 |
+
unlet s:cpo_save
|
git/usr/share/vim/vim92/ftplugin/slint.vim
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin
|
| 2 |
+
" Language: slint
|
| 3 |
+
" Maintainer: Riley Bruins <ribru17@gmail.com>
|
| 4 |
+
" Last Change: 2024 May 19
|
| 5 |
+
|
| 6 |
+
if exists('b:did_ftplugin')
|
| 7 |
+
finish
|
| 8 |
+
endif
|
| 9 |
+
let b:did_ftplugin = 1
|
| 10 |
+
|
| 11 |
+
" Set 'comments' to format dashed lists in comments.
|
| 12 |
+
" Also include ///, used for Doxygen.
|
| 13 |
+
setl comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,:// commentstring=//\ %s
|
| 14 |
+
|
| 15 |
+
let b:undo_ftplugin = 'setl com< cms<'
|
git/usr/share/vim/vim92/ftplugin/slpconf.vim
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: RFC 2614 - An API for Service Location configuration file
|
| 3 |
+
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
| 4 |
+
" Latest Revision: 2008-07-09
|
| 5 |
+
|
| 6 |
+
if exists("b:did_ftplugin")
|
| 7 |
+
finish
|
| 8 |
+
endif
|
| 9 |
+
let b:did_ftplugin = 1
|
| 10 |
+
|
| 11 |
+
let s:cpo_save = &cpo
|
| 12 |
+
set cpo&vim
|
| 13 |
+
|
| 14 |
+
let b:undo_ftplugin = "setl com< cms< fo<"
|
| 15 |
+
|
| 16 |
+
setlocal comments=:#,:; commentstring=#\ %s
|
| 17 |
+
setlocal formatoptions-=t formatoptions+=croql
|
| 18 |
+
|
| 19 |
+
let &cpo = s:cpo_save
|
| 20 |
+
unlet s:cpo_save
|
git/usr/share/vim/vim92/ftplugin/slpreg.vim
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: RFC 2614 - An API for Service Location registration file
|
| 3 |
+
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
| 4 |
+
" Latest Revision: 2008-07-09
|
| 5 |
+
|
| 6 |
+
if exists("b:did_ftplugin")
|
| 7 |
+
finish
|
| 8 |
+
endif
|
| 9 |
+
let b:did_ftplugin = 1
|
| 10 |
+
|
| 11 |
+
let s:cpo_save = &cpo
|
| 12 |
+
set cpo&vim
|
| 13 |
+
|
| 14 |
+
let b:undo_ftplugin = "setl com< cms< fo<"
|
| 15 |
+
|
| 16 |
+
setlocal comments=:#,:; commentstring=#\ %s
|
| 17 |
+
setlocal formatoptions-=t formatoptions+=croql
|
| 18 |
+
|
| 19 |
+
let &cpo = s:cpo_save
|
| 20 |
+
unlet s:cpo_save
|
git/usr/share/vim/vim92/ftplugin/slpspi.vim
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: RFC 2614 - An API for Service Location SPI file
|
| 3 |
+
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
| 4 |
+
" Latest Revision: 2008-07-09
|
| 5 |
+
|
| 6 |
+
if exists("b:did_ftplugin")
|
| 7 |
+
finish
|
| 8 |
+
endif
|
| 9 |
+
let b:did_ftplugin = 1
|
| 10 |
+
|
| 11 |
+
let s:cpo_save = &cpo
|
| 12 |
+
set cpo&vim
|
| 13 |
+
|
| 14 |
+
let b:undo_ftplugin = "setl com< cms< fo<"
|
| 15 |
+
|
| 16 |
+
setlocal comments=:#,:; commentstring=#\ %s
|
| 17 |
+
setlocal formatoptions-=t formatoptions+=croql
|
| 18 |
+
|
| 19 |
+
let &cpo = s:cpo_save
|
| 20 |
+
unlet s:cpo_save
|
git/usr/share/vim/vim92/ftplugin/sml.vim
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: SML
|
| 3 |
+
" Filenames: *.sml *.sig
|
| 4 |
+
" Maintainer: tocariimaa <tocariimaa@firemail.cc>
|
| 5 |
+
" Last Change: 2025 Nov 04
|
| 6 |
+
" 2026 Jan 19 by Vim Project: add 'include' setting
|
| 7 |
+
|
| 8 |
+
if exists('b:did_ftplugin')
|
| 9 |
+
finish
|
| 10 |
+
endif
|
| 11 |
+
let b:did_ftplugin = 1
|
| 12 |
+
|
| 13 |
+
let s:cpo_save = &cpo
|
| 14 |
+
set cpo&vim
|
| 15 |
+
|
| 16 |
+
let b:undo_ftplugin = 'setl com< cms< fo< inc<'
|
| 17 |
+
|
| 18 |
+
setlocal formatoptions+=croql formatoptions-=t
|
| 19 |
+
setlocal commentstring=(*\ %s\ *)
|
| 20 |
+
setlocal comments=sr:(*,mb:*,ex:*)
|
| 21 |
+
setlocal include=^\\s*use\\>
|
| 22 |
+
|
| 23 |
+
if exists('loaded_matchit')
|
| 24 |
+
let b:match_ignorecase = 0
|
| 25 |
+
let b:match_words = '\<\%(abstype\|let\|local\|sig\|struct\)\>:\<\%(in\|with\)\>:\<end\>'
|
| 26 |
+
let b:undo_ftplugin ..= ' | unlet! b:match_ignorecase b:match_words'
|
| 27 |
+
endif
|
| 28 |
+
|
| 29 |
+
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
| 30 |
+
let b:browsefilter = "SML Source Files (*.sml)\t*.sml\n" ..
|
| 31 |
+
\ "SML Signature Files (*.sig)\t*.sig\n"
|
| 32 |
+
if has("win32")
|
| 33 |
+
let b:browsefilter ..= "All Files (*.*)\t*\n"
|
| 34 |
+
else
|
| 35 |
+
let b:browsefilter ..= "All Files (*)\t*\n"
|
| 36 |
+
endif
|
| 37 |
+
let b:undo_ftplugin ..= " | unlet! b:browsefilter"
|
| 38 |
+
endif
|
| 39 |
+
|
| 40 |
+
let &cpo = s:cpo_save
|
| 41 |
+
unlet s:cpo_save
|
git/usr/share/vim/vim92/ftplugin/snakemake.vim
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin
|
| 2 |
+
" Language: snakemake
|
| 3 |
+
" Maintainer: Riley Bruins <ribru17@gmail.com>
|
| 4 |
+
" Last Change: 2024 Jun 13
|
| 5 |
+
|
| 6 |
+
if exists('b:did_ftplugin')
|
| 7 |
+
finish
|
| 8 |
+
endif
|
| 9 |
+
let b:did_ftplugin = 1
|
| 10 |
+
|
| 11 |
+
setl comments=:# commentstring=#\ %s
|
| 12 |
+
|
| 13 |
+
let b:undo_ftplugin = 'setl com< cms<'
|
git/usr/share/vim/vim92/ftplugin/solidity.vim
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: Solidity
|
| 3 |
+
" Maintainer: Cothi (jiungdev@gmail.com)
|
| 4 |
+
" Original Author: tomlion (https://github.com/tomlion/vim-solidity)
|
| 5 |
+
" Last Change: 2022 Sep 27
|
| 6 |
+
" 2023 Aug 22 Vim Project (did_ftplugin, undo_ftplugin)
|
| 7 |
+
|
| 8 |
+
if exists("b:did_ftplugin")
|
| 9 |
+
finish
|
| 10 |
+
endif
|
| 11 |
+
let b:did_ftplugin = 1
|
| 12 |
+
|
| 13 |
+
setlocal commentstring=//\ %s
|
| 14 |
+
|
| 15 |
+
let b:undo_ftplugin = "setlocal commentstring<"
|
git/usr/share/vim/vim92/ftplugin/solution.vim
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: Microsoft Visual Studio Solution
|
| 3 |
+
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
| 4 |
+
" Last Change: 2024 Jan 14
|
| 5 |
+
|
| 6 |
+
if exists("b:did_ftplugin")
|
| 7 |
+
finish
|
| 8 |
+
endif
|
| 9 |
+
let b:did_ftplugin = 1
|
| 10 |
+
|
| 11 |
+
let s:cpo_save = &cpo
|
| 12 |
+
set cpo&vim
|
| 13 |
+
|
| 14 |
+
setlocal comments=:#
|
| 15 |
+
setlocal commentstring=#\ %s
|
| 16 |
+
|
| 17 |
+
let b:undo_ftplugin = "setl com< cms<"
|
| 18 |
+
|
| 19 |
+
if exists("loaded_matchit") && !exists("b:match_words")
|
| 20 |
+
let b:match_words =
|
| 21 |
+
\ '\<Project\>:\<EndProject\>,' ..
|
| 22 |
+
\ '\<ProjectSection\>:\<EndProjectSection\>,' ..
|
| 23 |
+
\ '\<Global\>:\<EndGlobal\>,' ..
|
| 24 |
+
\ '\<GlobalSection\>:\<EndGlobalSection\>'
|
| 25 |
+
let b:undo_ftplugin ..= " | unlet! b:match_words"
|
| 26 |
+
endif
|
| 27 |
+
|
| 28 |
+
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
| 29 |
+
let b:browsefilter = "Microsoft Visual Studio Solution Files(*.sln)\t*.sln\n"
|
| 30 |
+
if has("win32")
|
| 31 |
+
let b:browsefilter ..= "All Files (*.*)\t*\n"
|
| 32 |
+
else
|
| 33 |
+
let b:browsefilter ..= "All Files (*)\t*\n"
|
| 34 |
+
endif
|
| 35 |
+
let b:undo_ftplugin ..= " | unlet! b:browsefilter"
|
| 36 |
+
endif
|
| 37 |
+
|
| 38 |
+
let &cpo = s:cpo_save
|
| 39 |
+
unlet s:cpo_save
|
| 40 |
+
|
| 41 |
+
" vim: nowrap sw=2 sts=2 ts=8 noet:
|
git/usr/share/vim/vim92/ftplugin/soy.vim
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin
|
| 2 |
+
" Language: Soy (Closure Templates)
|
| 3 |
+
" Maintainer: Riley Bruins <ribru17@gmail.com>
|
| 4 |
+
" Last Change: 2025 Oct 24
|
| 5 |
+
|
| 6 |
+
if exists('b:did_ftplugin')
|
| 7 |
+
finish
|
| 8 |
+
endif
|
| 9 |
+
let b:did_ftplugin = 1
|
| 10 |
+
|
| 11 |
+
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
|
| 12 |
+
setlocal commentstring=//\ %s
|
| 13 |
+
|
| 14 |
+
let b:undo_ftplugin = "setlocal comments< commentstring<"
|
git/usr/share/vim/vim92/ftplugin/spajson.vim
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin
|
| 2 |
+
" Language: SPA JSON
|
| 3 |
+
" Maintainer: David Mandelberg <david@mandelberg.org>
|
| 4 |
+
" Last Change: 2025 Mar 22
|
| 5 |
+
|
| 6 |
+
if exists('b:did_ftplugin')
|
| 7 |
+
finish
|
| 8 |
+
endif
|
| 9 |
+
let b:did_ftplugin = 1
|
| 10 |
+
|
| 11 |
+
setlocal comments=:###,:##,:#
|
| 12 |
+
setlocal commentstring=#\ %s
|
| 13 |
+
|
| 14 |
+
let b:undo_ftplugin = "setlocal comments< commentstring<"
|
git/usr/share/vim/vim92/ftplugin/spec.vim
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Plugin to update the %changelog section of RPM spec files
|
| 2 |
+
" Filename: spec.vim
|
| 3 |
+
" Maintainer: Igor Gnatenko i.gnatenko.brain@gmail.com
|
| 4 |
+
" Former Maintainer: Gustavo Niemeyer <niemeyer@conectiva.com> (until March 2014)
|
| 5 |
+
" Last Change: 2015 Jun 01
|
| 6 |
+
" Update by Zdenek Dohnal, 2022 May 17
|
| 7 |
+
" 2024 Sep 10 by Vim Project: add epoch support for spec changelog, #15537
|
| 8 |
+
" 2024 Oct 07 by Vim Project: add comment support, #15817
|
| 9 |
+
|
| 10 |
+
if exists("b:did_ftplugin")
|
| 11 |
+
finish
|
| 12 |
+
endif
|
| 13 |
+
let b:did_ftplugin = 1
|
| 14 |
+
|
| 15 |
+
let s:cpo_save = &cpo
|
| 16 |
+
set cpo&vim
|
| 17 |
+
|
| 18 |
+
setlocal comments=b:#
|
| 19 |
+
setlocal commentstring=#\ %s
|
| 20 |
+
|
| 21 |
+
let b:undo_ftplugin = "setlocal comments< commentstring<"
|
| 22 |
+
|
| 23 |
+
if !exists("no_plugin_maps") && !exists("no_spec_maps")
|
| 24 |
+
if !hasmapto("<Plug>SpecChangelog")
|
| 25 |
+
map <buffer> <LocalLeader>c <Plug>SpecChangelog
|
| 26 |
+
endif
|
| 27 |
+
endif
|
| 28 |
+
|
| 29 |
+
if !hasmapto("call <SID>SpecChangelog(\"\")<CR>")
|
| 30 |
+
noremap <buffer> <unique> <script> <Plug>SpecChangelog :call <SID>SpecChangelog("")<CR>
|
| 31 |
+
endif
|
| 32 |
+
|
| 33 |
+
if !exists("*s:GetRelVer")
|
| 34 |
+
function! s:GetRelVer()
|
| 35 |
+
if has('python')
|
| 36 |
+
python << PYEND
|
| 37 |
+
import sys, datetime, shutil, tempfile
|
| 38 |
+
import vim
|
| 39 |
+
|
| 40 |
+
try:
|
| 41 |
+
import rpm
|
| 42 |
+
except ImportError:
|
| 43 |
+
pass
|
| 44 |
+
else:
|
| 45 |
+
specfile = vim.current.buffer.name
|
| 46 |
+
if specfile:
|
| 47 |
+
rpm.delMacro("dist")
|
| 48 |
+
spec = rpm.spec(specfile)
|
| 49 |
+
headers = spec.sourceHeader
|
| 50 |
+
version = headers["Version"]
|
| 51 |
+
release = headers["Release"]
|
| 52 |
+
vim.command("let ver = '" + version + "'")
|
| 53 |
+
vim.command("let rel = '" + release + "'")
|
| 54 |
+
PYEND
|
| 55 |
+
endif
|
| 56 |
+
endfunction
|
| 57 |
+
endif
|
| 58 |
+
|
| 59 |
+
if !exists("*s:SpecChangelog")
|
| 60 |
+
function s:SpecChangelog(format)
|
| 61 |
+
if strlen(a:format) == 0
|
| 62 |
+
if !exists("g:spec_chglog_format")
|
| 63 |
+
let email = input("Name <email address>: ")
|
| 64 |
+
let g:spec_chglog_format = "%a %b %d %Y " . l:email
|
| 65 |
+
echo "\r"
|
| 66 |
+
endif
|
| 67 |
+
let format = g:spec_chglog_format
|
| 68 |
+
else
|
| 69 |
+
if !exists("g:spec_chglog_format")
|
| 70 |
+
let g:spec_chglog_format = a:format
|
| 71 |
+
endif
|
| 72 |
+
let format = a:format
|
| 73 |
+
endif
|
| 74 |
+
let line = 0
|
| 75 |
+
let name = ""
|
| 76 |
+
let epoch = ""
|
| 77 |
+
let ver = ""
|
| 78 |
+
let rel = ""
|
| 79 |
+
let nameline = -1
|
| 80 |
+
let epochline = -1
|
| 81 |
+
let verline = -1
|
| 82 |
+
let relline = -1
|
| 83 |
+
let chgline = -1
|
| 84 |
+
while (line <= line("$"))
|
| 85 |
+
let linestr = getline(line)
|
| 86 |
+
if name == "" && linestr =~? '^Name:'
|
| 87 |
+
let nameline = line
|
| 88 |
+
let name = substitute(strpart(linestr,5), '^[ ]*\([^ ]\+\)[ ]*$','\1','')
|
| 89 |
+
elseif epoch == "" && linestr =~? '^Epoch:'
|
| 90 |
+
let epochline = line
|
| 91 |
+
let epoch = substitute(strpart(linestr,6), '^[ ]*\([^ ]\+\)[ ]*$','\1','')
|
| 92 |
+
elseif ver == "" && linestr =~? '^Version:'
|
| 93 |
+
let verline = line
|
| 94 |
+
let ver = substitute(strpart(linestr,8), '^[ ]*\([^ ]\+\)[ ]*$','\1','')
|
| 95 |
+
elseif rel == "" && linestr =~? '^Release:'
|
| 96 |
+
let relline = line
|
| 97 |
+
let rel = substitute(strpart(linestr,8), '^[ ]*\([^ ]\+\)[ ]*$','\1','')
|
| 98 |
+
elseif linestr =~? '^%changelog'
|
| 99 |
+
let chgline = line
|
| 100 |
+
execute line
|
| 101 |
+
break
|
| 102 |
+
endif
|
| 103 |
+
let line = line+1
|
| 104 |
+
endwhile
|
| 105 |
+
if nameline != -1 && verline != -1 && relline != -1
|
| 106 |
+
let include_release_info = exists("g:spec_chglog_release_info")
|
| 107 |
+
let name = s:ParseRpmVars(name, nameline)
|
| 108 |
+
let epoch = s:ParseRpmVars(epoch, epochline)
|
| 109 |
+
let ver = s:ParseRpmVars(ver, verline)
|
| 110 |
+
let rel = s:ParseRpmVars(rel, relline)
|
| 111 |
+
else
|
| 112 |
+
let include_release_info = 0
|
| 113 |
+
endif
|
| 114 |
+
|
| 115 |
+
call s:GetRelVer()
|
| 116 |
+
|
| 117 |
+
if chgline == -1
|
| 118 |
+
let option = confirm("Can't find %changelog. Create one? ","&End of file\n&Here\n&Cancel",3)
|
| 119 |
+
if option == 1
|
| 120 |
+
call append(line("$"),"")
|
| 121 |
+
call append(line("$"),"%changelog")
|
| 122 |
+
execute line("$")
|
| 123 |
+
let chgline = line(".")
|
| 124 |
+
elseif option == 2
|
| 125 |
+
call append(line("."),"%changelog")
|
| 126 |
+
normal j
|
| 127 |
+
let chgline = line(".")
|
| 128 |
+
endif
|
| 129 |
+
endif
|
| 130 |
+
if chgline != -1
|
| 131 |
+
let tmptime = v:lc_time
|
| 132 |
+
language time C
|
| 133 |
+
if strlen(epoch)
|
| 134 |
+
let ver = epoch.":".ver
|
| 135 |
+
endif
|
| 136 |
+
let parsed_format = "* ".strftime(format)." - ".ver."-".rel
|
| 137 |
+
execute "language time" tmptime
|
| 138 |
+
let release_info = "+ ".name."-".ver."-".rel
|
| 139 |
+
let wrong_format = 0
|
| 140 |
+
let wrong_release = 0
|
| 141 |
+
let insert_line = 0
|
| 142 |
+
if getline(chgline+1) != parsed_format
|
| 143 |
+
let wrong_format = 1
|
| 144 |
+
endif
|
| 145 |
+
if include_release_info && getline(chgline+2) != release_info
|
| 146 |
+
let wrong_release = 1
|
| 147 |
+
endif
|
| 148 |
+
if wrong_format || wrong_release
|
| 149 |
+
if include_release_info && !wrong_release && !exists("g:spec_chglog_never_increase_release")
|
| 150 |
+
let option = confirm("Increase release? ","&Yes\n&No",1)
|
| 151 |
+
if option == 1
|
| 152 |
+
execute relline
|
| 153 |
+
normal
|
| 154 |
+
let rel = substitute(strpart(getline(relline),8), '^[ ]*\([^ ]\+\)[ ]*$','\1','')
|
| 155 |
+
let release_info = "+ ".name."-".ver."-".rel
|
| 156 |
+
endif
|
| 157 |
+
endif
|
| 158 |
+
let n = 0
|
| 159 |
+
call append(chgline+n, parsed_format)
|
| 160 |
+
if include_release_info
|
| 161 |
+
let n = n + 1
|
| 162 |
+
call append(chgline+n, release_info)
|
| 163 |
+
endif
|
| 164 |
+
let n = n + 1
|
| 165 |
+
call append(chgline+n,"- ")
|
| 166 |
+
let n = n + 1
|
| 167 |
+
call append(chgline+n,"")
|
| 168 |
+
let insert_line = chgline+n
|
| 169 |
+
else
|
| 170 |
+
let line = chgline
|
| 171 |
+
if !exists("g:spec_chglog_prepend")
|
| 172 |
+
while !(getline(line+2) =~ '^\( *\|\*.*\)$')
|
| 173 |
+
let line = line+1
|
| 174 |
+
endwhile
|
| 175 |
+
endif
|
| 176 |
+
call append(line+1,"- ")
|
| 177 |
+
let insert_line = line+2
|
| 178 |
+
endif
|
| 179 |
+
execute insert_line
|
| 180 |
+
startinsert!
|
| 181 |
+
endif
|
| 182 |
+
endfunction
|
| 183 |
+
endif
|
| 184 |
+
|
| 185 |
+
if !exists("*s:ParseRpmVars")
|
| 186 |
+
function s:ParseRpmVars(str, strline)
|
| 187 |
+
let end = -1
|
| 188 |
+
let ret = ""
|
| 189 |
+
while (1)
|
| 190 |
+
let start = match(a:str, "\%{", end+1)
|
| 191 |
+
if start == -1
|
| 192 |
+
let ret = ret . strpart(a:str, end+1)
|
| 193 |
+
break
|
| 194 |
+
endif
|
| 195 |
+
let ret = ret . strpart(a:str, end+1, start-(end+1))
|
| 196 |
+
let end = match(a:str, "}", start)
|
| 197 |
+
if end == -1
|
| 198 |
+
let ret = ret . strpart(a:str, start)
|
| 199 |
+
break
|
| 200 |
+
endif
|
| 201 |
+
let varname = strpart(a:str, start+2, end-(start+2))
|
| 202 |
+
execute a:strline
|
| 203 |
+
let definestr = "^[ \t]*%\\(define\\|global\\)[ \t]\\+".varname."[ \t]\\+\\(.*\\)$"
|
| 204 |
+
let linenum = search(definestr, "bW")
|
| 205 |
+
if linenum != 0
|
| 206 |
+
let ret = ret . substitute(getline(linenum), definestr, "\\2", "")
|
| 207 |
+
endif
|
| 208 |
+
endwhile
|
| 209 |
+
return ret
|
| 210 |
+
endfunction
|
| 211 |
+
endif
|
| 212 |
+
|
| 213 |
+
" The following lines, along with the macros/matchit.vim plugin,
|
| 214 |
+
" make it easy to navigate the different sections of a spec file
|
| 215 |
+
" with the % key (thanks to Max Ischenko).
|
| 216 |
+
|
| 217 |
+
let b:match_ignorecase = 0
|
| 218 |
+
let b:match_words =
|
| 219 |
+
\ '^Name:^%description:^%clean:^%(?:auto)?setup:^%build:^%install:^%files:' .
|
| 220 |
+
\ '^%package:^%preun:^%postun:^%changelog'
|
| 221 |
+
|
| 222 |
+
let &cpo = s:cpo_save
|
| 223 |
+
unlet s:cpo_save
|
| 224 |
+
|
| 225 |
+
let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words"
|
git/usr/share/vim/vim92/ftplugin/sql.vim
ADDED
|
@@ -0,0 +1,550 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" SQL filetype plugin file
|
| 2 |
+
" Language: SQL (Common for Oracle, Microsoft SQL Server, Sybase)
|
| 3 |
+
" Version: 12.0
|
| 4 |
+
" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
|
| 5 |
+
" Last Change: 2017 Mar 07
|
| 6 |
+
" 2024 Jan 14 by Vim Project: browsefilter
|
| 7 |
+
" 2024 May 18 by Vim Project: set comment options
|
| 8 |
+
" 2024 Aug 14 by Vim Project: remove redundant code
|
| 9 |
+
" Download: http://vim.sourceforge.net/script.php?script_id=454
|
| 10 |
+
|
| 11 |
+
" For more details please use:
|
| 12 |
+
" :h sql.txt
|
| 13 |
+
"
|
| 14 |
+
" This file should only contain values that are common to all SQL languages
|
| 15 |
+
" Oracle, Microsoft SQL Server, Sybase ASA/ASE, MySQL, and so on
|
| 16 |
+
" If additional features are required create:
|
| 17 |
+
" vimfiles/after/ftplugin/sql.vim (Windows)
|
| 18 |
+
" .vim/after/ftplugin/sql.vim (Unix)
|
| 19 |
+
" to override and add any of your own settings.
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
" This file also creates a command, SQLSetType, which allows you to change
|
| 23 |
+
" SQL dialects on the fly. For example, if I open an Oracle SQL file, it
|
| 24 |
+
" is color highlighted appropriately. If I open an Informix SQL file, it
|
| 25 |
+
" will still be highlighted according to Oracles settings. By running:
|
| 26 |
+
" :SQLSetType sqlinformix
|
| 27 |
+
"
|
| 28 |
+
" All files called sqlinformix.vim will be loaded from the indent and syntax
|
| 29 |
+
" directories. This allows you to easily flip SQL dialects on a per file
|
| 30 |
+
" basis. NOTE: you can also use completion:
|
| 31 |
+
" :SQLSetType <tab>
|
| 32 |
+
"
|
| 33 |
+
" To change the default dialect, add the following to your vimrc:
|
| 34 |
+
" let g:sql_type_default = 'sqlanywhere'
|
| 35 |
+
"
|
| 36 |
+
" This file also creates a command, SQLGetType, which allows you to
|
| 37 |
+
" determine what the current dialect is in use.
|
| 38 |
+
" :SQLGetType
|
| 39 |
+
"
|
| 40 |
+
" History
|
| 41 |
+
"
|
| 42 |
+
" Version 12.0 (April 2013)
|
| 43 |
+
"
|
| 44 |
+
" NF: Added support for "BEGIN TRY ... END TRY ... BEGIN CATCH ... END CATCH
|
| 45 |
+
" BF: This plugin is designed to be used with other plugins to enable the
|
| 46 |
+
" SQL completion with Perl, Python, Java, ... The loading mechanism
|
| 47 |
+
" was not checking if the SQL objects were created, which can lead to
|
| 48 |
+
" the plugin not loading the SQL support.
|
| 49 |
+
"
|
| 50 |
+
" Version 11.0 (May 2013)
|
| 51 |
+
"
|
| 52 |
+
" NF: Updated to use SyntaxComplete's new regex support for syntax groups.
|
| 53 |
+
"
|
| 54 |
+
" Version 10.0 (Dec 2012)
|
| 55 |
+
"
|
| 56 |
+
" NF: Changed all maps to use noremap instead of must map
|
| 57 |
+
" NF: Changed all visual maps to use xnoremap instead of vnoremap as they
|
| 58 |
+
" should only be used in visual mode and not select mode.
|
| 59 |
+
" BF: Most of the maps were using doubled up backslashes before they were
|
| 60 |
+
" changed to using the search() function, which meant they no longer
|
| 61 |
+
" worked.
|
| 62 |
+
"
|
| 63 |
+
" Version 9.0
|
| 64 |
+
"
|
| 65 |
+
" NF: Completes 'b:undo_ftplugin'
|
| 66 |
+
" BF: Correctly set cpoptions when creating script
|
| 67 |
+
"
|
| 68 |
+
" Version 8.0
|
| 69 |
+
"
|
| 70 |
+
" NF: Improved the matchit plugin regex (Talek)
|
| 71 |
+
"
|
| 72 |
+
" Version 7.0
|
| 73 |
+
"
|
| 74 |
+
" NF: Calls the sqlcomplete#ResetCacheSyntax() function when calling
|
| 75 |
+
" SQLSetType.
|
| 76 |
+
"
|
| 77 |
+
" Version 6.0
|
| 78 |
+
"
|
| 79 |
+
" NF: Adds the command SQLGetType
|
| 80 |
+
"
|
| 81 |
+
" Version 5.0
|
| 82 |
+
"
|
| 83 |
+
" NF: Adds the ability to choose the keys to control SQL completion, just add
|
| 84 |
+
" the following to your .vimrc:
|
| 85 |
+
" let g:ftplugin_sql_omni_key = '<C-C>'
|
| 86 |
+
" let g:ftplugin_sql_omni_key_right = '<Right>'
|
| 87 |
+
" let g:ftplugin_sql_omni_key_left = '<Left>'
|
| 88 |
+
"
|
| 89 |
+
" BF: format-options - Auto-wrap comments using textwidth was turned off
|
| 90 |
+
" by mistake.
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
" Only do this when not done yet for this buffer
|
| 94 |
+
" This ftplugin can be used with other ftplugins. So ensure loading
|
| 95 |
+
" happens if all elements of this plugin have not yet loaded.
|
| 96 |
+
if exists("b:did_ftplugin")
|
| 97 |
+
finish
|
| 98 |
+
endif
|
| 99 |
+
|
| 100 |
+
" Don't load another plugin for this buffer
|
| 101 |
+
let b:did_ftplugin = 1
|
| 102 |
+
|
| 103 |
+
let s:save_cpo = &cpo
|
| 104 |
+
set cpo&vim
|
| 105 |
+
|
| 106 |
+
let b:undo_ftplugin = "setl comments< commentstring< formatoptions< define< omnifunc<" .
|
| 107 |
+
\ " | unlet! b:browsefilter b:match_words"
|
| 108 |
+
|
| 109 |
+
" Disable autowrapping for code, but enable for comments
|
| 110 |
+
" t Auto-wrap text using textwidth
|
| 111 |
+
" c Auto-wrap comments using textwidth, inserting the current comment
|
| 112 |
+
" leader automatically.
|
| 113 |
+
setlocal formatoptions-=t
|
| 114 |
+
setlocal formatoptions+=c
|
| 115 |
+
|
| 116 |
+
setlocal comments=:-- commentstring=--\ %s
|
| 117 |
+
|
| 118 |
+
" Functions/Commands to allow the user to change SQL syntax dialects
|
| 119 |
+
" through the use of :SQLSetType <tab> for completion.
|
| 120 |
+
" This works with both Vim 6 and 7.
|
| 121 |
+
|
| 122 |
+
if !exists("*SQL_SetType")
|
| 123 |
+
" NOTE: You cannot use function! since this file can be
|
| 124 |
+
" sourced from within this function. That will result in
|
| 125 |
+
" an error reported by Vim.
|
| 126 |
+
function SQL_GetList(ArgLead, CmdLine, CursorPos)
|
| 127 |
+
|
| 128 |
+
if !exists('s:sql_list')
|
| 129 |
+
" Grab a list of files that contain "sql" in their names
|
| 130 |
+
let list_indent = globpath(&runtimepath, 'indent/*sql*')
|
| 131 |
+
let list_syntax = globpath(&runtimepath, 'syntax/*sql*')
|
| 132 |
+
let list_ftplugin = globpath(&runtimepath, 'ftplugin/*sql*')
|
| 133 |
+
|
| 134 |
+
let sqls = "\n".list_indent."\n".list_syntax."\n".list_ftplugin."\n"
|
| 135 |
+
|
| 136 |
+
" Strip out everything (path info) but the filename
|
| 137 |
+
" Regex
|
| 138 |
+
" From between two newline characters
|
| 139 |
+
" Non-greedily grab all characters
|
| 140 |
+
" Followed by a valid filename \w\+\.\w\+ (sql.vim)
|
| 141 |
+
" Followed by a newline, but do not include the newline
|
| 142 |
+
"
|
| 143 |
+
" Replace it with just the filename (get rid of PATH)
|
| 144 |
+
"
|
| 145 |
+
" Recursively, since there are many filenames that contain
|
| 146 |
+
" the word SQL in the indent, syntax and ftplugin directory
|
| 147 |
+
let sqls = substitute( sqls,
|
| 148 |
+
\ '[\n]\%(.\{-}\)\(\w\+\.\w\+\)\n\@=',
|
| 149 |
+
\ '\1\n',
|
| 150 |
+
\ 'g'
|
| 151 |
+
\ )
|
| 152 |
+
|
| 153 |
+
" Remove duplicates, since sqlanywhere.vim can exist in the
|
| 154 |
+
" syntax, indent and ftplugin directory, yet we only want
|
| 155 |
+
" to display the option once
|
| 156 |
+
let index = match(sqls, '.\{-}\ze\n')
|
| 157 |
+
while index > -1
|
| 158 |
+
" Get the first filename
|
| 159 |
+
let file = matchstr(sqls, '.\{-}\ze\n', index)
|
| 160 |
+
" Recursively replace any *other* occurrence of that
|
| 161 |
+
" filename with nothing (ie remove it)
|
| 162 |
+
let sqls = substitute(sqls, '\%>'.(index+strlen(file)).'c\<'.file.'\>\n', '', 'g')
|
| 163 |
+
" Move on to the next filename
|
| 164 |
+
let index = match(sqls, '.\{-}\ze\n', (index+strlen(file)+1))
|
| 165 |
+
endwhile
|
| 166 |
+
|
| 167 |
+
" Sort the list if using version 7
|
| 168 |
+
if v:version >= 700
|
| 169 |
+
let mylist = split(sqls, "\n")
|
| 170 |
+
let mylist = sort(mylist)
|
| 171 |
+
let sqls = join(mylist, "\n")
|
| 172 |
+
endif
|
| 173 |
+
|
| 174 |
+
let s:sql_list = sqls
|
| 175 |
+
endif
|
| 176 |
+
|
| 177 |
+
return s:sql_list
|
| 178 |
+
|
| 179 |
+
endfunction
|
| 180 |
+
|
| 181 |
+
function SQL_SetType(name)
|
| 182 |
+
|
| 183 |
+
" User has decided to override default SQL scripts and
|
| 184 |
+
" specify a vendor specific version
|
| 185 |
+
" (ie Oracle, Informix, SQL Anywhere, ...)
|
| 186 |
+
" So check for an remove any settings that prevent the
|
| 187 |
+
" scripts from being executed, and then source the
|
| 188 |
+
" appropriate Vim scripts.
|
| 189 |
+
if exists("b:did_ftplugin")
|
| 190 |
+
unlet b:did_ftplugin
|
| 191 |
+
endif
|
| 192 |
+
if exists("b:current_syntax")
|
| 193 |
+
" echomsg 'SQLSetType - clearing syntax'
|
| 194 |
+
syntax clear
|
| 195 |
+
if exists("b:current_syntax")
|
| 196 |
+
unlet b:current_syntax
|
| 197 |
+
endif
|
| 198 |
+
endif
|
| 199 |
+
if exists("b:did_indent")
|
| 200 |
+
" echomsg 'SQLSetType - clearing indent'
|
| 201 |
+
unlet b:did_indent
|
| 202 |
+
" Set these values to their defaults
|
| 203 |
+
setlocal indentkeys&
|
| 204 |
+
setlocal indentexpr&
|
| 205 |
+
endif
|
| 206 |
+
|
| 207 |
+
" Ensure the name is in the correct format
|
| 208 |
+
let new_sql_type = substitute(a:name,
|
| 209 |
+
\ '\s*\([^\.]\+\)\(\.\w\+\)\?', '\L\1', '')
|
| 210 |
+
|
| 211 |
+
" Do not specify a buffer local variable if it is
|
| 212 |
+
" the default value
|
| 213 |
+
if new_sql_type == 'sql'
|
| 214 |
+
let new_sql_type = 'sqloracle'
|
| 215 |
+
endif
|
| 216 |
+
let b:sql_type_override = new_sql_type
|
| 217 |
+
|
| 218 |
+
" Remove any cached SQL since a new syntax will have different
|
| 219 |
+
" items and groups
|
| 220 |
+
if !exists('g:loaded_sql_completion') || g:loaded_sql_completion >= 100
|
| 221 |
+
call sqlcomplete#ResetCacheSyntax()
|
| 222 |
+
endif
|
| 223 |
+
|
| 224 |
+
" Vim will automatically source the correct files if we
|
| 225 |
+
" change the filetype. You cannot do this with setfiletype
|
| 226 |
+
" since that command will only execute if a filetype has
|
| 227 |
+
" not already been set. In this case we want to override
|
| 228 |
+
" the existing filetype.
|
| 229 |
+
let &filetype = 'sql'
|
| 230 |
+
|
| 231 |
+
if b:sql_compl_savefunc != ""
|
| 232 |
+
" We are changing the filetype to SQL from some other filetype
|
| 233 |
+
" which had OMNI completion defined. We need to activate the
|
| 234 |
+
" SQL completion plugin in order to cache some of the syntax items
|
| 235 |
+
" while the syntax rules for SQL are active.
|
| 236 |
+
call sqlcomplete#PreCacheSyntax()
|
| 237 |
+
endif
|
| 238 |
+
endfunction
|
| 239 |
+
command! -nargs=* -complete=custom,SQL_GetList SQLSetType :call SQL_SetType(<q-args>)
|
| 240 |
+
|
| 241 |
+
endif
|
| 242 |
+
|
| 243 |
+
" Functions/Commands to allow the user determine current SQL syntax dialect
|
| 244 |
+
" This works with both Vim 6 and 7.
|
| 245 |
+
|
| 246 |
+
if !exists("*SQL_GetType")
|
| 247 |
+
function SQL_GetType()
|
| 248 |
+
if exists('b:sql_type_override')
|
| 249 |
+
echomsg "Current SQL dialect in use:".b:sql_type_override
|
| 250 |
+
else
|
| 251 |
+
echomsg "Current SQL dialect in use:".g:sql_type_default
|
| 252 |
+
endif
|
| 253 |
+
endfunction
|
| 254 |
+
command! -nargs=0 SQLGetType :call SQL_GetType()
|
| 255 |
+
endif
|
| 256 |
+
|
| 257 |
+
if exists("b:sql_type_override")
|
| 258 |
+
" echo 'sourcing buffer ftplugin/'.b:sql_type_override.'.vim'
|
| 259 |
+
if globpath(&runtimepath, 'ftplugin/'.b:sql_type_override.'.vim') != ''
|
| 260 |
+
exec 'runtime ftplugin/'.b:sql_type_override.'.vim'
|
| 261 |
+
" else
|
| 262 |
+
" echomsg 'ftplugin/'.b:sql_type_override.' not exist, using default'
|
| 263 |
+
endif
|
| 264 |
+
elseif exists("g:sql_type_default")
|
| 265 |
+
" echo 'sourcing global ftplugin/'.g:sql_type_default.'.vim'
|
| 266 |
+
if globpath(&runtimepath, 'ftplugin/'.g:sql_type_default.'.vim') != ''
|
| 267 |
+
exec 'runtime ftplugin/'.g:sql_type_default.'.vim'
|
| 268 |
+
" else
|
| 269 |
+
" echomsg 'ftplugin/'.g:sql_type_default.'.vim not exist, using default'
|
| 270 |
+
endif
|
| 271 |
+
endif
|
| 272 |
+
|
| 273 |
+
" Win32 and GTK can filter files in the browse dialog
|
| 274 |
+
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
| 275 |
+
let b:browsefilter = "SQL Files (*.sql)\t*.sql\n"
|
| 276 |
+
if has("win32")
|
| 277 |
+
let b:browsefilter .= "All Files (*.*)\t*\n"
|
| 278 |
+
else
|
| 279 |
+
let b:browsefilter .= "All Files (*)\t*\n"
|
| 280 |
+
endif
|
| 281 |
+
endif
|
| 282 |
+
|
| 283 |
+
" Some standard expressions for use with the matchit strings
|
| 284 |
+
let s:notend = '\%(\<end\s\+\)\@<!'
|
| 285 |
+
let s:when_no_matched_or_others = '\%(\<when\>\%(\s\+\%(\%(\<not\>\s\+\)\?<matched\>\)\|\<others\>\)\@!\)'
|
| 286 |
+
let s:or_replace = '\%(or\s\+replace\s\+\)\?'
|
| 287 |
+
|
| 288 |
+
" Define patterns for the matchit macro
|
| 289 |
+
if !exists("b:match_words")
|
| 290 |
+
" SQL is generally case insensitive
|
| 291 |
+
let b:match_ignorecase = 1
|
| 292 |
+
|
| 293 |
+
" Handle the following:
|
| 294 |
+
" if
|
| 295 |
+
" elseif | elsif
|
| 296 |
+
" else [if]
|
| 297 |
+
" end if
|
| 298 |
+
"
|
| 299 |
+
" [while condition] loop
|
| 300 |
+
" leave
|
| 301 |
+
" break
|
| 302 |
+
" continue
|
| 303 |
+
" exit
|
| 304 |
+
" end loop
|
| 305 |
+
"
|
| 306 |
+
" for
|
| 307 |
+
" leave
|
| 308 |
+
" break
|
| 309 |
+
" continue
|
| 310 |
+
" exit
|
| 311 |
+
" end loop
|
| 312 |
+
"
|
| 313 |
+
" do
|
| 314 |
+
" statements
|
| 315 |
+
" doend
|
| 316 |
+
"
|
| 317 |
+
" case
|
| 318 |
+
" when
|
| 319 |
+
" when
|
| 320 |
+
" default
|
| 321 |
+
" end case
|
| 322 |
+
"
|
| 323 |
+
" merge
|
| 324 |
+
" when not matched
|
| 325 |
+
" when matched
|
| 326 |
+
"
|
| 327 |
+
" EXCEPTION
|
| 328 |
+
" WHEN column_not_found THEN
|
| 329 |
+
" WHEN OTHERS THEN
|
| 330 |
+
"
|
| 331 |
+
" begin try
|
| 332 |
+
" end try
|
| 333 |
+
" begin catch
|
| 334 |
+
" end catch
|
| 335 |
+
"
|
| 336 |
+
" create[ or replace] procedure|function|event
|
| 337 |
+
" \ '^\s*\<\%(do\|for\|while\|loop\)\>.*:'.
|
| 338 |
+
|
| 339 |
+
" For ColdFusion support
|
| 340 |
+
setlocal matchpairs+=<:>
|
| 341 |
+
let b:match_words = &matchpairs .
|
| 342 |
+
\ ',\%(\<begin\)\%(\s\+\%(try\|catch\)\>\)\@!:\<end\>\W*$,'.
|
| 343 |
+
\
|
| 344 |
+
\ '\<begin\s\+try\>:'.
|
| 345 |
+
\ '\<end\s\+try\>:'.
|
| 346 |
+
\ '\<begin\s\+catch\>:'.
|
| 347 |
+
\ '\<end\s\+catch\>,'.
|
| 348 |
+
\
|
| 349 |
+
\ s:notend . '\<if\>:'.
|
| 350 |
+
\ '\<elsif\>\|\<elseif\>\|\<else\>:'.
|
| 351 |
+
\ '\<end\s\+if\>,'.
|
| 352 |
+
\
|
| 353 |
+
\ '\(^\s*\)\@<=\(\<\%(do\|for\|while\|loop\)\>.*\):'.
|
| 354 |
+
\ '\%(\<exit\>\|\<leave\>\|\<break\>\|\<continue\>\):'.
|
| 355 |
+
\ '\%(\<doend\>\|\%(\<end\s\+\%(for\|while\|loop\>\)\)\),'.
|
| 356 |
+
\
|
| 357 |
+
\ '\%('. s:notend . '\<case\>\):'.
|
| 358 |
+
\ '\%('.s:when_no_matched_or_others.'\):'.
|
| 359 |
+
\ '\%(\<when\s\+others\>\|\<end\s\+case\>\),' .
|
| 360 |
+
\
|
| 361 |
+
\ '\<merge\>:' .
|
| 362 |
+
\ '\<when\s\+not\s\+matched\>:' .
|
| 363 |
+
\ '\<when\s\+matched\>,' .
|
| 364 |
+
\
|
| 365 |
+
\ '\%(\<create\s\+' . s:or_replace . '\)\?'.
|
| 366 |
+
\ '\%(function\|procedure\|event\):'.
|
| 367 |
+
\ '\<returns\?\>'
|
| 368 |
+
" \ '\<begin\>\|\<returns\?\>:'.
|
| 369 |
+
" \ '\<end\>\(;\)\?\s*$'
|
| 370 |
+
" \ '\<exception\>:'.s:when_no_matched_or_others.
|
| 371 |
+
" \ ':\<when\s\+others\>,'.
|
| 372 |
+
"
|
| 373 |
+
" \ '\%(\<exception\>\|\%('. s:notend . '\<case\>\)\):'.
|
| 374 |
+
" \ '\%(\<default\>\|'.s:when_no_matched_or_others.'\):'.
|
| 375 |
+
" \ '\%(\%(\<when\s\+others\>\)\|\<end\s\+case\>\),' .
|
| 376 |
+
endif
|
| 377 |
+
|
| 378 |
+
" Define how to find the macro definition of a variable using the various
|
| 379 |
+
" [d, [D, [_CTRL_D and so on features
|
| 380 |
+
" Match these values ignoring case
|
| 381 |
+
" ie DECLARE varname INTEGER
|
| 382 |
+
let &l:define = '\c\<\(VARIABLE\|DECLARE\|IN\|OUT\|INOUT\)\>'
|
| 383 |
+
|
| 384 |
+
|
| 385 |
+
" Mappings to move to the next BEGIN ... END block
|
| 386 |
+
" \W - no characters or digits
|
| 387 |
+
nnoremap <buffer> <silent> ]] :call search('\c^\s*begin\>', 'W' )<CR>
|
| 388 |
+
nnoremap <buffer> <silent> [[ :call search('\c^\s*begin\>', 'bW' )<CR>
|
| 389 |
+
nnoremap <buffer> <silent> ][ :call search('\c^\s*end\W*$', 'W' )<CR>
|
| 390 |
+
nnoremap <buffer> <silent> [] :call search('\c^\s*end\W*$', 'bW' )<CR>
|
| 391 |
+
xnoremap <buffer> <silent> ]] :<C-U>exec "normal! gv"<Bar>call search('\c^\s*begin\>', 'W' )<CR>
|
| 392 |
+
xnoremap <buffer> <silent> [[ :<C-U>exec "normal! gv"<Bar>call search('\c^\s*begin\>', 'bW' )<CR>
|
| 393 |
+
xnoremap <buffer> <silent> ][ :<C-U>exec "normal! gv"<Bar>call search('\c^\s*end\W*$', 'W' )<CR>
|
| 394 |
+
xnoremap <buffer> <silent> [] :<C-U>exec "normal! gv"<Bar>call search('\c^\s*end\W*$', 'bW' )<CR>
|
| 395 |
+
|
| 396 |
+
|
| 397 |
+
" By default only look for CREATE statements, but allow
|
| 398 |
+
" the user to override
|
| 399 |
+
if !exists('g:ftplugin_sql_statements')
|
| 400 |
+
let g:ftplugin_sql_statements = 'create'
|
| 401 |
+
endif
|
| 402 |
+
|
| 403 |
+
" Predefined SQL objects what are used by the below mappings using
|
| 404 |
+
" the ]} style maps.
|
| 405 |
+
" This global variable allows the users to override its value
|
| 406 |
+
" from within their vimrc.
|
| 407 |
+
" Note, you cannot use \?, since these patterns can be used to search
|
| 408 |
+
" backwards, you must use \{,1}
|
| 409 |
+
if !exists('g:ftplugin_sql_objects')
|
| 410 |
+
let g:ftplugin_sql_objects = 'function,procedure,event,' .
|
| 411 |
+
\ '\(existing\\|global\s\+temporary\s\+\)\{,1}' .
|
| 412 |
+
\ 'table,trigger' .
|
| 413 |
+
\ ',schema,service,publication,database,datatype,domain' .
|
| 414 |
+
\ ',index,subscription,synchronization,view,variable'
|
| 415 |
+
endif
|
| 416 |
+
|
| 417 |
+
" Key to trigger SQL completion
|
| 418 |
+
if !exists('g:ftplugin_sql_omni_key')
|
| 419 |
+
let g:ftplugin_sql_omni_key = '<C-C>'
|
| 420 |
+
endif
|
| 421 |
+
" Key to trigger drill into column list
|
| 422 |
+
if !exists('g:ftplugin_sql_omni_key_right')
|
| 423 |
+
let g:ftplugin_sql_omni_key_right = '<Right>'
|
| 424 |
+
endif
|
| 425 |
+
" Key to trigger drill out of column list
|
| 426 |
+
if !exists('g:ftplugin_sql_omni_key_left')
|
| 427 |
+
let g:ftplugin_sql_omni_key_left = '<Left>'
|
| 428 |
+
endif
|
| 429 |
+
|
| 430 |
+
" Replace all ,'s with bars, except ones with numbers after them.
|
| 431 |
+
" This will most likely be a \{,1} string.
|
| 432 |
+
let s:ftplugin_sql_objects =
|
| 433 |
+
\ '\c^\s*' .
|
| 434 |
+
\ '\(\(' .
|
| 435 |
+
\ substitute(g:ftplugin_sql_statements, ',\d\@!', '\\\\|', 'g') .
|
| 436 |
+
\ '\)\s\+\(or\s\+replace\s\+\)\{,1}\)\{,1}' .
|
| 437 |
+
\ '\<\(' .
|
| 438 |
+
\ substitute(g:ftplugin_sql_objects, ',\d\@!', '\\\\|', 'g') .
|
| 439 |
+
\ '\)\>'
|
| 440 |
+
|
| 441 |
+
" Mappings to move to the next CREATE ... block
|
| 442 |
+
exec "nnoremap <buffer> <silent> ]} :call search('".s:ftplugin_sql_objects."', 'W')<CR>"
|
| 443 |
+
exec "nnoremap <buffer> <silent> [{ :call search('".s:ftplugin_sql_objects."', 'bW')<CR>"
|
| 444 |
+
" Could not figure out how to use a :call search() string in visual mode
|
| 445 |
+
" without it ending visual mode
|
| 446 |
+
" Unfortunately, this will add a entry to the search history
|
| 447 |
+
exec 'xnoremap <buffer> <silent> ]} /'.s:ftplugin_sql_objects.'<CR>'
|
| 448 |
+
exec 'xnoremap <buffer> <silent> [{ ?'.s:ftplugin_sql_objects.'<CR>'
|
| 449 |
+
|
| 450 |
+
" Mappings to move to the next COMMENT
|
| 451 |
+
"
|
| 452 |
+
" Had to double the \ for the \| separator since this has a special
|
| 453 |
+
" meaning on maps
|
| 454 |
+
let b:comment_leader = '\(--\\|\/\/\\|\*\\|\/\*\\|\*\/\)'
|
| 455 |
+
" Find the start of the next comment
|
| 456 |
+
let b:comment_start = '^\(\s*'.b:comment_leader.'.*\n\)\@<!'.
|
| 457 |
+
\ '\(\s*'.b:comment_leader.'\)'
|
| 458 |
+
" Find the end of the previous comment
|
| 459 |
+
let b:comment_end = '\(^\s*'.b:comment_leader.'.*\n\)'.
|
| 460 |
+
\ '\(^\s*'.b:comment_leader.'\)\@!'
|
| 461 |
+
" Skip over the comment
|
| 462 |
+
let b:comment_jump_over = "call search('".
|
| 463 |
+
\ '^\(\s*'.b:comment_leader.'.*\n\)\@<!'.
|
| 464 |
+
\ "', 'W')"
|
| 465 |
+
let b:comment_skip_back = "call search('".
|
| 466 |
+
\ '^\(\s*'.b:comment_leader.'.*\n\)\@<!'.
|
| 467 |
+
\ "', 'bW')"
|
| 468 |
+
" Move to the start and end of comments
|
| 469 |
+
exec 'nnoremap <silent><buffer> ]" :call search('."'".b:comment_start."'".', "W" )<CR>'
|
| 470 |
+
exec 'nnoremap <silent><buffer> [" :call search('."'".b:comment_end."'".', "W" )<CR>'
|
| 471 |
+
exec 'xnoremap <silent><buffer> ]" :<C-U>exec "normal! gv"<Bar>call search('."'".b:comment_start."'".', "W" )<CR>'
|
| 472 |
+
exec 'xnoremap <silent><buffer> [" :<C-U>exec "normal! gv"<Bar>call search('."'".b:comment_end."'".', "W" )<CR>'
|
| 473 |
+
|
| 474 |
+
" Comments can be of the form:
|
| 475 |
+
" /*
|
| 476 |
+
" *
|
| 477 |
+
" */
|
| 478 |
+
" or
|
| 479 |
+
" --
|
| 480 |
+
" or
|
| 481 |
+
" //
|
| 482 |
+
setlocal comments=s1:/*,mb:*,ex:*/,:--,://
|
| 483 |
+
|
| 484 |
+
" Set completion with CTRL-X CTRL-O to autoloaded function.
|
| 485 |
+
if exists('&omnifunc')
|
| 486 |
+
" Since the SQL completion plugin can be used in conjunction
|
| 487 |
+
" with other completion filetypes it must record the previous
|
| 488 |
+
" OMNI function prior to setting up the SQL OMNI function
|
| 489 |
+
let b:sql_compl_savefunc = &omnifunc
|
| 490 |
+
|
| 491 |
+
" Source it to determine its version
|
| 492 |
+
runtime autoload/sqlcomplete.vim
|
| 493 |
+
" This is used by the sqlcomplete.vim plugin
|
| 494 |
+
" Source it for its global functions
|
| 495 |
+
runtime autoload/syntaxcomplete.vim
|
| 496 |
+
|
| 497 |
+
setlocal omnifunc=sqlcomplete#Complete
|
| 498 |
+
" Prevent the intellisense plugin from loading
|
| 499 |
+
let b:sql_vis = 1
|
| 500 |
+
if !exists('g:omni_sql_no_default_maps')
|
| 501 |
+
let regex_extra = ''
|
| 502 |
+
if exists('g:loaded_syntax_completion') && exists('g:loaded_sql_completion')
|
| 503 |
+
if g:loaded_syntax_completion > 120 && g:loaded_sql_completion > 140
|
| 504 |
+
let regex_extra = '\\w*'
|
| 505 |
+
endif
|
| 506 |
+
endif
|
| 507 |
+
" Static maps which use populate the completion list
|
| 508 |
+
" using Vim's syntax highlighting rules
|
| 509 |
+
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'a <C-\><C-O>:call sqlcomplete#Map("syntax")<CR><C-X><C-O>'
|
| 510 |
+
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'k <C-\><C-O>:call sqlcomplete#Map("sqlKeyword'.regex_extra.'")<CR><C-X><C-O>'
|
| 511 |
+
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'f <C-\><C-O>:call sqlcomplete#Map("sqlFunction'.regex_extra.'")<CR><C-X><C-O>'
|
| 512 |
+
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'o <C-\><C-O>:call sqlcomplete#Map("sqlOption'.regex_extra.'")<CR><C-X><C-O>'
|
| 513 |
+
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'T <C-\><C-O>:call sqlcomplete#Map("sqlType'.regex_extra.'")<CR><C-X><C-O>'
|
| 514 |
+
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'s <C-\><C-O>:call sqlcomplete#Map("sqlStatement'.regex_extra.'")<CR><C-X><C-O>'
|
| 515 |
+
" Dynamic maps which use populate the completion list
|
| 516 |
+
" using the dbext.vim plugin
|
| 517 |
+
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'t <C-\><C-O>:call sqlcomplete#Map("table")<CR><C-X><C-O>'
|
| 518 |
+
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'p <C-\><C-O>:call sqlcomplete#Map("procedure")<CR><C-X><C-O>'
|
| 519 |
+
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'v <C-\><C-O>:call sqlcomplete#Map("view")<CR><C-X><C-O>'
|
| 520 |
+
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'c <C-\><C-O>:call sqlcomplete#Map("column")<CR><C-X><C-O>'
|
| 521 |
+
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'l <C-\><C-O>:call sqlcomplete#Map("column_csv")<CR><C-X><C-O>'
|
| 522 |
+
" The next 3 maps are only to be used while the completion window is
|
| 523 |
+
" active due to the <CR> at the beginning of the map
|
| 524 |
+
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'L <C-Y><C-\><C-O>:call sqlcomplete#Map("column_csv")<CR><C-X><C-O>'
|
| 525 |
+
" <C-Right> is not recognized on most Unix systems, so only create
|
| 526 |
+
" these additional maps on the Windows platform.
|
| 527 |
+
" If you would like to use these maps, choose a different key and make
|
| 528 |
+
" the same map in your vimrc.
|
| 529 |
+
" if has('win32')
|
| 530 |
+
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key_right.' <C-R>=sqlcomplete#DrillIntoTable()<CR>'
|
| 531 |
+
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key_left.' <C-R>=sqlcomplete#DrillOutOfColumns()<CR>'
|
| 532 |
+
" endif
|
| 533 |
+
" Remove any cached items useful for schema changes
|
| 534 |
+
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'R <C-\><C-O>:call sqlcomplete#Map("resetCache")<CR><C-X><C-O>'
|
| 535 |
+
endif
|
| 536 |
+
|
| 537 |
+
if b:sql_compl_savefunc != ""
|
| 538 |
+
" We are changing the filetype to SQL from some other filetype
|
| 539 |
+
" which had OMNI completion defined. We need to activate the
|
| 540 |
+
" SQL completion plugin in order to cache some of the syntax items
|
| 541 |
+
" while the syntax rules for SQL are active.
|
| 542 |
+
call sqlcomplete#ResetCacheSyntax()
|
| 543 |
+
call sqlcomplete#PreCacheSyntax()
|
| 544 |
+
endif
|
| 545 |
+
endif
|
| 546 |
+
|
| 547 |
+
let &cpo = s:save_cpo
|
| 548 |
+
unlet s:save_cpo
|
| 549 |
+
|
| 550 |
+
" vim:sw=4:
|
git/usr/share/vim/vim92/ftplugin/squirrel.vim
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin
|
| 2 |
+
" Language: Squirrel
|
| 3 |
+
" Maintainer: Riley Bruins <ribru17@gmail.com>
|
| 4 |
+
" Last Change: 2024 Jul 06
|
| 5 |
+
|
| 6 |
+
if exists('b:did_ftplugin')
|
| 7 |
+
finish
|
| 8 |
+
endif
|
| 9 |
+
let b:did_ftplugin = 1
|
| 10 |
+
|
| 11 |
+
" Set 'comments' to format dashed lists in comments.
|
| 12 |
+
" Also include ///, used for Doxygen.
|
| 13 |
+
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,://
|
| 14 |
+
|
| 15 |
+
setlocal commentstring=//\ %s
|
| 16 |
+
|
| 17 |
+
let b:undo_ftplugin = 'setl com< cms<'
|
git/usr/share/vim/vim92/ftplugin/ssa.vim
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin
|
| 2 |
+
" Language: SubStation Alpha
|
| 3 |
+
" Maintainer: ObserverOfTime <chronobserver@disroot.org>
|
| 4 |
+
" Last Change: 2022 Oct 10
|
| 5 |
+
|
| 6 |
+
if exists('b:did_ftplugin')
|
| 7 |
+
finish
|
| 8 |
+
endif
|
| 9 |
+
let b:did_ftplugin = 1
|
| 10 |
+
|
| 11 |
+
setlocal comments=:;,:!: commentstring=;\ %s
|
| 12 |
+
|
| 13 |
+
let b:undo_ftplugin = 'setl com< cms<'
|
git/usr/share/vim/vim92/ftplugin/sshconfig.vim
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: OpenSSH client configuration file
|
| 3 |
+
" Maintainer: This runtime file is looking for a new maintainer.
|
| 4 |
+
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
| 5 |
+
" Latest Revision: 2026-03-11 (`less -I`)
|
| 6 |
+
|
| 7 |
+
if exists("b:did_ftplugin")
|
| 8 |
+
finish
|
| 9 |
+
endif
|
| 10 |
+
let b:did_ftplugin = 1
|
| 11 |
+
|
| 12 |
+
let s:cpo_save = &cpo
|
| 13 |
+
set cpo&vim
|
| 14 |
+
|
| 15 |
+
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
|
| 16 |
+
let b:undo_ftplugin = 'setlocal com< cms< fo<'
|
| 17 |
+
|
| 18 |
+
if has('unix') && executable('less') && exists(':terminal') == 2
|
| 19 |
+
command -buffer -nargs=1 SshconfigKeywordPrg
|
| 20 |
+
\ silent exe 'hor term ' . 'env LESS= MANPAGER="less -I --pattern=''' . escape('^\s+' . <q-args> . '$', '\') . ''' --hilite-search" man ' . 'ssh_config'
|
| 21 |
+
setlocal iskeyword+=-
|
| 22 |
+
setlocal keywordprg=:SshconfigKeywordPrg
|
| 23 |
+
let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer SshconfigKeywordPrg'
|
| 24 |
+
endif
|
| 25 |
+
|
| 26 |
+
let &cpo = s:cpo_save
|
| 27 |
+
unlet s:cpo_save
|
git/usr/share/vim/vim92/ftplugin/sshdconfig.vim
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin file
|
| 2 |
+
" Language: OpenSSH server configuration file
|
| 3 |
+
" Maintainer: Yinzuo Jiang <jiangyinzuo@foxmail.com>
|
| 4 |
+
" Latest Revision: 2024-05-17
|
| 5 |
+
|
| 6 |
+
if exists("b:did_ftplugin")
|
| 7 |
+
finish
|
| 8 |
+
endif
|
| 9 |
+
|
| 10 |
+
runtime! ftplugin/conf.vim
|
git/usr/share/vim/vim92/ftplugin/stylus.vim
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
" Vim filetype plugin
|
| 2 |
+
" Language: Stylus
|
| 3 |
+
" Maintainer: Marc Harter
|
| 4 |
+
" Credits: Tim Pope
|
| 5 |
+
|
| 6 |
+
" Only do this when not done yet for this buffer
|
| 7 |
+
if exists("b:did_ftplugin")
|
| 8 |
+
finish
|
| 9 |
+
endif
|
| 10 |
+
|
| 11 |
+
let s:save_cpo = &cpo
|
| 12 |
+
set cpo-=C
|
| 13 |
+
|
| 14 |
+
" Define some defaults in case the included ftplugins don't set them.
|
| 15 |
+
let s:undo_ftplugin = ""
|
| 16 |
+
let s:browsefilter = "All Files (*.*)\t*.*\n"
|
| 17 |
+
|
| 18 |
+
runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
|
| 19 |
+
unlet! b:did_ftplugin
|
| 20 |
+
|
| 21 |
+
" Override our defaults if these were set by an included ftplugin.
|
| 22 |
+
if exists("b:undo_ftplugin")
|
| 23 |
+
let s:undo_ftplugin = b:undo_ftplugin
|
| 24 |
+
unlet b:undo_ftplugin
|
| 25 |
+
endif
|
| 26 |
+
if exists("b:browsefilter")
|
| 27 |
+
let s:browsefilter = b:browsefilter
|
| 28 |
+
unlet b:browsefilter
|
| 29 |
+
endif
|
| 30 |
+
|
| 31 |
+
" Change the browse dialog on Win32 to show mainly Styl-related files
|
| 32 |
+
if has("gui_win32")
|
| 33 |
+
let b:browsefilter="Stylus Files (*.styl)\t*.styl\n" . s:browsefilter
|
| 34 |
+
endif
|
| 35 |
+
|
| 36 |
+
setlocal comments= commentstring=//\ %s
|
| 37 |
+
setlocal suffixesadd=.styl
|
| 38 |
+
setlocal formatoptions+=r
|
| 39 |
+
|
| 40 |
+
" Add '-' and '#' to the what makes up a keyword.
|
| 41 |
+
" This means that 'e' and 'w' work properly now, for properties
|
| 42 |
+
" and valid variable names.
|
| 43 |
+
setl iskeyword+=#,-
|
| 44 |
+
|
| 45 |
+
" Add a Stylus command (to see if it's valid)
|
| 46 |
+
command -buffer Stylus !clear; cat % |stylus
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
let b:undo_ftplugin = "setl sua< isk< cms< com< fo< "
|
| 50 |
+
\ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin
|
| 51 |
+
|
| 52 |
+
let &cpo = s:save_cpo
|
| 53 |
+
|
| 54 |
+
" vim:set sw=2:
|