Skip to content

Commit 46ba844

Browse files
nvim: refine curl wrapper
1 parent f6a40c7 commit 46ba844

File tree

5 files changed

+61
-9
lines changed

5 files changed

+61
-9
lines changed

modules/nvim/default.nix

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,29 @@ let
1313
};
1414
};
1515

16+
rest-nvim = pkgs.vimUtils.buildVimPlugin {
17+
name = "rest-nvim";
18+
src = pkgs.fetchFromGitHub {
19+
owner = "rest-nvim";
20+
repo = "rest.nvim";
21+
rev = "v1.2.1";
22+
sha256 = "sha256-fX4KIazW7iKO157cQdfBoz7g+eyOSQIFje8ZB7SeAx8=";
23+
};
24+
};
25+
26+
# TODO:
27+
# 1. this is canary version, once v2 is stable, change it.
28+
# 1. update config and keymap
29+
hurl-nvim = pkgs.vimUtils.buildVimPlugin {
30+
name = "hurl-nvim";
31+
src = pkgs.fetchFromGitHub {
32+
owner = "jellydn";
33+
repo = "hurl.nvim";
34+
rev = "canary";
35+
sha256 = "sha256-RSMEInn2yUfufcHM6SKgD1EmmW2vt57o+kvTYrI/jTo=";
36+
};
37+
};
38+
1639
colorscheme = with pkgs.vimPlugins; [
1740
solarized-nvim
1841
];
@@ -40,6 +63,7 @@ let
4063
tree-sitter-toml
4164
tree-sitter-yaml
4265
tree-sitter-markdown
66+
hurl
4367
]))
4468
nvim-treesitter-context
4569
nvim-treesitter-textobjects
@@ -67,6 +91,7 @@ let
6791
neotest-go
6892
nvim-coverage
6993
rest-nvim
94+
hurl-nvim
7095
];
7196

7297
telescope = with pkgs.vimPlugins; [
@@ -83,6 +108,7 @@ let
83108
lualine-nvim
84109
nvim-web-devicons
85110
nvim-colorizer-lua
111+
nui-nvim
86112
];
87113

88114
git = with pkgs.vimPlugins; [
@@ -122,6 +148,7 @@ in
122148
manix
123149
luajit
124150
lua-language-server
151+
luarocks
125152
go
126153
gopls
127154
delve
@@ -137,6 +164,7 @@ in
137164
jdt-language-server
138165
flutter
139166
ast-grep
167+
hurl
140168
];
141169

142170
home-manager.sharedModules = [{
@@ -146,6 +174,7 @@ in
146174
vimAlias = true;
147175
defaultEditor = true;
148176
extraLuaConfig = builtins.readFile ./init.lua;
177+
extraLuaPackages = ps: [ ps.luarocks ];
149178
plugins =
150179
colorscheme ++
151180
treesitter ++
@@ -163,6 +192,10 @@ in
163192
recursive = true;
164193
source = ./lua;
165194
};
195+
"nvim/ftplugin" = {
196+
recursive = true;
197+
source = ./ftplugin;
198+
};
166199
};
167200
}];
168201
};

modules/nvim/ftplugin/json.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
vim.bo.formatexpr = ''
2+
vim.bo.formatprg = 'jq'

modules/nvim/lua/minizilla/telescope.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ telescope.load_extension('file_browser')
109109
telescope.load_extension('manix')
110110
telescope.load_extension('dap')
111111
telescope.load_extension('git_worktree')
112+
telescope.load_extension('rest')
112113

113114
local nmap = Lib.keymapper('n', { silent = true })
114115
nmap('<C-p>', builtin.find_files)
@@ -120,3 +121,4 @@ nmap('<Leader>fk', builtin.keymaps)
120121
-- nmap('<Leader>fb', extensions.file_browser.file_browser)
121122
nmap('<Leader>fg', extensions.live_grep_args.live_grep_args)
122123
nmap('<Leader>fn', extensions.manix.manix)
124+
nmap('<Leader>en', extensions.rest.select_env)

modules/nvim/lua/minizilla/test.lua

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
local neotest = require('neotest')
22
local coverage = require('coverage')
33
local rest_nvim = require('rest-nvim')
4+
local hurl = require('hurl')
45

56
coverage.setup {
67
commands = false,
78
}
89

9-
rest_nvim.setup()
10-
1110
vim.api.nvim_create_autocmd('ColorScheme', {
1211
desc = 'Add nvim-coverage highlight',
1312
callback = function()
@@ -41,6 +40,15 @@ neotest.setup {
4140
},
4241
}
4342

43+
rest_nvim.setup {
44+
result = {
45+
show_curl_command = true,
46+
}
47+
}
48+
49+
hurl.setup {
50+
env_file = { '.env' },
51+
}
4452

4553
local nmap = Lib.keymapper('n', { silent = true })
4654
nmap('<Leader>tt', function() neotest.run.run(vim.fn.expand('%:h')) end, '[t]es[t]')

modules/nvim/lua/minizilla/ui.lua

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
local lualine = require('lualine')
22

33
local sections = lualine.get_config().sections
4-
sections.lualine_c = {
5-
{
6-
'filename',
7-
path = 1,
8-
symbols = {
9-
unnamed = '',
10-
newfile = '',
4+
sections = {
5+
lualine_c = {
6+
{
7+
'filename',
8+
path = 1,
9+
symbols = {
10+
unnamed = '',
11+
newfile = '',
12+
},
13+
},
14+
},
15+
lualine_x = {
16+
{
17+
'rest'
1118
},
1219
},
1320
}

0 commit comments

Comments
 (0)