New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added vim syntax file for SLI #253
Changes from 10 commits
6da84c9
4d87c0e
93c085e
dba7502
21be4b6
1392c06
80aa9ee
9473ea5
8f24aeb
b9bdba8
31d4522
761387a
53579ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
" Vim syntax file | ||
" Language: nest SLI | ||
" Maintainer: Ankur Sinha/Nest initiative | ||
" Latest revision: 01 March 2016 | ||
|
||
if exists("b:current_syntax") | ||
finish | ||
endif | ||
|
||
setlocal softtabstop=2 | ||
setlocal cindent shiftwidth=2 | ||
setlocal tabstop=2 | ||
setlocal expandtab | ||
setlocal cindent | ||
|
||
syntax keyword sliTodo TODO XXX FIXME NOTE | ||
hi def link sliTodo Todo | ||
|
||
syn keyword sliKeyword abort abs abs_d abs_i ac_generator acos add addpath addtotrie allocations and append AppendTo Apply apropos arange area2 area array arrayload ArrayQ ArrayShape arraystore asin assert available backtrace_off backtrace_on begin bind break breakup callback call capacity case cd ceil cerr ChangeSubnet cin clear cleardict cleardictstack clic clock cloc clonedict close closeinput CompareFiles CompileMath Connect connruledict continue ConvergentConnect copy CopyFile CopyModel correlation_detector correlomatrix_detector correlospinmatrix_detector cos count countdictstack counttomark cout Create CreateRDV CreateRNG cst ctermid currentdict currentname CurrentSubnet cv1d convert 2-dimensional coordinates to 1-dim index cv2d cva cva_d cva_t cvd cvdict cvd_s cv_dv cvgidcollection cvi cvi_s cv_iv cvlit cvn cvo cvs cvs_f cvt_a cvx cycles CyclicValue DataConnect_a DataConnect DataConnect_i_D_s dc_generator debug debugoff debugon debug.sli def DeleteFile Device dexp dict DictQ dictstack Dimensions Directory dirname div DivergentConnect Dot1D Dot DoubleQ drand Drop dup2 dup edit elementstates empty end endl endusing environment eof eq_dv eq_iv eq erase Erfc Erf errordict eval EvaluateLiteralInfixes E exch exec ExecFunction ExecMath execstack executive exit exithook exp Export FileNames file FindConnections FindRoot FiniteQ First FixedPoint Flatten floor flush FoldList Fold forall forallindexed for fork FractionalPart frexp Function gabor_ Gammainc gamma_sup_generator gauss2d_ GaussDiskConv geq GetConnections getc GetDefaults get_d getenv GetGlobalChildren GetGlobalLeaves GetGlobalNodesInfo GetGlobalNodes GetGlobalRNG getinterval getline GetLocalChildren GetLocalLeaves GetLocalNodes GetMax GetMin GetNetwork GetOption GetOptions getPGRP getPID getPPID get gets GetStatus_dict GetStatus GetStatus_v GetSynapseStatus GetVpRNG GNUaddhistory GNUreadline good grep gt handleerror HasDifferentMemberQ helpdesk helpindex help iclear ieof ifail ifstream ignore igood in_avail index info info_ds initialize_module Inline insertelement insert inspect Install IntegerPart IntegerQ inv irand iround isatty is_mpi is_threaded is_threaded_with_openmp join joinpath JoinTo kernel keys kill known LambertW0 LambertWm1 LambertW Last LayoutArray LayoutNetwork ldexp length_a length length_d length_lp length_p length_s leq license LiteralQ ln load LocateFileNames log lookup loop ls lt MakeDirectory makehelp Map MapAt MapIndexed MapThread mark MathematicaToSliIndex mathexecutive MatrixQ Max max Mean MemberQ MemoryInfo memory_thisjob_bg memory_thisjob_darwin memory_thisjob MergeDictionary MergeLists message Min min mip_generator mkfifo mod modeldict modf Most MoveDirectory MoveFile ms2hms mul multimeter music_cont_in_proxy music_event_in_proxy music_event_out_proxy music_message_in_proxy namespace neg_d neg_i neg neq Nest nest_indirect NestList nest_serial Node noise_generator noop not npop NumberQ NumProcesses oclear oeof ofsopen ofstream ogood oldgetline ones operandstack Options OptionsDictionary or osstream ostrstream OuterProduct over page pageoutput parsestdin Partition Part path pclockspersec pclocks pcvs pgetrusage pick pipe Pi Plus poisson_generator_ps poisson_generator pop pow ppage ppd_sup_generator pp_pop_psc_delta pp_psc_delta pprint prepend print_error PrintNetwork print ProcessorName proxynode PseudoRecordingDevice pstack ptimes pulsepacket_generator put_d putinterval put pwd quit raiseagain raiseerror RandomArray RandomConvergentConnect RandomDivergentConnect Random RandomSubset Range Rank rdevdict ReadDouble ReadInt readline ReadList ReadModes readPGM Read ReadWord realtime RecordingDevice references regcomp regexdict regexec regex_find regex_find_r regex_find_rf regex_find_s regex_find_sf regex_replace RemoveDirectory removeguard repeatany repeat ReplaceOccurrences ReplacePart replace reserve ResetKernel ResetNetwork ResetOptions reset RestoreDictionary restoreestack RestoreOptions restoreostack restore Rest resume ResumeSimulation reverse rngdict rolld roll rollu rot round run SaveDictionary SaveOptions save ScanThread searchfile searchif searchifstream search seed Select SetAcceptableLatency SetDefaults Set SetDirectory SetFakeNumProcesses setguard setNONBLOCK SetNumRecProcesses SetOptions setpath setprecision SetStatus_dict SetStatus SetStatus_v SetSynapseStatus setverbosity SFWdumpparameters ShowDefaults ShowOptions ShowStatus shpawn shrink signaldict Sign Simulate sin sinusoidal_gamma_generator sinusoidal_poisson_generator size sleep_i sleep SLIFunctionWrapper SliToMathematicaIndex Sort spawn spike_detector spike_dilutor spike_generator spikes spin_detector Split spoon sqr sqrt stack StandardDeviation start statusdict step_current_generator StimulatingDevice stopped stop StringQ str subnet SubsetQ sub switchdefault switch symbol symbol_s synapsedict SyncProcesses sysexec system systemtime Table Take taskset taskset_thisjob TensorRank tic TimeCommunicationAlltoall TimeCommunicationAlltoall TimeCommunicationAlltoallv TimeCommunicationAlltoallv TimeCommunicationOffgrid TimeCommunication TimeCommunication TimeCommunicationv time Times tmpnam toc token_is token token_s ToLowercase ToMathematicaExpression topinfo_d Total ToUppercase Transpose trie trieinfo trim trunc typebind typeinfo type typestack undef unit_conversion UnitStep usertime using validate values Variance variant verbosity voltmeter volume_transmitter waitPID wait welcome which who whos writePGM xifstream xor zeros | ||
hi def link sliKeyword Keyword | ||
|
||
syn keyword sliConstant M_INFO M_ERROR M_DEBUG M_WARNING M_STATUS M_FATAL | ||
hi def link sliConstant Constant | ||
|
||
syn match sliUnit '\smV' | ||
syn match sliUnit '\spF' | ||
syn match sliUnit '\spA' | ||
syn match sliUnit '\sms' | ||
syn match sliUnit '\ss' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In some cases this line causes a wrong highlighting. For example, the in command After you change that, 👍 from me. Thanks for this work, I already used it several times! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking into this - maybe I can add word boundaries or something to restrict the match. |
||
syn match sliUnit '\sHz' | ||
syn match sliUnit '\snS' | ||
hi def link sliUnit Constant | ||
|
||
syn match sliNumber '\d\+' | ||
syn match sliNumber '[-+]\d\+' | ||
syn match sliNumber '[-+]\d\+\.\d*' | ||
syn match sliNumber '[-+]\=\d[[:digit:]]*[eE][\-+]\=\d\+' | ||
syn match sliNumber '\d[[:digit:]]*[eE][\-+]\=\d\+' | ||
syn match sliNumber '[-+]\=\d[[:digit:]]*\.\d*[eE][\-+]\=\d\+' | ||
syn match sliNumber '\d[[:digit:]]*\.\d*[eE][\-+]\=\d\+' | ||
hi def link sliNumber Constant | ||
|
||
" Identifiers | ||
syn match sliIdentifier '/\w\+' | ||
hi def link sliIdentifier Identifier | ||
|
||
" Booleans | ||
syn keyword sliBoolean true false | ||
hi def link sliBoolean Boolean | ||
|
||
" Regions | ||
syn region sliFunc start="{" end="}" fold transparent | ||
hi def link sliFunc Function | ||
|
||
syn region sliDict start="<<" end=">>" fold transparent | ||
hi def link sliDict Structure | ||
|
||
syn region sliGroup start="(" end=")" fold transparent | ||
hi def link sliGroup String | ||
|
||
syn match sliComment "%.*$" | ||
hi def link sliComment Comment | ||
syn region sliCommentBlock start="/\*" end=".*\*/" fold | ||
hi def link sliCommentBlock Comment | ||
|
||
syn keyword sliConditional if ifelse | ||
hi def link sliConditional Conditional | ||
|
||
syn keyword sliRepeat forall repeat | ||
hi def link sliRepeat Repeat | ||
|
||
" Finishing touches | ||
let b:current_syntax = "sli" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it doesn't change much, but do you want to keep the devices (like
spike_detector
in the list of keywords?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed them after @heplesser 's remark that things from the API such as models may change in the future, and if we haven't a mechanism in place that will automatically update the list in sli.vim, we'd rather leave them out. I'm still looking at whether there's a way to autogenerate a list of keywords, but I think that requires a more complex plugin like YCM or something. I'm sure it can be done, I just haven't enough vim-fu to know how XD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I totally agree with you. But there are still a lot of devices in the list of keywords. For example, there is the
ac_generator
,dc_generator
,poisson_generator
,spike_detector
,spike_generator
.voltmeter
,volume_transmitter
,multimeter
,music_cont_in_proxy
, ...Please take a look again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I've removed all the devices and models now - hopefully.