@@ -15,6 +15,13 @@ map("v", "<A-i>", function()
1515 require (" kide.term" ).toggle ()
1616 require (" kide.term" ).send_line (text [1 ])
1717end , { desc = " toggle term" })
18+
19+ map (" n" , " <leader>w" , function ()
20+ vim .print (" ---close--" )
21+ vim .print (vim .bo .bufhidden )
22+ vim .print (vim .bo .buflisted )
23+ end , { desc = " close buf" })
24+
1825map (" n" , " <leader>gb" , require (" gitsigns" ).blame_line , { desc = " gitsigns blame line" })
1926map (" n" , " <ESC>" , " <CMD>noh<CR>" , { desc = " Clear Highlight" })
2027
@@ -34,10 +41,6 @@ map("n", "<C-k>", "<C-w>k", { desc = "switch window up" })
3441-- terminal
3542map (" t" , " <C-x>" , " <C-\\ ><C-N>" , { desc = " terminal escape terminal mode" })
3643
37- map (" n" , " ==" , function ()
38- require (" conform" ).format ({ lsp_fallback = true })
39- end , { desc = " format file" })
40-
4144-- dap
4245map (" n" , " <leader>db" , " <CMD>lua require'dap'.toggle_breakpoint()<CR>" , { desc = " Dap toggle breakpoint" })
4346map (
@@ -67,7 +70,10 @@ command("TaskRunLast", function()
6770 require (" kide.term" ).input_run (true )
6871end , { desc = " Restart Last Task" })
6972
70- map (" v" , " <leader>fm" , function ()
73+ map (" n" , " <C-l>" , function ()
74+ require (" conform" ).format ({ lsp_fallback = true })
75+ end , { desc = " format file" })
76+ map (" v" , " <C-l>" , function ()
7177 vim .api .nvim_feedkeys (" \027 " , " xt" , false )
7278 local start_pos = vim .api .nvim_buf_get_mark (0 , " <" )
7379 local end_pos = vim .api .nvim_buf_get_mark (0 , " >" )
@@ -210,14 +216,6 @@ command("Bp", function()
210216 require (" nvchad.tabufline" ).prev ()
211217end , { desc = " buffer goto prev" })
212218
213- -- jdtls
214- command (" JdtWipeDataAndRestart" , function ()
215- require (" jdtls.setup" ).wipe_data_and_restart ()
216- end , { desc = " Jdt Wipe Data And Restart" })
217- command (" JdtShowLogs" , function ()
218- require (" jdtls.setup" ).show_logs ()
219- end , { desc = " Jdt Show Logs" })
220-
221219-- find files
222220if vim .fn .executable (" fd" ) == 1 then
223221 command (" Fd" , function (opt )
@@ -322,15 +320,23 @@ if vim.fn.executable("fzy") == 1 then
322320 local text = require (" kide.tools" ).get_visual_selection ()
323321 local fzy = require (" kide.fzy" )
324322 local param = vim .fn .shellescape (text [1 ])
325- fzy .execute (" fd --type file " .. param , fzy .sinks .edit_file , " Files " , text )
323+ fzy .execute (" fd --type file " .. param , fzy .sinks .edit_file , " Files " , text [ 1 ] )
326324 end , { desc = " fzy find files" , silent = true , noremap = true })
327325
328326 map (" v" , " <leader>fw" , function ()
329327 vim .api .nvim_feedkeys (" \027 " , " xt" , false )
330328 local text = require (" kide.tools" ).get_visual_selection ()
331329 local fzy = require (" kide.fzy" )
332330 local param = vim .fn .shellescape (text [1 ])
333- fzy .execute (" rg --no-heading --trim -nH --smart-case " .. param , fzy .sinks .edit_live_grep , " Grep " , text )
331+ fzy .execute (" rg --no-heading --trim -nH --smart-case " .. param , fzy .sinks .edit_live_grep , " Grep " , text [1 ])
332+ end , { desc = " fzy live grep" , silent = true , noremap = true })
333+ map (" n" , " <leader>fw" , function ()
334+ local ok , text = pcall (vim .fn .input , " rg: " )
335+ if ok and text and text ~= " " then
336+ local fzy = require (" kide.fzy" )
337+ local param = vim .fn .shellescape (text )
338+ fzy .execute (" rg --no-heading --trim -nH --smart-case " .. param , fzy .sinks .edit_live_grep , " Grep " , text )
339+ end
334340 end , { desc = " fzy live grep" , silent = true , noremap = true })
335341
336342 command (" FzyFiles" , function (opt )
0 commit comments