Skip to content

Commit

Permalink
plug: smart-open
Browse files Browse the repository at this point in the history
  • Loading branch information
willruggiano committed Jun 25, 2023
1 parent e2795ed commit 308bd0e
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 3 deletions.
21 changes: 21 additions & 0 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
@@ -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
19 changes: 19 additions & 0 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
43 changes: 40 additions & 3 deletions plugins/spec.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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];
Expand All @@ -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";
};
Expand Down
7 changes: 7 additions & 0 deletions plugins/telescope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -108,6 +109,12 @@ return function()
end,
{ desc = "Git files" },
},
["<space>o"] = {
function()
require("telescope").extensions.smart_open.smart_open()
end,
{ desc = "Open" },
},
["<space>p"] = {
function()
require("telescope").extensions.project.project {}
Expand Down

0 comments on commit 308bd0e

Please sign in to comment.