A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/LnL7/vim-nix/commit/9b2e5c5d389e4a7f2b587ae1fdf7a46143993f21 below:

add NixEdit command to naviage nixpkgs by attribute name · LnL7/vim-nix@9b2e5c5 · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+23

-0

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+23

-0

lines changed Original file line number Diff line number Diff line change

@@ -0,0 +1,23 @@

1 +

function! nix#find_drv_position()

2 +

let line = search("description")

3 +

if line == 0

4 +

let line = search("name")

5 +

endif

6 +

if line == 0

7 +

echo "error: could not find derivation"

8 +

return

9 +

endif

10 + 11 +

return expand("%") . ":" . line

12 +

endfunction

13 + 14 +

function! nix#edit(attr)

15 +

let output = system("nix-instantiate --eval ./. -A " . a:attr . ".meta.position")

16 +

if match(output, "^error:") == -1

17 +

let position = split(split(output, '"')[0], ":")

18 +

execute "edit " . position[0]

19 +

execute position[1]

20 +

endif

21 +

endfunction

22 + 23 +

command! -bang -nargs=* NixEdit call nix#edit(<q-args>)

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4