-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from ttak0422/doc
`doc`
- Loading branch information
Showing
13 changed files
with
349 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
# Summary | ||
|
||
[Introduction](./introduction.md) | ||
[Introduction](./../README.md) | ||
[Quick Start](./quick-start.md) | ||
|
||
--- | ||
# Configuration | ||
|
||
- [Common Configuration](./common-configuration.md) | ||
- [Neovim Configuration](./neovim-configuration.md) | ||
- [pluginConfigDetail.args example](./neovim-configuration-example-args.md) | ||
- [Vim Configuration](./vim-configuration.md) | ||
|
||
--- | ||
# Usage | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
# bundler | ||
|
||
Vim / Neovim package manager for Nix. | ||
# Introduction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# example `pluginConfigDetail.args` | ||
|
||
```nix | ||
# access args in viml | ||
{ | ||
language = "vim"; | ||
code = '' | ||
s:args['foo'] " bar | ||
''; | ||
args = { | ||
foo = "bar"; | ||
}; | ||
} | ||
# access args in lua | ||
{ | ||
language = "lua"; | ||
code = '' | ||
args.foo -- bar | ||
''; | ||
args = { | ||
foo = "bar" | ||
}; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,86 @@ | ||
# Neovim Configuration | ||
|
||
Configurations defined in bundler-nvim are available as packages and apps. | ||
This module assumes that you will use that package as you wish, as follows. | ||
|
||
```nix | ||
environment.systemPackages = [ | ||
(pkgs.runCommand "nvim" { } '' | ||
mkdir -p $out/bin | ||
ln -s ${ | ||
self.packages.${system}.bundler-nvim | ||
}/bin/nvim $out/bin/nvim | ||
'') | ||
]; | ||
``` | ||
|
||
## flakeModule schemes | ||
|
||
| name | type | default | description | | ||
| :-: | :-: | :- | :- | | ||
| packageNamePrefix | `types.str` | `"bundler-nvim"` | package name prefix provided by this module | | ||
| appNamePrefix | `types.str` | `"bundler-nvim"` | app name prefix provided by this module | | ||
| package | `types.package` | `pkgs.neovim-unwrapped` | neovim package | | ||
| extraPackages | `with types; listOf package` | `[]` | e.g. lua-language-server | | ||
| extraConfig | `types.lines` | `""` | viml code executed at startup | | ||
| extraLuaConfig | `types.lines` | `""` | lua code executed at startup | | ||
| after.ftPlugin | `with types; attrsOf lines` | `{}` | `after/ftplugin` (viml only) | | ||
| withNodeJs | `types.bool` | `false` | alias for `neovim.withNodeJs` | | ||
| withPython3 | `types.bool` | `false` | alias for `neovim.withPython3` | | ||
| withRuby | `types.bool` | `false` | alias for `neovim.withRuby` | | ||
| eagerPlugins | `with types; listOf (either package eagerPluginConfig)` | `[]` | plugins loaded at startup | | ||
| lazyPlugins | `with types; listOf (either package lazyPluginConfig)` | `[]` | plugins lazy loaded | | ||
| lazyGroups | `types.listOf lazyGroupConfig` | `[]` | plugin groups lazy loaded | | ||
| timer | `types.int` | `100` | time used for loading plugin (msec) | | ||
| logLevel | `types.enum [ "debug" "info" "warn" "error" ]` | `"warn"` | | ||
|
||
### pluginConfigDetail | ||
|
||
| name | type | default | description | | ||
| :-: | :-: | :-: | :- | | ||
| language | `types.enum [ "vim" "lua" ]` | `vim` | - | | ||
| code | `types.lines` | `""` | setup code | | ||
| args | `types.attrs` | `{}` | bring the values of nix into the code . see [example](./neovim-configuration-example-args.md). | | ||
|
||
### eagerPluginConfig | ||
|
||
| name | type | default | description | | ||
| :-: | :-: | :-: | :- | | ||
| startupConfig | `with types; either lines pluginConfigDetail` | `""` | setup code executed at startup | | ||
| extraPackages | `with types; listOf package` | `[]` | nix packages | | ||
|
||
### lazyPluginConfig | ||
|
||
| name | type | default | description | | ||
| :-: | :-: | :-: | :- | | ||
| startupConfig | `with types; either lines pluginConfigDetail` | `""` | setup code executed at startup | | ||
| extraPackages | `with types; listOf package` | `[]` | nix packages | | ||
| preConfig | `with types; either lines pluginConfigDetail` | `""` | setup code executed before load plugin | | ||
| postConfig | `with types; either lines pluginConfigDetail` | `""` | setup code executed after load plugin | | ||
| dependPlugins | `with types; listOf (either package lazyPluginConfig)` | `[]` | plugins on which this plugin depends | | ||
| dependGroups | `with types; listOf str` | `[]` | groups on which this plugin depends | | ||
| onModules | `with types; listOf str` | `[]` | load plugin when configured modules is called | | ||
| onEvents | `with types; listOf str` | `[]` | load plugin when configured events fires | | ||
| onFiletypes | `with types; listOf str` | `[]` | load plugin when configured filetype is read | | ||
| onCommands | `with types; listOf str` | `[]` | load plugin when configured commands execute | | ||
| useTimer | `types.bool` | `false` | set `true` to load the plugin using timer | | ||
| useDenops | `types.bool` | `false` | must be explicitly set to `true` in the denops plugin | | ||
|
||
### lazyGroupConfig | ||
|
||
| name | type | default | description | | ||
| :-: | :-: | :-: | :- | | ||
| name | `types.str` | **required** | group name | | ||
| plugins | `with types; listOf` | `[]` | group name | | ||
| startupConfig | `with types; either lines pluginConfigDetail` | `""` | setup code executed at startup | | ||
| extraPackages | `with types; listOf package` | `[]` | nix packages | | ||
| preConfig | `with types; either lines pluginConfigDetail` | `""` | setup code executed before load plugin | | ||
| postConfig | `with types; either lines pluginConfigDetail` | `""` | setup code executed after load plugin | | ||
| dependPlugins | `with types; listOf (either package lazyPluginConfig)` | `[]` | plugins on which this plugin depends | | ||
| dependGroups | `with types; listOf str` | `[]` | groups on which this plugin depends | | ||
| onModules | `with types; listOf str` | `[]` | load plugin when configured modules is called | | ||
| onEvents | `with types; listOf str` | `[]` | load plugin when configured events fires | | ||
| onFiletypes | `with types; listOf str` | `[]` | load plugin when configured filetype is read | | ||
| onCommands | `with types; listOf str` | `[]` | load plugin when configured commands execute | | ||
| useTimer | `types.bool` | `false` | set `true` to load the plugin using timer | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,14 @@ | ||
# Quick Start | ||
|
||
## `bundler-nvim` (for Neovim) | ||
|
||
```bash | ||
$ nix flake init --template github:ttak0422/bundler#neovim | ||
$ nix run .#bundler-nvim | ||
``` | ||
|
||
## `bundler-vim` (for Vim) | ||
|
||
<div class="warning"> | ||
`bundler-vim` is under development. | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
# Vim Configuration | ||
|
||
<div class="warning"> | ||
`bundler-vim` is under development. | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
{ | ||
description = "Neovim with bundler-nvim"; | ||
|
||
inputs = { | ||
bundler.url = "github:ttak0422/bundler"; | ||
nixpkgs.follows = "bundler/nixpkgs"; | ||
flake-parts.follows = "bundler/flake-parts"; | ||
}; | ||
|
||
outputs = inputs@{ bundler, nixpkgs, flake-parts, ... }: | ||
flake-parts.lib.mkFlake { inherit inputs; } { | ||
imports = [ bundler.flakeModules.neovim ]; | ||
systems = nixpkgs.lib.systems.flakeExposed; | ||
|
||
perSystem = { pkgs, ... }: { | ||
|
||
# Please see the documentation for more information. | ||
bundler-nvim = { | ||
|
||
# The configuration defined in `default` can be accessed as `bundler-nvim`. | ||
default = { | ||
|
||
# Define viml code to be executed at startup. | ||
extraConfig = '' | ||
set laststatus=3 | ||
''; | ||
|
||
# Define lua code to be executed at startup. | ||
extraLuaConfig = '' | ||
vim.loader.enable() | ||
''; | ||
|
||
# Define plugins to be loaded at startup. | ||
eagerPlugins = with pkgs.vimPlugins; [{ | ||
plugin = kanagawa-nvim; | ||
|
||
# Define viml code to be executed at startup. | ||
# | ||
# following sample code is equivalent to | ||
# | ||
# ```nix | ||
# startupConfig = { | ||
# language = "vim"; | ||
# code = '' | ||
# colorscheme kanagawa | ||
# ''; | ||
# }; | ||
# | ||
startupConfig = '' | ||
colorscheme kanagawa | ||
''; | ||
}]; | ||
|
||
# define plugins to be lazy loaded. | ||
lazyPlugins = with pkgs.vimPlugins; [{ | ||
plugin = telescope-nvim; | ||
|
||
# `startupConfig` is executed at startup, regardless of whether the plugin is loaded or not. | ||
startupConfig = '' | ||
nnoremap <leader>ff <cmd>Telescope find_files<cr> | ||
nnoremap <leader>fg <cmd>Telescope live_grep<cr> | ||
nnoremap <leader>fb <cmd>Telescope buffers<cr> | ||
nnoremap <leader>fh <cmd>Telescope help_tags<cr> | ||
''; | ||
|
||
# `preConfig` is executed before the plugin is loaded. | ||
preConfig = ""; | ||
|
||
# `postConfig` is executed after the plugin is loaded. | ||
postConfig = { | ||
# Explicit language specification is required when use lua code. | ||
language = "lua"; | ||
code = '' | ||
require('telescope').setup() | ||
''; | ||
}; | ||
|
||
# Load the plugin when the following commands are executed. | ||
onCommands = [ "Telescope" ]; | ||
}]; | ||
}; | ||
|
||
# The configuration defined in `foo` can be accessed as `bundler-nvim-foo`. | ||
foo = { | ||
# ... | ||
}; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
description = "Vim with bundler-vim"; | ||
|
||
inputs = { | ||
bundler.url = "github:ttak0422/bundler"; | ||
nixpkgs.follows = "bundler/nixpkgs"; | ||
flake-parts.follows = "bundler/flake-parts"; | ||
}; | ||
|
||
outputs = inputs@{ bundler, nixpkgs, flake-parts, ... }: | ||
flake-parts.lib.mkFlake { inherit inputs; } { | ||
imports = [ bundler.flakeModules.vim ]; | ||
systems = nixpkgs.lib.systems.flakeExposed; | ||
|
||
perSystem = { pkgs, ... }: { | ||
bundler-vim = { | ||
default = { | ||
eagerPlugins = with pkgs.vimPlugins; [{ | ||
plugin = iceberg-vim; | ||
startupConfig = '' | ||
colorscheme iceberg | ||
''; | ||
}]; | ||
}; | ||
}; | ||
}; | ||
}; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.