Skip to content
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

Plugin not working for me #1

Open
olavurmortensen opened this issue Feb 28, 2019 · 4 comments
Open

Plugin not working for me #1

olavurmortensen opened this issue Feb 28, 2019 · 4 comments

Comments

@olavurmortensen
Copy link

I installed this plugin via the "manual" method in the README, and there's no syntax highlighting. As an example, I used the "your first script" in the Nextflow documentation, saved as a .nf file.

@mebbert
Copy link

mebbert commented Aug 14, 2019

Hello,
I had the same issue, where manual install did not work. I did not try the other methods, but I figured out how to make it work (for me). I'm no expert on Vim plugins, but going off information from Writing Vim Syntax Plugins, I believe many of the settings in ~/.vimrc/ftplugin/nextflow.nim need to be put into a syntax-specific file in ~/.vimrc/syntax/nextflow.nim. I copied ~/.vimrc/ftplugin/nextflow.nim into ~/.vimrc/syntax/nextflow.nim and syntax highlighting suddenly worked. Based on information in the link, I guessed that the files should be organized as follows:

ftplugin/nextflow.nim

if exists("b:current_syntax")
  finish
endif

setlocal expandtab
setlocal shiftwidth=4
setlocal softtabstop=4
setlocal colorcolumn=80

syntax/nextflow.nim

source $VIMRUNTIME/syntax/groovy.vim

syn region  nextflowBlockString          start=+'''+ keepend end=+'''+ contains=groovySpecialChar,groovySpecialError,@Spell,nextflowELExpr,@shell
syn match nextflowELExpr "\!{.\{-}}" contained


" Nextflow specifics
syn keyword nextflowDirective afterScript beforeScript cache container cpus clusterOptions disk echo errorStrategy executor ext label maxErrors maxForks maxRetries me
syn match nextflowBlock "\v(input|output|script|shell|exec):"
syn keyword nextflowKeyword from into
syn keyword nextflowType file val process Channel
syn keyword nextflowSpecial    workflow params launchDir
syn keyword nextflowConstant   null

" Apply highlighting
let b:current_syntax = "nextflow"

hi def link nextflowELExpr            Identifier
hi def link groovyELExpr              Identifier
hi def link nextflowConstant          Constant
hi def link nextflowDirective         Statement
hi def link nextflowKeyword           Operator
hi def link nextflowType              Type
hi def link nextflowSpecial           Special
hi def link nextflowBlock             Function
hi def link nextflowBlockString       String

Again, I'm not certain that's exactly how it should be, but it's working for me now.

Hope this is helpful.

@kemin711
Copy link

inside nextflow-vim/syntax directory

sudo cp nextflow.vim /usr/share/vim/vim80/syntax
Worked for me

@ahstram
Copy link

ahstram commented Oct 28, 2022

I also had this problem...

changing:

mkdir ~/.vim/ftplugin; cp ~/nextflow-vim/syntax/nextflow.vim ~/.vim/ftplugin;

in the "manual instructions" to:

mkdir ~/.vim/syntax; cp ~/nextflow-vim/syntax/nextflow.vim ~/.vim/syntax;

solved my issues.

@kemin711
Copy link

kemin711 commented Oct 30, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants