update format

This commit is contained in:
long-crypto 2024-07-21 06:20:35 +00:00 committed by GitHub
parent 921753798e
commit d245916744
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 60 additions and 60 deletions

120
init.lua
View File

@ -282,7 +282,7 @@ require('lazy').setup({
-- config = function() -- This is the function that runs, AFTER loading -- config = function() -- This is the function that runs, AFTER loading
-- require('which-key').setup() -- require('which-key').setup()
-- Document existing key chains -- Document existing key chains
-- require('which-key').add { -- require('which-key').add {
-- { '<leader>c', group = '[C]ode' }, -- { '<leader>c', group = '[C]ode' },
-- { '<leader>d', group = '[D]ocument' }, -- { '<leader>d', group = '[D]ocument' },
@ -353,10 +353,10 @@ require('lazy').setup({
-- All the info you're looking for is in `:help telescope.setup()` -- All the info you're looking for is in `:help telescope.setup()`
-- --
defaults = { defaults = {
-- mappings = { -- mappings = {
-- i = { ['<c-enter>'] = 'to_fuzzy_refine' }, -- i = { ['<c-enter>'] = 'to_fuzzy_refine' },
-- }, -- },
history = false, history = false,
}, },
-- pickers = {} -- pickers = {}
extensions = { extensions = {
@ -412,30 +412,30 @@ require('lazy').setup({
'neovim/nvim-lspconfig', 'neovim/nvim-lspconfig',
dependencies = { dependencies = {
-- Automatically install LSPs and related tools to stdpath for Neovim -- Automatically install LSPs and related tools to stdpath for Neovim
{ {
"williamboman/mason.nvim", 'williamboman/mason.nvim',
opts = { opts = {
log_level = vim.log.levels.OFF, log_level = vim.log.levels.OFF,
pip = { pip = {
install_args = { "--no-cache-dir" }, install_args = { '--no-cache-dir' },
}, },
}, },
}, -- NOTE: Must be loaded before dependants }, -- NOTE: Must be loaded before dependants
'williamboman/mason-lspconfig.nvim', 'williamboman/mason-lspconfig.nvim',
'WhoIsSethDaniel/mason-tool-installer.nvim', 'WhoIsSethDaniel/mason-tool-installer.nvim',
-- Useful status updates for LSP. -- Useful status updates for LSP.
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
{ {
"j-hui/fidget.nvim", 'j-hui/fidget.nvim',
opts = { opts = {
logger = { logger = {
level = vim.log.levels.OFF, level = vim.log.levels.OFF,
path = "/dev/null", path = '/dev/null',
}, },
}, },
}, },
-- `neodev` configures Lua LSP for your Neovim config, runtime and plugins -- `neodev` configures Lua LSP for your Neovim config, runtime and plugins
-- used for completion, annotations and signatures of Neovim apis -- used for completion, annotations and signatures of Neovim apis
@ -471,7 +471,7 @@ require('lazy').setup({
-- That is to say, every time a new file is opened that is associated with -- That is to say, every time a new file is opened that is associated with
-- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this -- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this
-- function will be executed to configure the current buffer -- function will be executed to configure the current buffer
vim.lsp.set_log_level("off") vim.lsp.set_log_level 'off'
vim.api.nvim_create_autocmd('LspAttach', { vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }), group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }),
callback = function(event) callback = function(event)
@ -700,12 +700,12 @@ require('lazy').setup({
-- `friendly-snippets` contains a variety of premade snippets. -- `friendly-snippets` contains a variety of premade snippets.
-- See the README about individual language/framework/plugin snippets: -- See the README about individual language/framework/plugin snippets:
-- https://github.com/rafamadriz/friendly-snippets -- https://github.com/rafamadriz/friendly-snippets
{ {
'rafamadriz/friendly-snippets', 'rafamadriz/friendly-snippets',
config = function() config = function()
require('luasnip.loaders.from_vscode').lazy_load() require('luasnip.loaders.from_vscode').lazy_load()
end, end,
}, },
}, },
}, },
'saadparwaiz1/cmp_luasnip', 'saadparwaiz1/cmp_luasnip',
@ -882,29 +882,29 @@ require('lazy').setup({
end, end,
}, },
{ {
"akinsho/toggleterm.nvim", 'akinsho/toggleterm.nvim',
config = function() config = function()
require("toggleterm").setup({ require('toggleterm').setup {
size = 20, size = 20,
open_mapping = [[<c-\>]], open_mapping = [[<c-\>]],
direction = "float", direction = 'float',
float_opts = { float_opts = {
border = "curved", border = 'curved',
}, },
}) }
function _G.set_terminal_keymaps() function _G.set_terminal_keymaps()
local opts = { buffer = 0 } local opts = { buffer = 0 }
vim.keymap.set("t", "jk", [[<C-\><C-n>]], opts) vim.keymap.set('t', 'jk', [[<C-\><C-n>]], opts)
end end
-- if you only want these mappings for toggle term use term://*toggleterm#* instead -- if you only want these mappings for toggle term use term://*toggleterm#* instead
vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()") vim.cmd 'autocmd! TermOpen term://* lua set_terminal_keymaps()'
end, end,
keys = [[<c-\>]], keys = [[<c-\>]],
cmd = "ToggleTerm", cmd = 'ToggleTerm',
}, },
-- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the -- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the
-- init.lua. If you want these files, they are in the repository, so you can just download them and -- init.lua. If you want these files, they are in the repository, so you can just download them and
@ -916,10 +916,10 @@ require('lazy').setup({
-- Uncomment any of the lines below to enable them (you will need to restart nvim). -- Uncomment any of the lines below to enable them (you will need to restart nvim).
-- --
-- require 'kickstart.plugins.debug', -- require 'kickstart.plugins.debug',
require 'kickstart.plugins.indent_line', require 'kickstart.plugins.indent_line',
require 'kickstart.plugins.lint', require 'kickstart.plugins.lint',
require 'kickstart.plugins.autopairs', require 'kickstart.plugins.autopairs',
require 'kickstart.plugins.neo-tree', require 'kickstart.plugins.neo-tree',
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
@ -929,11 +929,11 @@ require('lazy').setup({
-- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins`
-- { import = 'custom.plugins' }, -- { import = 'custom.plugins' },
}, { }, {
performance = { performance = {
cache = { cache = {
enabled = false, enabled = false,
}, },
}, },
ui = { ui = {
-- If you are using a Nerd Font: set icons to an empty table which will use the -- If you are using a Nerd Font: set icons to an empty table which will use the
-- default lazy.nvim defined Nerd Font icons, otherwise define a unicode icons table -- default lazy.nvim defined Nerd Font icons, otherwise define a unicode icons table