Skip to content

Instantly share code, notes, and snippets.

@MatthewCroughan
Last active March 18, 2021 13:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save MatthewCroughan/37ff1bbd3c06d379793c9c855ae96b19 to your computer and use it in GitHub Desktop.
Save MatthewCroughan/37ff1bbd3c06d379793c9c855ae96b19 to your computer and use it in GitHub Desktop.
Syntax highlighting for vim in a single file that can be imported.
# The following documents helped me understand this
# https://github.com/NixOS/nixpkgs/blob/ca4e26d1e662231d33831651c2e2ed83b1442cb7/doc/languages-frameworks/vim.section.md#managing-plugins-with-vim-plug
# https://nicknovitski.com/vim-nix-syntax
# name = "vim" makes the name of the executable 'vim'. If I set it to 'myVim'
# then I will have to run 'myVim' on the cli to access this custom version of
# Vim which is being created by vim_configurable.customize
{ config, pkgs, ... }:
{
nixpkgs.config.vim.ftNix = false;
environment.systemPackages = with pkgs; [
(vim_configurable.customize {
vimrcConfig.customRC = ''
syntax=on
set mouse-=a
'';
name = "vim";
vimrcConfig.packages.vim =
with pkgs.vimPlugins; {
start = [ vim-nix ];
};
}
)
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment