Compare commits
No commits in common. "bbf89f57527d722d00494398866d59f73b4c0a63" and "363170e4adeb6d0ea7319336da4b63bc6d844561" have entirely different histories.
bbf89f5752
...
363170e4ad
3 changed files with 9 additions and 27 deletions
|
|
@ -479,7 +479,6 @@ end
|
|||
map('n', '<leader>ex', function() require('fyler').toggle { kind = 'split_left_most' } end, 'Toggle file tree')
|
||||
map('n', '<leader>fs', '<cmd>w<cr>', 'Save file')
|
||||
map('n', '<leader>ff', function() require('find-file').open() end, 'Find file')
|
||||
|
||||
map('n', '<leader>fr', function() require('snacks').picker.recent() end, 'Find recent file')
|
||||
map('n', '<leader>:', function() require('snacks').picker.command_history() end, 'Command history')
|
||||
-- map('n', '<leader>ex', function() require('snacks').explorer() end, 'Toggle file tree')
|
||||
|
|
@ -489,16 +488,12 @@ map('n', '<leader>.', function() require('snacks').scratch() end, 'Scratch buffe
|
|||
map('n', '<leader>sf', function() require('snacks').picker.files() end, 'Search file')
|
||||
map('n', '<leader>sg', function() require('snacks').picker.grep() end, 'Search grep')
|
||||
map('n', '<leader>sw', function() require('snacks').picker.grep_word() end, 'Search grep word')
|
||||
map('n', '<leader>sb', function() require('snacks').picker.lines() end, 'Buffer lines')
|
||||
map('n', '<leader>sB', function() require('snacks').picker.lines() end, 'Grep open buffers')
|
||||
map('n', '<leader>ls', function() require('snacks').picker.lsp_symbols() end, 'LSP Symbols')
|
||||
map('n', '<leader>lS', function() require('snacks').picker.lsp_workspace_symbols() end, 'LSP Workspace Symbols')
|
||||
map('n', '<leader>zz', function() require('snacks').zen() end, 'Toggle zen mode')
|
||||
map('n', '<leader>zm', function() require('snacks').zen.zoom() end, 'Toggle Zoom')
|
||||
|
||||
map('n', '<leader>qq', function() require('quicker').open { focus = true } end, 'Open/focus quickfix')
|
||||
map('n', '<leader>ql', function() require('quicker').toggle { loclist = true } end, 'Toggle loclist')
|
||||
|
||||
map('n', '<leader>cc', function() require('compile-mode').compile() end, 'Compile')
|
||||
map('n', '<leader>cC', function() require('compile-mode').recompile() end, 'Recompile')
|
||||
map('n', '<leader>cr', '<cmd>source $MYVIMRC<cr>', 'Reload config')
|
||||
|
|
|
|||
|
|
@ -684,7 +684,7 @@ function M.compile()
|
|||
|
||||
-- Cycle to next completion candidate
|
||||
if config.input_keymaps.next then
|
||||
local next_fn = function()
|
||||
vim.keymap.set('i', config.input_keymaps.next, function()
|
||||
if #matches == 0 then
|
||||
matches = get_matches(current_input)
|
||||
if #matches == 0 then return end
|
||||
|
|
@ -696,14 +696,12 @@ function M.compile()
|
|||
current_input = table.concat(words, ' ')
|
||||
last_input = current_input
|
||||
vim.schedule(update_display)
|
||||
end
|
||||
vim.keymap.set('i', config.input_keymaps.next, next_fn, opts)
|
||||
vim.keymap.set('n', config.input_keymaps.next, next_fn, opts)
|
||||
end, opts)
|
||||
end
|
||||
|
||||
-- Cycle to previous completion candidate
|
||||
if config.input_keymaps.prev then
|
||||
local prev_fn = function()
|
||||
vim.keymap.set('i', config.input_keymaps.prev, function()
|
||||
if #matches == 0 then
|
||||
matches = get_matches(current_input)
|
||||
if #matches == 0 then return end
|
||||
|
|
@ -716,9 +714,7 @@ function M.compile()
|
|||
current_input = table.concat(words, ' ')
|
||||
last_input = current_input
|
||||
vim.schedule(update_display)
|
||||
end
|
||||
vim.keymap.set('i', config.input_keymaps.prev, prev_fn, opts)
|
||||
vim.keymap.set('n', config.input_keymaps.prev, prev_fn, opts)
|
||||
end, opts)
|
||||
end
|
||||
|
||||
-- Complete to selected candidate
|
||||
|
|
@ -794,12 +790,7 @@ function M.compile()
|
|||
local close_keys = type(config.input_keymaps.close) == 'table' and config.input_keymaps.close --[[@as string[] ]]
|
||||
or { config.input_keymaps.close }
|
||||
for _, key in ipairs(close_keys) do
|
||||
if key then
|
||||
-- In insert mode: exit to normal mode first
|
||||
vim.keymap.set('i', key, '<Esc>', opts)
|
||||
-- In normal mode: close the prompt
|
||||
vim.keymap.set('n', key, function() vim.schedule(close) end, opts)
|
||||
end
|
||||
if key then vim.keymap.set({ 'i', 'n' }, key, function() vim.schedule(close) end, opts) end
|
||||
end
|
||||
|
||||
-- Delete path component
|
||||
|
|
|
|||
|
|
@ -332,7 +332,7 @@ function M.open_dir(start_path)
|
|||
|
||||
local last_input = current_input
|
||||
|
||||
vim.api.nvim_create_autocmd({ 'TextChanged', 'TextChangedI' }, {
|
||||
vim.api.nvim_create_autocmd({ 'TextChangedI' }, {
|
||||
buffer = input_buf,
|
||||
callback = function()
|
||||
if lock or cycling then return end
|
||||
|
|
@ -354,7 +354,7 @@ function M.open_dir(start_path)
|
|||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, {
|
||||
vim.api.nvim_create_autocmd({ 'CursorMovedI' }, {
|
||||
buffer = input_buf,
|
||||
callback = function()
|
||||
if lock or cycling then return end
|
||||
|
|
@ -456,13 +456,9 @@ function M.open_dir(start_path)
|
|||
end, { buffer = input_buf, nowait = true, expr = true, desc = 'Open file or directory' })
|
||||
|
||||
---@type string[]
|
||||
local close_keys = type(config.keymaps.close) == 'table' and config.keymaps.close --[[@as string[] ]]
|
||||
or { config.keymaps.close }
|
||||
local close_keys = type(config.keymaps.close) == 'table' and config.keymaps.close --[[@as string[] ]] or { config.keymaps.close }
|
||||
for _, key in ipairs(close_keys) do
|
||||
-- In insert mode: exit to normal mode first
|
||||
vim.keymap.set('i', key, '<Esc>', vim.tbl_extend('force', opts, { desc = 'Exit to normal mode' }))
|
||||
-- In normal mode: close the prompt
|
||||
vim.keymap.set('n', key, function() vim.schedule(close) end, vim.tbl_extend('force', opts, { desc = 'Close find-file' }))
|
||||
vim.keymap.set({ 'n', 'i' }, key, function() vim.schedule(close) end, vim.tbl_extend('force', opts, { desc = 'Close find-file' }))
|
||||
end
|
||||
|
||||
vim.keymap.set('i', config.keymaps.delete_component, function()
|
||||
|
|
|
|||
Loading…
Reference in a new issue