1
0
Fork 0

nvim: Update configuration

This commit is contained in:
Daniel Kempkens 2022-04-15 22:43:51 +02:00
parent 2523e05dcc
commit 4f8abcd9c4
6 changed files with 64 additions and 51 deletions

View file

@ -1,5 +1,5 @@
(let [cmp (require :cmp) (let [cmp (require :cmp)
snippy (require :snippy) luasnip (require :luasnip)
lspkind (require :lspkind) lspkind (require :lspkind)
npairs (require :nvim-autopairs.completion.cmp)] npairs (require :nvim-autopairs.completion.cmp)]
(fn has-words-before? [] (fn has-words-before? []
@ -12,17 +12,17 @@
(fn map-tab [fallback] (fn map-tab [fallback]
(if (cmp.visible) (cmp.select_next_item) (if (cmp.visible) (cmp.select_next_item)
(snippy.can_expand_or_advance) (snippy.expand_or_advance) (luasnip.expand_or_jumpable) (luasnip.expand_or_jump)
(has-words-before?) (cmp.complete) (has-words-before?) (cmp.complete)
(fallback))) (fallback)))
(fn map-stab [fallback] (fn map-stab [fallback]
(if (cmp.visible) (cmp.select_prev_item) (if (cmp.visible) (cmp.select_prev_item)
(snippy.can_jump -1) (snippy.previous) (luasnip.jumpable -1) (luasnip.jump -1)
(fallback))) (fallback)))
(cmp.setup {:sources (cmp.config.sources [{:name :nvim_lsp} (cmp.setup {:sources (cmp.config.sources [{:name :nvim_lsp}
{:name :snippy} {:name :luasnip}
{:name :nvim_lua}] {:name :nvim_lua}]
[{:name :treesitter} [{:name :treesitter}
{:name :buffer} {:name :buffer}
@ -53,7 +53,7 @@
"╰" "╰"
"│"]}} "│"]}}
:snippet {:expand (fn [args] :snippet {:expand (fn [args]
(snippy.expand_snippet args.body))} (luasnip.lsp_expand args.body))}
:formatting {:format (lspkind.cmp_format)}}) :formatting {:format (lspkind.cmp_format)}})
(cmp.setup.cmdline "/" (cmp.setup.cmdline "/"
{:sources (cmp.config.sources [{:name :nvim_lsp_document_symbol}] {:sources (cmp.config.sources [{:name :nvim_lsp_document_symbol}]

View file

@ -0,0 +1,2 @@
(let [luasnip-vscode (require :luasnip.loaders.from_vscode)]
(luasnip-vscode.lazy_load))

View file

@ -73,11 +73,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1649887921, "lastModified": 1649984295,
"narHash": "sha256-h2LZzn5LLwIFvVFLCdR8+VWluEP3U1I5y+0mDZjFjAk=", "narHash": "sha256-55dgKGs7W8eC3s9GYewll9y4IlP/KAlSinjQwshNpxM=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "92f58b6728e7c631a7ea0ed68cd21bb29a4876ff", "rev": "d49d68f4196d32c5039cb9e91d730cee894f6f14",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -186,11 +186,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1649897071, "lastModified": 1649983175,
"narHash": "sha256-KX3hG1+pPK2ESIT4914SfNIOLaZ4LvPsSK0hOBAnqGE=", "narHash": "sha256-7TUy8tF/Kgebozx0gnwmHUQz9bWk9UrMsdxdgMtUvCs=",
"owner": "arqv", "owner": "arqv",
"repo": "zig-overlay", "repo": "zig-overlay",
"rev": "03fa63d355c9b82f19303fd8b944b895e62adf44", "rev": "40b26de1698b2b1734c127b22db2beaa043fd1ee",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -148,6 +148,13 @@ in
type = "fennel"; type = "fennel";
} }
# Snippets
{
plugin = LuaSnip;
config = builtins.readFile ../../config/nvim/plugins/luasnip.fnl;
type = "fennel";
}
# cmp # cmp
{ {
plugin = nvim-cmp; plugin = nvim-cmp;
@ -157,8 +164,7 @@ in
cmp-nvim-lsp cmp-nvim-lsp
cmp-nvim-lsp-signature-help cmp-nvim-lsp-signature-help
nvim-snippy cmp_luasnip
cmp-snippy
cmp-nvim-lua cmp-nvim-lua
cmp-path cmp-path
cmp-buffer cmp-buffer
@ -288,6 +294,9 @@ in
type = "fennel"; type = "fennel";
} }
# Snippets
friendly-snippets
# Textobjects # Textobjects
vim-surround vim-surround
@ -303,7 +312,7 @@ in
}; };
xdg.configFile."nvim" = { xdg.configFile."nvim" = {
source = pkgs.runCommandLocal "nvim-fennel-files" source = pkgs.runCommand "nvim-fennel-files"
{ {
nativeBuildInputs = [ pkgs.fennel pkgs.stylua ]; nativeBuildInputs = [ pkgs.fennel pkgs.stylua ];
} '' } ''

View file

@ -39,12 +39,12 @@
}; };
legendary-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix { legendary-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "legendary.nvim"; pname = "legendary.nvim";
version = "1649956876"; version = "1650043687";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "mrjones2014"; owner = "mrjones2014";
repo = "legendary.nvim"; repo = "legendary.nvim";
rev = "170ecf60b417907bade27e30e3f628c389ab3fe2"; rev = "8ab6ba601a5ff2baa54e44d3e81bd31413bf63d6";
sha256 = "bhTuZWYSLEawA9C9TMYAfuP3+53+sCmIC0OFj6IaxdQ="; sha256 = "EWewlioREzNJ9gvueqjlorrLM3dIy3Ex1vEBNUuS66Q=";
fetchSubmodules = true; fetchSubmodules = true;
}; };
meta.homepage = "https://github.com/mrjones2014/legendary.nvim"; meta.homepage = "https://github.com/mrjones2014/legendary.nvim";
@ -111,12 +111,12 @@
}; };
nvim-treesitter = pkgs.vimUtils.buildVimPluginFrom2Nix { nvim-treesitter = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "nvim-treesitter"; pname = "nvim-treesitter";
version = "1649961252"; version = "1650041891";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "nvim-treesitter"; owner = "nvim-treesitter";
repo = "nvim-treesitter"; repo = "nvim-treesitter";
rev = "0fc170120a5ca69164f6bd4da3b26fd01aa41592"; rev = "d9cc414e693b6421c8e0d79835e7d30d835338bd";
sha256 = "DnPov+oOJwINpqyvqvtemwhRyfQTn45I+kLtn20KhVU="; sha256 = "TuaQ/zeKvfIr7cRQfiEBWuUyo45/Qdj49CnOthAhrGA=";
fetchSubmodules = true; fetchSubmodules = true;
}; };
meta.homepage = "https://github.com/nvim-treesitter/nvim-treesitter"; meta.homepage = "https://github.com/nvim-treesitter/nvim-treesitter";
@ -190,12 +190,12 @@
}; };
nvim-lspconfig = pkgs.vimUtils.buildVimPluginFrom2Nix { nvim-lspconfig = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "nvim-lspconfig"; pname = "nvim-lspconfig";
version = "1649567599"; version = "1649985901";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "neovim"; owner = "neovim";
repo = "nvim-lspconfig"; repo = "nvim-lspconfig";
rev = "fd7843ad04cbc8ee2181bed9c3e83839b0d0b285"; rev = "99596a8cabb050c6eab2c049e9acde48f42aafa4";
sha256 = "xq0OLYEVWIYAMo+oKZl6pNzDhLZVCVsFt/OoSSkVjAQ="; sha256 = "qU9D2bGRS6gDIxY8pgjwTVEwDTa8GXHUUQkXk9pBK/U=";
fetchSubmodules = true; fetchSubmodules = true;
}; };
meta.homepage = "https://github.com/neovim/nvim-lspconfig"; meta.homepage = "https://github.com/neovim/nvim-lspconfig";
@ -236,6 +236,18 @@
}; };
meta.homepage = "https://github.com/lukas-reineke/lsp-format.nvim"; meta.homepage = "https://github.com/lukas-reineke/lsp-format.nvim";
}; };
LuaSnip = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "LuaSnip";
version = "1650006023";
src = pkgs.fetchFromGitHub {
owner = "L3MON4D3";
repo = "LuaSnip";
rev = "6b67cb12747225a6412d8263bb97d6d2b8d9366a";
sha256 = "w73j+QzR+qriRplGP56TePaGUCAkQgBbMZjV8dGcQSE=";
fetchSubmodules = true;
};
meta.homepage = "https://github.com/L3MON4D3/LuaSnip";
};
nvim-cmp = pkgs.vimUtils.buildVimPluginFrom2Nix { nvim-cmp = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "nvim-cmp"; pname = "nvim-cmp";
version = "1649936528"; version = "1649936528";
@ -272,29 +284,17 @@
}; };
meta.homepage = "https://github.com/hrsh7th/cmp-nvim-lsp-signature-help"; meta.homepage = "https://github.com/hrsh7th/cmp-nvim-lsp-signature-help";
}; };
nvim-snippy = pkgs.vimUtils.buildVimPluginFrom2Nix { cmp_luasnip = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "nvim-snippy"; pname = "cmp_luasnip";
version = "1649802147"; version = "1648846007";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "dcampos"; owner = "saadparwaiz1";
repo = "nvim-snippy"; repo = "cmp_luasnip";
rev = "4dd4f1146248c0986d3fa6e22e6a31f591b903e9"; rev = "b10829736542e7cc9291e60bab134df1273165c9";
sha256 = "5Rids2bDRaK1EfRglCnhfKxCgZJl3qBStglq6jbPPn0="; sha256 = "1JiDa7fK9AEMUxLOFD3SSsxKEVLfd5xR8vfUlLRqz+M=";
fetchSubmodules = true; fetchSubmodules = true;
}; };
meta.homepage = "https://github.com/dcampos/nvim-snippy"; meta.homepage = "https://github.com/saadparwaiz1/cmp_luasnip";
};
cmp-snippy = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "cmp-snippy";
version = "1632148155";
src = pkgs.fetchFromGitHub {
owner = "dcampos";
repo = "cmp-snippy";
rev = "9af1635fe40385ffa3dabf322039cb5ae1fd7d35";
sha256 = "vseoNZtB8jPGAJD8zFJigwKn11rXsNy04ipg0fYM46k=";
fetchSubmodules = true;
};
meta.homepage = "https://github.com/dcampos/cmp-snippy";
}; };
cmp-nvim-lua = pkgs.vimUtils.buildVimPluginFrom2Nix { cmp-nvim-lua = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "cmp-nvim-lua"; pname = "cmp-nvim-lua";
@ -442,12 +442,12 @@
}; };
indent-blankline-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix { indent-blankline-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "indent-blankline.nvim"; pname = "indent-blankline.nvim";
version = "1649663069"; version = "1649991995";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "lukas-reineke"; owner = "lukas-reineke";
repo = "indent-blankline.nvim"; repo = "indent-blankline.nvim";
rev = "db7d3ad34e020f1cc30e06bab9dd4e98ebde5643"; rev = "045d9582094b27f5ae04d8b635c6da8e97e53f1d";
sha256 = "d0Celb62TSecMJGb5MckQk5JerurXxFdH5Y0Jf/3o64="; sha256 = "pMVby6w7UTR2f1Nxp0ZPlV+KrdXNJ+jEQeQe30Pfs3M=";
fetchSubmodules = true; fetchSubmodules = true;
}; };
meta.homepage = "https://github.com/lukas-reineke/indent-blankline.nvim"; meta.homepage = "https://github.com/lukas-reineke/indent-blankline.nvim";
@ -478,12 +478,12 @@
}; };
gitsigns-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix { gitsigns-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "gitsigns.nvim"; pname = "gitsigns.nvim";
version = "1649949249"; version = "1650039181";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "lewis6991"; owner = "lewis6991";
repo = "gitsigns.nvim"; repo = "gitsigns.nvim";
rev = "dd60a8845d0e701321c6352376e38c68d3693a0b"; rev = "e899189c362d856b9229aaa339a48549dd0cef39";
sha256 = "JNzYxUOi9rEnJZabfWBGb4kIXQaUYKAbP+SD7/+GaD4="; sha256 = "xf47/cEsWk6sYPRHc7Y9MCH4OKLN8I7Y9pEBbQYDwj8=";
fetchSubmodules = true; fetchSubmodules = true;
}; };
meta.homepage = "https://github.com/lewis6991/gitsigns.nvim"; meta.homepage = "https://github.com/lewis6991/gitsigns.nvim";

View file

@ -39,12 +39,14 @@
- src: jubnzv/virtual-types.nvim - src: jubnzv/virtual-types.nvim
- src: lukas-reineke/lsp-format.nvim - src: lukas-reineke/lsp-format.nvim
# Snippets
- src: L3MON4D3/LuaSnip
# cmp # cmp
- src: hrsh7th/nvim-cmp - src: hrsh7th/nvim-cmp
- src: hrsh7th/cmp-nvim-lsp - src: hrsh7th/cmp-nvim-lsp
- src: hrsh7th/cmp-nvim-lsp-signature-help - src: hrsh7th/cmp-nvim-lsp-signature-help
- src: dcampos/nvim-snippy - src: saadparwaiz1/cmp_luasnip
- src: dcampos/cmp-snippy
- src: hrsh7th/cmp-nvim-lua - src: hrsh7th/cmp-nvim-lua
- src: hrsh7th/cmp-path - src: hrsh7th/cmp-path
- src: hrsh7th/cmp-buffer - src: hrsh7th/cmp-buffer