Skip to content

Instantly share code, notes, and snippets.

@lkhphuc
lkhphuc / nvim_highlight_update.md
Last active December 7, 2025 08:03
A simple utility function to override and update any colorscheme in Neovim.

I like to have my neovim to bold the language keywords, italicize the comments, or both italicize and bold all the builtin functions, type or constants etc. And I want this to be consistent across colorschemes.

In vim/neovim, to update a highlight group it is as simple as highlight HighlightGroupToModified gui=bold,italic,underline. But this is problematic if the HighlightGroupToModified is defined as a link to other highlight group. For example highlight TSInclude might be linked to Include by your colorscheme, so executing hi TSInclude gui=bold will apply bold to TSInclude but wipe out any foreground and background color information that was originally defined by linking to Include highlight group.

Since every colorschemes can arbitrarily choose to define a highlight group explicitly or by linking, adding hi TSConstant gui=bold to your config are bound to break when you switch colorschemes. A manual approach is to recursively go down the linking chain defined by colorscheme, e.g TSConstant

@choongng
choongng / notes.md
Last active December 29, 2019 23:01
Swift for TensorFlow quick start with Docker on Mac

A good way to get a taste of Swift for Tensorflow language and tools is to set it up with Jupyter with the fastai Swift notebooks. I wanted a quick setup, which the Mac install experience currently not, so instead I installed the release binaries in a Ubuntu container via Docker. The setup process for this scenario is not well documented, so here it is for you / future me.

What we're about to do is install the S4TF 0.4 release and the fastai v3 Swift notebooks on Ubuntu 18.04. Generally we follow the swift-jupyter docker file, but install cpu-only release versions of the packages.

Below are some of the references I looked at:

Rationale for S4TF and background reading

https://github.com/tensorflow/swift/blob/master/docs/WhySwiftForTensorFlow.md https://github.com/tensorflow/swift/blob/master/docs/DifferentiableFunctions.md