sindresorhus / quick-look-plugins

List of useful Quick Look plugins for developers
18.08k stars 534 forks source link

Is there any QL about filetype :go ? #84

Closed ayanmw closed 6 years ago

ayanmw commented 6 years ago

Is there any QL about filetype :go ?

I want quick look of *.go file ,and high syntax,please;

ayanmw commented 6 years ago

OK,I found a way , using command: qlmanage -d 4 -p test.go ,then I got the logger about what qlplugin is using to open *.go files; I got like this :

[DEBUG] Registering <QLGenerator /Users/anmingwei/Library/QuickLook/qlplayground.qlgenerator> for public.public.source-code [DEBUG] Registering <QLGenerator /Users/anmingwei/Library/QuickLook/qlplayground.qlgenerator> for public.swift-source [DEBUG] Registering <QLGenerator /Users/anmingwei/Library/QuickLook/qlplayground.qlgenerator> for com.apple.dt.playground ............. [DEBUG] Previewing file:///Users/anmingwei/Downloads/GO/GoProject/src/github.com/nsf/gocode/package.go. Content type UTI: dyn.ah62d4rv4ge80s52. Generator used: <QLGenerator /Users/anmingwei/Library/QuickLook/QLStephen.qlgenerator> [DEBUG] Loading <QLGenerator /Users/anmingwei/Library/QuickLook/QLStephen.qlgenerator> [DEBUG] Previewing file:///Users/anmingwei/Downloads/GO/GoProject/src/github.com/nsf/gocode/package.go finished 2018-03-17 00:45:54.301 qlmanage[86187:749013] CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x7a0f, name = 'com.apple.coredrag' See /usr/include/servers/bootstrap_defs.h for the error codes. 2018-03-17 00:45:54.508 qlmanage[86187:749013] CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0xbc37, name = 'com.apple.tsm.portname' See /usr/include/servers/bootstrap_defs.h for the error codes.

So I want change the qlplayground to support go files, then I do command:

vim ~/Library/QuickLook/qlplayground.qlgenerator/Contents/Info.plist

add line after LSItemContentTypes


                        <array>
                                <string>public.public.source-code</string>
                                <string>dyn.ah62d4rv4ge80s52</string>

                                <string>public.swift-source</string>
                                <string>com.apple.dt.playground</string>
                        </array>

save and run qlmanage -r ; and I success ,syntax of swift is like syntax of go. so let it works!