Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
j.vim89 linesDownload Raw Back to ftplugin
1" Vim filetype plugin2" Language:	J3" Maintainer:	David Bürgin <dbuergin@gluet.ch>4" URL:		https://gitlab.com/glts/vim-j5" Last Change:	2022-08-066"		2024 Jan 14 by Vim Project (browsefilter)7 8if exists('b:did_ftplugin')9  finish10endif11let b:did_ftplugin = 112 13let s:save_cpo = &cpo14set cpo&vim15 16setlocal iskeyword=48-57,A-Z,a-z,_17setlocal comments=:NB.18setlocal commentstring=NB.\ %s19setlocal formatoptions-=t20setlocal matchpairs=(:)21setlocal path-=/usr/include22 23" Includes. To make the shorthand form "require 'web/cgi'" work, double the24" last path component. Also strip off leading folder names like "~addons/".25setlocal include=\\v^\\s*(load\|require)\\s*'\\zs\\f+\\ze'26setlocal includeexpr=substitute(substitute(tr(v:fname,'\\','/'),'\\v^[^~][^/.]*(/[^/.]+)$','&\\1',''),'\\v^\\~[^/]+/','','')27setlocal suffixesadd=.ijs28 29let b:undo_ftplugin = 'setlocal suffixesadd< includeexpr< include< path< matchpairs< formatoptions< commentstring< comments< iskeyword<'30 31" Section movement with ]] ][ [[ []. The start/end patterns below are amended32" inside the function in order to avoid matching on the current cursor line.33if !exists('no_plugin_maps') && !exists('no_j_maps')34  let s:sectionstart = '\%(\s*Note\|.\{-}\<\%([0-4]\|13\|noun\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(:\s*0\|def\s\+0\|define\)\)\>.*'35  let s:sectionend = '\s*)\s*'36 37  function! s:SearchSection(end, backwards, visualmode) abort38    if a:visualmode !=# ''39      normal! gv40    endif41    let l:flags = a:backwards ? 'bsW' : 'sW'42    if a:end43      call search('^' . s:sectionend . (a:backwards ? '\n\_.\{-}\%#' : '$'), l:flags)44    else45      call search('^' . s:sectionstart . (a:backwards ? '\n\_.\{-}\%#' : '$'), l:flags)46    endif47  endfunction48 49  noremap <buffer> <silent> ]] :<C-U>call <SID>SearchSection(0, 0, '')<CR>50  xnoremap <buffer> <silent> ]] :<C-U>call <SID>SearchSection(0, 0, visualmode())<CR>51  sunmap <buffer> ]]52  noremap <buffer> <silent> ][ :<C-U>call <SID>SearchSection(1, 0, '')<CR>53  xnoremap <buffer> <silent> ][ :<C-U>call <SID>SearchSection(1, 0, visualmode())<CR>54  sunmap <buffer> ][55  noremap <buffer> <silent> [[ :<C-U>call <SID>SearchSection(0, 1, '')<CR>56  xnoremap <buffer> <silent> [[ :<C-U>call <SID>SearchSection(0, 1, visualmode())<CR>57  sunmap <buffer> [[58  noremap <buffer> <silent> [] :<C-U>call <SID>SearchSection(1, 1, '')<CR>59  xnoremap <buffer> <silent> [] :<C-U>call <SID>SearchSection(1, 1, visualmode())<CR>60  sunmap <buffer> []61 62  let b:undo_ftplugin .= ' | silent! execute "unmap <buffer> ]]"'63                     \ . ' | silent! execute "unmap <buffer> ]["'64                     \ . ' | silent! execute "unmap <buffer> [["'65                     \ . ' | silent! execute "unmap <buffer> []"'66endif67 68" Browse dialog filter on Windows and GTK (see ":help browsefilter")69if (has('gui_win32') || has('gui_gtk')) && !exists('b:browsefilter')70  let b:browsefilter = "J Script Files (*.ijs)\t*.ijs\n"71  if has("win32")72    let b:browsefilter .= "All Files (*.*)\t*\n"73  else74    let b:browsefilter .= "All Files (*)\t*\n"75  endif76  let b:undo_ftplugin .= ' | unlet! b:browsefilter'77endif78 79" Enhanced "%" matching (see ":help matchit")80if exists('loaded_matchit') && !exists('b:match_words')81  let b:match_ignorecase = 082  let b:match_words = '^\%(\s*Note\|.\{-}\<\%([0-4]\|13\|noun\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(\:\s*0\|def\s\+0\|define\)\)\>:^\s*\:\s*$:^\s*)\s*$'83                  \ . ',\<\%(for\%(_\a\k*\)\=\|if\|select\|try\|whil\%(e\|st\)\)\.:\<\%(case\|catch[dt]\=\|else\%(if\)\=\|fcase\)\.:\<end\.'84  let b:undo_ftplugin .= ' | unlet! b:match_ignorecase b:match_words'85endif86 87let &cpo = s:save_cpo88unlet s:save_cpo89 
codekingpro/portable-devtools · Team Ai