this repo has no description

.config/nvim/.../fzflua: update go test mappings

+30 -1
+30 -1
private_dot_config/nvim/lua/seruman/plugins/fzflua.lua
··· 146 146 }) 147 147 end 148 148 149 - vim.keymap.set("n", "<leader>fut", search_go_tests, { buffer = true, desc = "Fuzzy Unit Tests" }) 149 + local function search_go_tests_in_current_file() 150 + local current_file = vim.fn.expand("%:p") 151 + if current_file == "" then 152 + print("No file is currently open.") 153 + return 154 + end 155 + return require("fzf-lua").fzf_exec("listests --vimgrep " .. current_file, { 156 + prompt = "Go Tests in Current File> ", 157 + file_icons = true, 158 + color_icons = true, 159 + actions = require("fzf-lua").defaults.actions.files, 160 + previewer = "builtin", 161 + }) 162 + end 163 + 164 + -- register user commands 165 + vim.api.nvim_create_user_command("FzfGoTests", search_go_tests, { desc = "Fuzzy Go Tests" }) 166 + vim.api.nvim_create_user_command( 167 + "FzfGoTestsCurrentFile", 168 + search_go_tests_in_current_file, 169 + { desc = "Fuzzy Go Tests in Current File" } 170 + ) 171 + 172 + vim.keymap.set("n", "<leader>fut", search_go_tests, { desc = "Fuzzy Unit Tests" }) 173 + vim.keymap.set( 174 + "n", 175 + "<leader>fuc", 176 + search_go_tests_in_current_file, 177 + { desc = "Fuzzy Unit Tests in Current File" } 178 + ) 150 179 end, 151 180 }, 152 181 }