Initial configuration
- LSP - Relative Numbers **Plugins** - Conform (Formatter) - GitHub Copilot
This commit is contained in:
parent
3824342d10
commit
a9739a6862
4 changed files with 72 additions and 2 deletions
31
lua/custom/plugins/conform.lua
Normal file
31
lua/custom/plugins/conform.lua
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
-- **conform.nvim**
|
||||
-- This nvim plugin allows to format any buffer with a single command.
|
||||
-- Plugin page: https://github.com/stevearc/conform.nvim
|
||||
return {
|
||||
{
|
||||
'stevearc/conform.nvim',
|
||||
event = { "BufWritePre" },
|
||||
cmd = { "ConformInfo" },
|
||||
keys = {
|
||||
{
|
||||
-- Customize or remove this keymap to your liking
|
||||
"<leader>f",
|
||||
function()
|
||||
require("conform").format({ async = true, lsp_fallback = true })
|
||||
end,
|
||||
mode = "",
|
||||
desc = "Format buffer",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
-- Define your formatters
|
||||
formatters_by_ft = {
|
||||
javascript = { { "prettier" } },
|
||||
typescript = { { "prettier" } },
|
||||
html = { { "prettier" } },
|
||||
css = { { "prettier" } },
|
||||
sql = { { "sql_formatter" } },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
7
lua/custom/plugins/copilot.lua
Normal file
7
lua/custom/plugins/copilot.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
'github/copilot.vim',
|
||||
config = function()
|
||||
vim.g.copilot_no_tab_map = true
|
||||
vim.api.nvim_set_keymap("i", "<C-J>", 'copilot#Accept("<CR>")', { silent = true, expr = true })
|
||||
end
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue