Browse Source

initial commit

main
Thorn Avery 3 years ago
commit
ffbeff7cae
4 changed files with 201 additions and 0 deletions
  1. +50
    -0
      README.md
  2. +60
    -0
      flake.lock
  3. +36
    -0
      flake.nix
  4. +55
    -0
      overlay.nix

+ 50
- 0
README.md View File

@@ -0,0 +1,50 @@
# tA's vim flake

this is a reproducible setup for my vim setup, including plugins and configuration.

## installation

requires a system capable of using nix flakes.

in order to try out temporarily:

```
nix shell github:techieAgnostic/vim --command vim
```

in order to add to an existing nix flakes configuration, simply add:

```
inputs.ta-vim.url = "github:techieAgnostic/vim";
```

which exposes the overlay `ta-vim.overlay` which can be added to your `nixpkgs.overlays`.

the overlay adds the package `ta.vim` which can be used as normal.

## adding plugins

plugins that exist in the nixpkg's repository can be added by name to the `vimrcConfig.pathogen.pluginNames` list in order to be loaded.

plugins that don't exist in nixpkgs can be added manually, in order to do so, first create an input for the git repository you wish to source from, for example, in order to add hoon highlighting:

```
inputs.hoon-vim-src = {
url = "github:urbit/urbit";
flake = false;
};
```

(make sure to add the new `hoon-vim-src` to the `outputs` function arguments.
then add the following to `customPlugins`:

```
hoon-vim = pkgs.vimUtils.buildVimPlugin {
name = "hoon-vim";
src = hoon-vim-src + "/extras/hoon.vim";
};
```

(the addition to the src path is for repos that contain a vim plugin among other things, and can be left off unless needed).

now, `hoon-vim` can be added to `vimrcConfig.pathogen.pluginNames` like any other plugin.

+ 60
- 0
flake.lock View File

@@ -0,0 +1,60 @@
{
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1601282935,
"narHash": "sha256-WQAFV6sGGQxrRs3a+/Yj9xUYvhTpukQJIcMbIi7LCJ4=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "588973065fce51f4763287f0fda87a174d78bf48",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1603758576,
"narHash": "sha256-xKFmWVx+rFInBao3gtmvXcd0LjHD1+0c1Ef5PJDrbuM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1dc37370c489b610f8b91d7fdd40633163ffbafd",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"rainbow-vim-src": {
"flake": false,
"locked": {
"lastModified": 1547370678,
"narHash": "sha256-zha3BNZXJSgEWEyh8fcy1+x3Y+c1DV1eTMa/AQ+sj7M=",
"owner": "frazrepo",
"repo": "vim-rainbow",
"rev": "a6c7fd5a2b0193b5dbd03f62ad820b521dea3290",
"type": "github"
},
"original": {
"owner": "frazrepo",
"repo": "vim-rainbow",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"rainbow-vim-src": "rainbow-vim-src"
}
}
},
"root": "root",
"version": 7
}

+ 36
- 0
flake.nix View File

@@ -0,0 +1,36 @@
{
description = "tA's vim setup";
inputs = {
nixpkgs = {
url = "github:NixOS/nixpkgs/nixos-unstable";
};

flake-utils = {
url = "github:numtide/flake-utils";
};

rainbow-vim-src = {
url = "github:frazrepo/vim-rainbow";
flake = false;
};
};
outputs = { self, nixpkgs, flake-utils, rainbow-vim-src, ... }:
let
customPlugins = pkgs: {
rainbow-vim = pkgs.vimUtils.buildVimPlugin {
name = "rainbow-vim";
src = rainbow-vim-src;
};
};
in flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
overlays = [ ((import ./overlay.nix) customPlugins) ];
inherit system;
};
in {
defaultPackage = pkgs.ta.vim;
}) // {
overlay = (import ./overlay.nix) customPlugins;
};
}

+ 55
- 0
overlay.nix View File

@@ -0,0 +1,55 @@
customPlugins: self: super: {
ta = {
vim = super.vim_configurable.customize {
name = "vim";
vimrcConfig = {
pathogen = {
knownPlugins = (customPlugins super) // super.vimPlugins;
pluginNames = [
"haskell-vim"
"rainbow-vim"
"vimwiki"
"vim-sexp-mappings-for-regular-people"
"vim-sexp"
"vim-surround"
"vim-repeat"
];
};
customRC = ''
set colorcolumn=80
set nocompatible
filetype plugin on
filetype indent on
filetype on
syntax on
set encoding=utf-8
set autoindent
set smartindent
set ignorecase
set smartcase
set hlsearch
set history=100
set number
set wildmenu
set backspace=eol,indent,start
set tabstop=3 softtabstop=3 expandtab shiftwidth=3 smarttab
autocmd BufNewFile,BufRead *.rkt set filetype=scheme
autocmd FileType scheme :packadd vim-sexp
autocmd FileType scheme :packadd vim-sexp-for-normies
autocmd FileType scheme :packadd vim-surround
autocmd FileType scheme :packadd vim-repeat
autocmd FileType scheme :packadd paredit-vim
autocmd FileType scheme :packadd vim-tslime
autocmd FileType scheme :packadd racket-vim
autocmd BufNewFile,BufRead *.hoon set filetype=hoon
autocmd FileType hoon :packadd hoon-vim

let g:rainbow_active = 1
let g:rainbow_ctermfgs = [ 'lightblue', 'lightgreen', 'yellow', 'red', 'magenta']
'';
};
};
};
}

Loading…
Cancel
Save