diff --git a/Taskfile.yaml b/Taskfile.yaml new file mode 100644 index 0000000..4c19a07 --- /dev/null +++ b/Taskfile.yaml @@ -0,0 +1,21 @@ +version: '3' + +tasks: + default: + deps: + - run + build: + cmds: + - nix build + aliases: + - b + install: + cmds: + - nix profile upgrade --impure 0 + aliases: + - i + run: + cmds: + - nix run + aliases: + - r diff --git a/nix/sources.json b/nix/sources.json index 03a8bfe..7cc1089 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -443,6 +443,18 @@ "rev": "e7c40818b2995016ede93c5620055206b1aba44f", "type": "git" }, + "smart-open.nvim": { + "branch": "main", + "repo": "git@github.com:danielfalk/smart-open.nvim", + "rev": "e67d3cc01cfa863f7d5e16b2b2f0bf2bf46f6283", + "type": "git" + }, + "sqlite.lua": { + "branch": "master", + "repo": "git@github.com:kkharji/sqlite.lua", + "rev": "b7e28c8463254c46a8e61c52d27d6a2040492fc3", + "type": "git" + }, "statuscol.nvim": { "branch": "main", "repo": "ssh://git@github.com/luukvbaal/statuscol.nvim", @@ -467,6 +479,13 @@ "rev": "580b6c48651cabb63455e97d7e131ed557b8c7e2", "type": "git" }, + "telescope-fzy-native.nvim": { + "branch": "master", + "repo": "git@github.com:nvim-telescope/telescope-fzy-native.nvim", + "rev": "282f069504515eec762ab6d6c89903377252bf5b", + "submodules": true, + "type": "git" + }, "telescope-github.nvim": { "branch": "master", "repo": "git@github.com:willruggiano/telescope-github.nvim", diff --git a/plugins/spec.nix b/plugins/spec.nix index ab3b469..5388a26 100644 --- a/plugins/spec.nix +++ b/plugins/spec.nix @@ -71,9 +71,7 @@ in rec { fuzzy_nvim = { src = sources."fuzzy.nvim"; }; - fzy-lua-native = { - src = sources.fzy-lua-native; - }; + inherit fzy-lua-native; }; }; cmp-git = { @@ -187,6 +185,22 @@ in rec { neovim-utils.toLuarocksPlugin luafun; }; + fzy-lua-native = let + package = pkgs.vimUtils.buildVimPluginFrom2Nix { + name = "fzy-lua-native"; + version = sources.fzy-lua-native.rev; + src = sources.fzy-lua-native; + }; + in { + inherit package; + init = pkgs.writeTextFile { + name = "fzy-lua-native.lua"; + text = '' + package.cpath = package.cpath .. ";" .. "${package}/static/?.so"; + ''; + }; + }; + gh = { src = sources."gh.nvim"; config = ./github.lua; @@ -525,6 +539,23 @@ in rec { config = ./telescope.lua; dependencies = { inherit nvim-web-devicons; + smart-open = { + src = sources."smart-open.nvim"; + dependencies = { + sqlite = { + src = sources."sqlite.lua"; + init = pkgs.writeTextFile { + name = "sqlite.lua"; + text = '' + return function() + vim.g.sqlite_clib_path = "${pkgs.sqlite.out}/lib/libsqlite3.so" + end + ''; + }; + }; + }; + paths = with pkgs; [ripgrep]; + }; telescope-docsets = { src = sources."telescope-docsets.nvim"; paths = with pkgs; [dasht elinks]; @@ -536,6 +567,12 @@ in rec { buildPhase = ""; }; }; + telescope-fzy-native = { + src = sources."telescope-fzy-native.nvim"; + dependencies = { + inherit fzy-lua-native; + }; + }; telescope-project = { src = sources."telescope-project.nvim"; }; diff --git a/plugins/telescope.lua b/plugins/telescope.lua index 2ddbcbe..5c39d6d 100644 --- a/plugins/telescope.lua +++ b/plugins/telescope.lua @@ -86,6 +86,7 @@ return function() telescope.load_extension "docsets" telescope.load_extension "fzf" telescope.load_extension "project" + telescope.load_extension "smart_open" telescope.load_extension "ui-select" local nnoremap = require("bombadil.lib.keymap").nnoremap @@ -108,6 +109,12 @@ return function() end, { desc = "Git files" }, }, + ["o"] = { + function() + require("telescope").extensions.smart_open.smart_open() + end, + { desc = "Open" }, + }, ["p"] = { function() require("telescope").extensions.project.project {}