aboutsummaryrefslogtreecommitdiff
path: root/runtime/ftplugin
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r--runtime/ftplugin/dosini.vim2
-rw-r--r--runtime/ftplugin/matlab.vim7
-rw-r--r--runtime/ftplugin/ocaml.vim8
-rw-r--r--runtime/ftplugin/octave.vim63
-rw-r--r--runtime/ftplugin/systemverilog.vim2
-rw-r--r--runtime/ftplugin/tex.vim2
6 files changed, 74 insertions, 10 deletions
diff --git a/runtime/ftplugin/dosini.vim b/runtime/ftplugin/dosini.vim
index 0d0f0f8983..6a53dfd096 100644
--- a/runtime/ftplugin/dosini.vim
+++ b/runtime/ftplugin/dosini.vim
@@ -1,5 +1,5 @@
" Vim filetype plugin file
-" Language: Configuration File (ini file) for MSDOS/MS Windows
+" Language: Configuration File (ini file) for MS-DOS/MS Windows
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09
diff --git a/runtime/ftplugin/matlab.vim b/runtime/ftplugin/matlab.vim
index a1a282f19e..d3c74b4ecf 100644
--- a/runtime/ftplugin/matlab.vim
+++ b/runtime/ftplugin/matlab.vim
@@ -1,7 +1,8 @@
" Vim filetype plugin file
" Language: matlab
" Maintainer: Jake Wasserman <jwasserman at gmail dot com>
-" Last Change: 2019 Sep 27
+" Update By: Gabriel Dupras
+" Last Change: 2021 Aug 30
" Contributors:
" Charles Campbell
@@ -15,9 +16,9 @@ let s:save_cpo = &cpo
set cpo-=C
if exists("loaded_matchit")
- let s:conditionalEnd = '\%(([^()]*\)\@!\<end\>\%([^()]*)\)\@!'
+ let s:conditionalEnd = '\%(\%(^\|;\)\s*\)\@<=end\>'
let b:match_words=
- \ '\<\%(if\|switch\|for\|while\)\>:\<\%(elseif\|case\|break\|continue\|else\|otherwise\)\>:'.s:conditionalEnd.','.
+ \ '\<\%(if\|switch\|for\|while\|try\)\>:\<\%(elseif\|case\|break\|continue\|else\|otherwise\|catch\)\>:' . s:conditionalEnd . ',' .
\ '\<function\>:\<return\>:\<endfunction\>'
unlet s:conditionalEnd
endif
diff --git a/runtime/ftplugin/ocaml.vim b/runtime/ftplugin/ocaml.vim
index 8a628604fa..20172c9b32 100644
--- a/runtime/ftplugin/ocaml.vim
+++ b/runtime/ftplugin/ocaml.vim
@@ -371,7 +371,7 @@ endfunction
endif
else
let annot_file_name = ''
- "(Pierre Vittet: I have commented 4b because this was chrashing
+ "(Pierre Vittet: I have commented 4b because this was crashing
"my vim (it produced infinite loop))
"
" 4b. anarchy : the renamed _build directory may be higher in the hierarchy
@@ -462,8 +462,8 @@ endfunction
"b. 'search' and 'match' work to find the type information
- "In: - lin1,col1: postion of expression first char
- " - lin2,col2: postion of expression last char
+ "In: - lin1,col1: position of expression first char
+ " - lin2,col2: position of expression last char
"Out: - the pattern to be looked for to find the block
" Must be called in the source buffer (use of line2byte)
function! s:Block_pattern(lin1,lin2,col1,col2)
@@ -581,7 +581,7 @@ endfunction
let res = substitute (a:res, "\n", "", "g" )
"remove double space
let res =substitute(res , " ", " ", "g")
- "remove space at begining of string.
+ "remove space at beginning of string.
let res = substitute(res, "^ *", "", "g")
return res
endfunction
diff --git a/runtime/ftplugin/octave.vim b/runtime/ftplugin/octave.vim
new file mode 100644
index 0000000000..7cab7c212a
--- /dev/null
+++ b/runtime/ftplugin/octave.vim
@@ -0,0 +1,63 @@
+" Vim filetype plugin file
+" Language: GNU Octave
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Last Change: 2021 Sep 02
+
+if exists("b:did_ftplugin")
+ finish
+endif
+let b:did_ftplugin = 1
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+" TODO: update Matlab ftplugin and source it as the base file?
+
+setlocal comments=s:%{,m:\ ,e:%},s:#{,m:\ ,e:#},:%,:#
+setlocal commentstring=#\ %s
+setlocal formatoptions-=t formatoptions+=croql
+
+setlocal keywordprg=info\ octave\ --vi-keys\ --index-search
+
+if exists("loaded_matchit") && !exists("b:match_words")
+ let b:match_words = '\<unwind_protect\>:\<unwind_protect_cleanup\>:\<end_unwind_protect\>'
+ if exists("octave_use_matlab_end")
+ let b:match_words ..= ',' ..
+ \ '\<\%(classdef\|enumeration\|events\|for\|function\|if\|methods\|parfor\|properties\|switch\|while\|try\)\>' ..
+ \ ':' ..
+ \ '\<\%(elseif\|else\|case\|otherwise\|break\|continue\|catch\)\>' ..
+ \ ':' ..
+ \ '\<end\>'
+ else
+ let b:match_words ..= ',' ..
+ \ '\<classdef\>:\<endclassdef\>,' ..
+ \ '\<enumeration\>:\<endenumeration\>,' ..
+ \ '\<events\>:\<endevents\>,' ..
+ \ '\<do\>:\<\%(break\|continue\)\>:\<until\>' ..
+ \ '\<for\>:\<\%(break\|continue\)\>:\<endfor\>,' ..
+ \ '\<function\>:\<return\>:\<endfunction\>,' ..
+ \ '\<if\>:\<\%(elseif\|else\)\>:\<endif\>,' ..
+ \ '\<methods\>:\<endmethods\>,' ..
+ \ '\<parfor\>:\<endparfor\>,' ..
+ \ '\<properties\>:\<endproperties\>,' ..
+ \ '\<switch\>:\<\%(case\|otherwise\)\>:\<endswitch\>,' ..
+ \ '\<while\>:\<\%(break\|continue\)\>:\<endwhile\>,' ..
+ \ '\<try\>:\<catch\>:\<end_try_catch\>'
+ endif
+ " only match in statement position
+ let s:statement_start = escape('\%(\%(^\|;\)\s*\)\@<=', '\')
+ let b:match_words = substitute(b:match_words, '\\<', s:statement_start, 'g')
+endif
+
+if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
+ let b:browsefilter = "GNU Octave Source Files (*.m)\t*.m\n" ..
+ \ "All Files (*.*)\t*.*\n"
+endif
+
+let b:undo_ftplugin = "setl com< cms< fo< kp< " ..
+ \ "| unlet! b:browsefilter b:match_words"
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
+" vim: nowrap sw=2 sts=2 ts=8 noet:
diff --git a/runtime/ftplugin/systemverilog.vim b/runtime/ftplugin/systemverilog.vim
index e350427022..38ed1ad32a 100644
--- a/runtime/ftplugin/systemverilog.vim
+++ b/runtime/ftplugin/systemverilog.vim
@@ -32,7 +32,7 @@ if exists("loaded_matchit")
\ '\<checker\>:\<endchecker\>,' .
\ '\<class\>:\<endclass\>,' .
\ '\<clocking\>:\<endclocking\>,' .
- \ '\<gruop\>:\<endgruop\>,' .
+ \ '\<group\>:\<endgroup\>,' .
\ '\<interface\>:\<endinterface\>,' .
\ '\<package\>:\<endpackage\>,' .
\ '\<program\>:\<endprogram\>,' .
diff --git a/runtime/ftplugin/tex.vim b/runtime/ftplugin/tex.vim
index 11470012f9..0d68b51d46 100644
--- a/runtime/ftplugin/tex.vim
+++ b/runtime/ftplugin/tex.vim
@@ -28,7 +28,7 @@ let &l:define .= '\|\\\(re\)\=new\(boolean\|command\|counter\|environment\|font'
" Tell Vim how to recognize LaTeX \include{foo} and plain \input bar :
let &l:include .= '\|\\include{'
-" On some file systems, "{" and "}" are inluded in 'isfname'. In case the
+" On some file systems, "{" and "}" are included in 'isfname'. In case the
" TeX file has \include{fname} (LaTeX only), strip everything except "fname".
let &l:includeexpr = "substitute(v:fname, '^.\\{-}{\\|}.*', '', 'g')"