@@ -228,6 +228,7 @@ vim.keymap.set('n', '<C-\\>', function()
228
228
if vim .api .nvim_buf_is_loaded (bufnr ) then
229
229
return true
230
230
end
231
+ return false
231
232
end , vim .api .nvim_list_bufs ())
232
233
233
234
table.sort (bufnrs , function (a , b )
@@ -263,6 +264,9 @@ vim.keymap.set('n', 'K', function()
263
264
vim .cmd { cmd = ' Rg' , args = { vim .fn .expand ' <cword>' } }
264
265
end , { desc = ' Search Word and push to qf' })
265
266
267
+ -- in RSI
268
+ -- vim.keymap.set('i', '<C-E>', '<End>')
269
+
266
270
-- [[ END MY OPTS ]]
267
271
268
272
-- [[ Basic Keymaps ]]
@@ -631,6 +635,7 @@ require('lazy').setup({
631
635
end , { desc = ' [S]earch [N]eovim files' })
632
636
633
637
vim .keymap .set (' n' , ' <leader>sG' , function ()
638
+ local path = vim .fn .expand ' %:h'
634
639
local out = vim .system ({ ' fd' , ' -H' , ' --type' , ' d' , ' --color' , ' never' }, { text = true }):wait ()
635
640
-- local out = vim.system({ 'rg', '--files', '--hidden', '--color', 'never' }, { text = true }):wait()
636
641
@@ -653,11 +658,16 @@ require('lazy').setup({
653
658
.new (opts , {
654
659
prompt_title = ' Grep in dir' ,
655
660
finder = finders .new_table {
656
- results = { ' red' , ' green' , ' blue' },
657
661
results = results ,
658
662
},
659
663
sorter = conf .file_sorter (opts ),
664
+ default_text = path ,
660
665
attach_mappings = function (prompt_bufnr , map )
666
+ map (' i' , ' <c-space>' , function (prompt_bufnr )
667
+ local current_picker = action_state .get_current_picker (prompt_bufnr )
668
+ current_picker :reset_prompt ' '
669
+ -- current_picker:set_prompt(path, false)
670
+ end )
661
671
actions .select_default :replace (function ()
662
672
actions .close (prompt_bufnr )
663
673
local selection = action_state .get_selected_entry ()
@@ -1070,6 +1080,8 @@ require('lazy').setup({
1070
1080
local luasnip = require ' luasnip'
1071
1081
luasnip .config .setup {}
1072
1082
1083
+ -- local my_preset = cmp.mapping.preset
1084
+
1073
1085
cmp .setup {
1074
1086
snippet = {
1075
1087
expand = function (args )
@@ -1108,6 +1120,13 @@ require('lazy').setup({
1108
1120
-- completions whenever it has completion options available.
1109
1121
[' <C-Space>' ] = cmp .mapping .complete {},
1110
1122
1123
+ [' <C-e>' ] = {
1124
+ i = function ()
1125
+ cmp .mapping .abort ()
1126
+ vim .api .nvim_feedkeys (vim .api .nvim_replace_termcodes (' <End>' , true , false , true ), ' n' , false )
1127
+ end ,
1128
+ },
1129
+
1111
1130
-- Think of <c-l> as moving to the right of your snippet expansion.
1112
1131
-- So if you have a snippet that's like:
1113
1132
-- function $name($args)
0 commit comments