-
Notifications
You must be signed in to change notification settings - Fork 370
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
Conversation
Hi @sanjayankur31, You changed the paths of the
|
@weidel-p: could you please test this and review the code? Thanks! |
@jougs : I wrote it from scratch. I'm really new to vim scripting - not even sure if there is a "postscript" mode. (The script is extremely basic at the moment) |
Hi @sanjayankur31, SLI files look really nice now in vim, but I have some minor remarks:
|
Hey @weidel-p - I left the model names in there so that they're also highlighted - they're pretty much constants that Nest defines - what do you think? (I'll remove the tests, I thought I'd removed them already). I'll work on the other bits and push new commits. |
@sanjayankur31 I think that keeping the models in is problematic. The set of models provided by NEST will change over time. If adding a neuron or synapse model will require changes to the vim style file, this will diverge. Furthermore, users are increasingly writing their own NEST modules that supply models, and those models would not be marked as keywords either. To handle this properly, vim would have to run NEST, import all modules loaded into a NEST script and dynamically update the keyword list. Concerning the units, I would add at least |
Ah, I don't think vim can do that in a syntax file - that's something that autocompletion plug-ins do, which will need to be developed separately. I'll look into it, though. |
Commonly used units are defined here: https://github.com/nest/nest-simulator/blob/master/lib/sli/nest-init.sli#L1401 |
Need to rebase this. Working on it. |
@weidel-p Can you have another look into this PR, please? Thank you. |
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 |
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.
@weidel-p - this should work, please have a look when you have the time. Cheers. |
👍 |
Also reorganised directories as @heplesser suggested on the ML