Use stylua
This commit is contained in:
parent
84bf31cb41
commit
a8b3645148
116
init.lua
116
init.lua
@ -65,7 +65,7 @@ local config = {
|
||||
-- Tlist_Close_On_Select = 1,
|
||||
|
||||
-- MarkdownPreview
|
||||
mkdp_auto_close = 0
|
||||
mkdp_auto_close = 0,
|
||||
},
|
||||
},
|
||||
-- If you need more control, you can use the function()...end notation
|
||||
@ -155,8 +155,10 @@ local config = {
|
||||
mappings = {
|
||||
-- first key is the mode
|
||||
n = {
|
||||
["<leader>fT"] = { function() require("telescope.builtin").colorscheme { enable_preview = true } end, desc =
|
||||
"Find themes" },
|
||||
["<leader>fT"] = {
|
||||
function() require("telescope.builtin").colorscheme { enable_preview = true } end,
|
||||
desc = "Find themes",
|
||||
},
|
||||
-- second key is the lefthand side of the map
|
||||
-- mappings seen under group name "Buffer"
|
||||
["<leader>bb"] = { "<cmd>tabnew<cr>", desc = "New tab" },
|
||||
@ -182,39 +184,21 @@ local config = {
|
||||
["<leader>d"] = { name = "Debugger" },
|
||||
["<leader>dl"] = { name = "Load launch.json" },
|
||||
-- Config loading
|
||||
["<leader>dlc"] = { function() require("dap.ext.vscode").load_launchjs(nil, { cppdbg = { "c", "cpp", "asm" } }) end, desc =
|
||||
"C/C++/asm" },
|
||||
["<leader>dln"] = { function() require("dap.ext.vscode").load_launchjs(nil, { node2 = { "javascript", "javascriptreact", "typescriptreact", "typescript" }}) end, desc =
|
||||
"Node" },
|
||||
["<leader>dlc"] = {
|
||||
function() require("dap.ext.vscode").load_launchjs(nil, { cppdbg = { "c", "cpp", "asm" } }) end,
|
||||
desc = "C/C++/asm",
|
||||
},
|
||||
["<leader>dln"] = {
|
||||
function()
|
||||
require("dap.ext.vscode").load_launchjs(
|
||||
nil,
|
||||
{ node2 = { "javascript", "javascriptreact", "typescriptreact", "typescript" } }
|
||||
)
|
||||
end,
|
||||
desc = "Node",
|
||||
},
|
||||
-- Load launch.json for all supported languages
|
||||
["<leader>dla"] = { function() require("dap.ext.vscode").load_launchjs(nil, nil) end, desc = "All" },
|
||||
-- Function keys mappings
|
||||
["<F5>"] = { function() require("dap").continue() end, desc = "Debugger: Start" },
|
||||
["<F17>"] = { function() require("dap").terminate() end, desc = "Debugger: Stop" }, -- Shift+F5
|
||||
["<F29>"] = { function() require("dap").restart_frame() end, desc = "Debugger: Restart" }, -- Control+F5
|
||||
["<F6>"] = { function() require("dap").pause() end, desc = "Debugger: Pause" },
|
||||
["<F9>"] = { function() require("dap").toggle_breakpoint() end, desc = "Debugger: Toggle Breakpoint" },
|
||||
["<F10>"] = { function() require("dap").step_over() end, desc = "Debugger: Step Over" },
|
||||
["<F11>"] = { function() require("dap").step_into() end, desc = "Debugger: Step Into" },
|
||||
["<F23>"] = { function() require("dap").step_out() end, desc = "Debugger: Step Out" }, -- Shift+F11
|
||||
-- Breakpoints
|
||||
["<leader>db"] = { function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint (F9)" },
|
||||
["<leader>dB"] = { function() require("dap").clear_breakpoints() end, desc = "Clear Breakpoints" },
|
||||
-- Session actions
|
||||
["<leader>dc"] = { function() require("dap").continue() end, desc = "Start/Continue (F5)" },
|
||||
["<leader>dp"] = { function() require("dap").pause() end, desc = "Pause (F6)" },
|
||||
["<leader>dr"] = { function() require("dap").restart_frame() end, desc = "Restart (C-F5)" },
|
||||
["<leader>dq"] = { function() require("dap").close() end, desc = "Close Session" },
|
||||
["<leader>dQ"] = { function() require("dap").terminate() end, desc = "Terminate Session (S-F5)" },
|
||||
-- Step
|
||||
["<leader>di"] = { function() require("dap").step_into() end, desc = "Step Into (F11)" },
|
||||
["<leader>do"] = { function() require("dap").step_over() end, desc = "Step Over (F10)" },
|
||||
["<leader>dO"] = { function() require("dap").step_out() end, desc = "Step Out (S-F11)" },
|
||||
-- Repls (debugger)
|
||||
["<leader>dR"] = { function() require("dap").repl.toggle() end, desc = "Toggle REPL" },
|
||||
-- Dap-UI
|
||||
["<leader>du"] = { function() require("dapui").toggle() end, desc = "Toggle Debugger UI" },
|
||||
["<leader>dh"] = { function() require("dap.ui.widgets").hover() end, desc = "Debugger Hover" },
|
||||
-- Mardown preview
|
||||
["<leader>m"] = { name = "Markdown" },
|
||||
["<leader>mp"] = { "<cmd>MarkdownPreview<cr>", desc = "Markdown preview" },
|
||||
@ -293,7 +277,7 @@ local config = {
|
||||
-- Theme
|
||||
{
|
||||
"folke/tokyonight.nvim",
|
||||
event = "UIEnter"
|
||||
event = "UIEnter",
|
||||
},
|
||||
-- You can disable default plugins as follows:
|
||||
-- { "max397574/better-escape.nvim", enabled = false },
|
||||
@ -353,7 +337,7 @@ local config = {
|
||||
-- },
|
||||
{
|
||||
"dstein64/vim-startuptime",
|
||||
cmd = "StartupTime"
|
||||
cmd = "StartupTime",
|
||||
},
|
||||
|
||||
{
|
||||
@ -367,10 +351,15 @@ local config = {
|
||||
local luasnip = require "luasnip"
|
||||
-- modify the mapping part of the table
|
||||
opts.mapping["<CR>"] = cmp.mapping.confirm { select = false }
|
||||
opts.mapping["<Tab>"] = cmp.mapping(function(fallback)
|
||||
vim.api.nvim_feedkeys(vim.fn['copilot#Accept'](vim.api.nvim_replace_termcodes('<Tab>', true, true, true)), 'n',
|
||||
true)
|
||||
end)
|
||||
opts.mapping["<Tab>"] = cmp.mapping(
|
||||
function(fallback)
|
||||
vim.api.nvim_feedkeys(
|
||||
vim.fn["copilot#Accept"](vim.api.nvim_replace_termcodes("<Tab>", true, true, true)),
|
||||
"n",
|
||||
true
|
||||
)
|
||||
end
|
||||
)
|
||||
if luasnip.expandable() then
|
||||
luasnip.expand()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
@ -378,7 +367,7 @@ local config = {
|
||||
fallback()
|
||||
end
|
||||
opts.experimental = {
|
||||
ghost_text = false -- this feature conflict with copilot.vim's preview.
|
||||
ghost_text = false, -- this feature conflict with copilot.vim's preview.
|
||||
}
|
||||
-- return the new table to be used
|
||||
return opts
|
||||
@ -388,7 +377,7 @@ local config = {
|
||||
-- Editorconfig
|
||||
{
|
||||
"editorconfig/editorconfig-vim",
|
||||
event = "User AstroFile"
|
||||
event = "User AstroFile",
|
||||
},
|
||||
|
||||
-- You can also add new plugins here as well:
|
||||
@ -397,13 +386,13 @@ local config = {
|
||||
-- Plugins for other plugins
|
||||
{
|
||||
"tyru/open-browser.vim",
|
||||
cmd = { "OPenBrowser", "OpenBrowserSearch", "OpenBrowserSmartSearch" }
|
||||
cmd = { "OPenBrowser", "OpenBrowserSearch", "OpenBrowserSmartSearch" },
|
||||
},
|
||||
|
||||
--Social
|
||||
{
|
||||
"andweeb/presence.nvim",
|
||||
event = "UIEnter"
|
||||
event = "UIEnter",
|
||||
},
|
||||
{
|
||||
"ellisonleao/carbon-now.nvim",
|
||||
@ -425,7 +414,7 @@ local config = {
|
||||
width = "680",
|
||||
watermark = false,
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
-- Comments
|
||||
@ -437,32 +426,32 @@ local config = {
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
-- cmd = { "TroubleToggle", "TodoTrouble" }
|
||||
cmd = "TroubleToggle"
|
||||
cmd = "TroubleToggle",
|
||||
},
|
||||
-- TOC (functions, macros, ...)
|
||||
{
|
||||
"yegappan/taglist",
|
||||
cmd = "TlistToggle"
|
||||
cmd = "TlistToggle",
|
||||
},
|
||||
|
||||
-- Code completion
|
||||
{
|
||||
"github/copilot.vim",
|
||||
event = "User AstroFile"
|
||||
event = "User AstroFile",
|
||||
},
|
||||
|
||||
-- PlatformIO
|
||||
{
|
||||
"normen/vim-pio",
|
||||
-- event = "BufEnter"
|
||||
cmd = { "PIO", "PIOInit", "PIOInstall", "PIOUninstall", "PIONewProject", "PIOAddLibrary", "PIORemoveLibrary" }
|
||||
cmd = { "PIO", "PIOInit", "PIOInstall", "PIOUninstall", "PIONewProject", "PIOAddLibrary", "PIORemoveLibrary" },
|
||||
},
|
||||
|
||||
-- Text related
|
||||
{
|
||||
-- LaTeX
|
||||
"lervag/vimtex",
|
||||
event = "BufEnter *.tex"
|
||||
event = "BufEnter *.tex",
|
||||
},
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
@ -477,27 +466,36 @@ local config = {
|
||||
},
|
||||
{
|
||||
"aklt/plantuml-syntax",
|
||||
event = "BufEnter *.uml"
|
||||
event = "BufEnter *.uml",
|
||||
},
|
||||
|
||||
-- Basic editor functionality
|
||||
{
|
||||
"Pocco81/auto-save.nvim",
|
||||
event = "User AstroFile",
|
||||
config = function()
|
||||
require("auto-save").setup()
|
||||
end,
|
||||
config = function() require("auto-save").setup() end,
|
||||
},
|
||||
|
||||
-- Tasks.json
|
||||
{
|
||||
"stevearc/overseer.nvim",
|
||||
cmd = { "OverseerOpen", "OverseerClose", "OverseerToggle", "OverseerSaveBundle", "OverseerLoadBundle",
|
||||
"OverseerDeleteBundle", "OverseerRunCmd", "OverseerRun", "OverseerInfo", "OverseerBuild", "OverseerQuickAction",
|
||||
"OverseerTaskAction ", "OverseerClearCache" },
|
||||
opts = {}
|
||||
cmd = {
|
||||
"OverseerOpen",
|
||||
"OverseerClose",
|
||||
"OverseerToggle",
|
||||
"OverseerSaveBundle",
|
||||
"OverseerLoadBundle",
|
||||
"OverseerDeleteBundle",
|
||||
"OverseerRunCmd",
|
||||
"OverseerRun",
|
||||
"OverseerInfo",
|
||||
"OverseerBuild",
|
||||
"OverseerQuickAction",
|
||||
"OverseerTaskAction ",
|
||||
"OverseerClearCache",
|
||||
},
|
||||
opts = {},
|
||||
},
|
||||
|
||||
|
||||
-- {
|
||||
-- "ray-x/lsp_signature.nvim",
|
||||
|
Loading…
x
Reference in New Issue
Block a user