fix cmp & invert ff/fb & conform
This commit is contained in:
parent
f822d78283
commit
98c76f67f2
|
|
@ -69,8 +69,8 @@ return {
|
||||||
vim.keymap.set('n', '<leader>cr', builtin.lsp_references, { desc = 'Telescope lsp references' })
|
vim.keymap.set('n', '<leader>cr', builtin.lsp_references, { desc = 'Telescope lsp references' })
|
||||||
vim.keymap.set('n', '<leader>cs', builtin.treesitter, { desc = 'Telescope treesitter' })
|
vim.keymap.set('n', '<leader>cs', builtin.treesitter, { desc = 'Telescope treesitter' })
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = 'Telescope find files' })
|
vim.keymap.set('n', '<leader>fp', builtin.find_files, { desc = 'Telescope find in project' })
|
||||||
vim.keymap.set('n', '<leader>fb', function()
|
vim.keymap.set('n', '<leader>ff', function()
|
||||||
builtin.find_files({ cwd = utils.buffer_dir() })
|
builtin.find_files({ cwd = utils.buffer_dir() })
|
||||||
end, { desc = 'Telescope find in buffer dir' })
|
end, { desc = 'Telescope find in buffer dir' })
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,8 @@ return {
|
||||||
"hrsh7th/cmp-path",
|
"hrsh7th/cmp-path",
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require('cmp').setup({
|
local cmp = require('cmp')
|
||||||
|
cmp.setup({
|
||||||
completion = {
|
completion = {
|
||||||
keyword_length = 1,
|
keyword_length = 1,
|
||||||
max_item_count = 6
|
max_item_count = 6
|
||||||
|
|
@ -24,6 +25,11 @@ return {
|
||||||
{ name = "nvim_lsp", keyword_length = 1, max_item_count = 6 },
|
{ name = "nvim_lsp", keyword_length = 1, max_item_count = 6 },
|
||||||
{ name = "buffer", keyword_length = 1, max_item_count = 6 },
|
{ name = "buffer", keyword_length = 1, max_item_count = 6 },
|
||||||
{ name = "path", keyword_length = 1, max_item_count = 6 },
|
{ name = "path", keyword_length = 1, max_item_count = 6 },
|
||||||
|
},
|
||||||
|
mapping = {
|
||||||
|
['<C-n>'] = cmp.mapping(cmp.mapping.select_next_item(), {'i', 'c'}),
|
||||||
|
['<C-p>'] = cmp.mapping(cmp.mapping.select_prev_item(), {'i', 'c'}),
|
||||||
|
['<CR>'] = cmp.mapping.confirm({ select = true }), -- accept currently selected item
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
@ -40,6 +46,28 @@ return {
|
||||||
indent = { enable = true },
|
indent = { enable = true },
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
'stevearc/conform.nvim',
|
||||||
|
opts = {},
|
||||||
|
config = function()
|
||||||
|
require("conform").setup({
|
||||||
|
formatters_by_ft = {
|
||||||
|
-- lua = { "stylua" },
|
||||||
|
-- Conform will run multiple formatters sequentially
|
||||||
|
-- python = { "isort", "black" },
|
||||||
|
-- You can customize some of the format options for the filetype (:help conform.format)
|
||||||
|
-- rust = { "rustfmt", lsp_format = "fallback" },
|
||||||
|
-- Conform will run the first available formatter
|
||||||
|
javascript = { "prettierd" },
|
||||||
|
typescript = { "prettierd" },
|
||||||
|
css = { "prettierd" },
|
||||||
|
less = { "prettierd" },
|
||||||
|
html = { "prettierd" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue