mirror of
https://github.com/Baipyrus/nvim-config.git
synced 2024-12-25 04:41:46 +00:00
clean up: formatted kickstart plugins
This commit is contained in:
parent
7a8ca584c8
commit
4c01ef51f0
@ -1,13 +1,9 @@
|
|||||||
-- autoformat.lua
|
-- Uses installed LSP servers to automatically format code on save.
|
||||||
--
|
|
||||||
-- Use your language server to automatically format your code on save.
|
|
||||||
-- Adds additional commands as well to manage the behavior
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'neovim/nvim-lspconfig',
|
'neovim/nvim-lspconfig',
|
||||||
config = function()
|
config = function()
|
||||||
-- Switch for controlling whether you want autoformatting.
|
-- Switch for controlling whether you want autoformatting.
|
||||||
-- Use :KickstartFormatToggle to toggle autoformatting on or off
|
|
||||||
local format_is_enabled = true
|
local format_is_enabled = true
|
||||||
vim.api.nvim_create_user_command('KickstartFormatToggle', function()
|
vim.api.nvim_create_user_command('KickstartFormatToggle', function()
|
||||||
format_is_enabled = not format_is_enabled
|
format_is_enabled = not format_is_enabled
|
||||||
@ -15,8 +11,6 @@ return {
|
|||||||
end, {})
|
end, {})
|
||||||
|
|
||||||
-- Create an augroup that is used for managing our formatting autocmds.
|
-- Create an augroup that is used for managing our formatting autocmds.
|
||||||
-- We need one augroup per client to make sure that multiple clients
|
|
||||||
-- can attach to the same buffer without interfering with each other.
|
|
||||||
local _augroups = {}
|
local _augroups = {}
|
||||||
local get_augroup = function(client)
|
local get_augroup = function(client)
|
||||||
if not _augroups[client.id] then
|
if not _augroups[client.id] then
|
||||||
@ -29,8 +23,6 @@ return {
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Whenever an LSP attaches to a buffer, we will run this function.
|
-- Whenever an LSP attaches to a buffer, we will run this function.
|
||||||
--
|
|
||||||
-- See `:help LspAttach` for more information about this autocmd event.
|
|
||||||
vim.api.nvim_create_autocmd('LspAttach', {
|
vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
group = vim.api.nvim_create_augroup('kickstart-lsp-attach-format', { clear = true }),
|
group = vim.api.nvim_create_augroup('kickstart-lsp-attach-format', { clear = true }),
|
||||||
-- This is where we attach the autoformatting for reasonable clients
|
-- This is where we attach the autoformatting for reasonable clients
|
||||||
@ -44,14 +36,8 @@ return {
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Tsserver usually works poorly. Sorry you work with bad languages
|
|
||||||
-- You can remove this line if you know what you're doing :)
|
|
||||||
if client.name == 'tsserver' then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Create an autocmd that will run *before* we save the buffer.
|
-- Create an autocmd that will run *before* we save the buffer.
|
||||||
-- Run the formatting command for the LSP that has just attached.
|
-- Runhe formatting command for the LSP that has just attached.
|
||||||
vim.api.nvim_create_autocmd('BufWritePre', {
|
vim.api.nvim_create_autocmd('BufWritePre', {
|
||||||
group = get_augroup(client),
|
group = get_augroup(client),
|
||||||
buffer = bufnr,
|
buffer = bufnr,
|
||||||
|
@ -1,15 +1,5 @@
|
|||||||
-- debug.lua
|
|
||||||
--
|
|
||||||
-- Shows how to use the DAP plugin to debug your code.
|
|
||||||
--
|
|
||||||
-- Primarily focused on configuring the debugger for Go, but can
|
|
||||||
-- be extended to other languages as well. That's why it's called
|
|
||||||
-- kickstart.nvim and not kitchen-sink.nvim ;)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
-- NOTE: Yes, you can install new plugins here!
|
|
||||||
'mfussenegger/nvim-dap',
|
'mfussenegger/nvim-dap',
|
||||||
-- NOTE: And you can specify dependencies as well
|
|
||||||
dependencies = {
|
dependencies = {
|
||||||
-- Creates a beautiful debugger UI
|
-- Creates a beautiful debugger UI
|
||||||
'rcarriga/nvim-dap-ui',
|
'rcarriga/nvim-dap-ui',
|
||||||
@ -18,7 +8,7 @@ return {
|
|||||||
'williamboman/mason.nvim',
|
'williamboman/mason.nvim',
|
||||||
'jay-babu/mason-nvim-dap.nvim',
|
'jay-babu/mason-nvim-dap.nvim',
|
||||||
|
|
||||||
-- Add your own debuggers here
|
-- Debugger dependencies
|
||||||
'leoluz/nvim-dap-go',
|
'leoluz/nvim-dap-go',
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
@ -26,18 +16,10 @@ return {
|
|||||||
local dapui = require 'dapui'
|
local dapui = require 'dapui'
|
||||||
|
|
||||||
require('mason-nvim-dap').setup {
|
require('mason-nvim-dap').setup {
|
||||||
-- Makes a best effort to setup the various debuggers with
|
|
||||||
-- reasonable debug configurations
|
|
||||||
automatic_setup = true,
|
automatic_setup = true,
|
||||||
|
|
||||||
-- You can provide additional configuration to the handlers,
|
|
||||||
-- see mason-nvim-dap README for more information
|
|
||||||
handlers = {},
|
handlers = {},
|
||||||
|
-- Installed language debuggers
|
||||||
-- You'll need to check that you have the required things installed
|
|
||||||
-- online, please don't ask me how to install them :)
|
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
-- Update this to ensure that you have the debuggers for the langs you want
|
|
||||||
'delve',
|
'delve',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -53,11 +35,8 @@ return {
|
|||||||
end, { desc = 'Debug: Set Breakpoint' })
|
end, { desc = 'Debug: Set Breakpoint' })
|
||||||
|
|
||||||
-- Dap UI setup
|
-- Dap UI setup
|
||||||
-- For more information, see |:help nvim-dap-ui|
|
|
||||||
dapui.setup {
|
dapui.setup {
|
||||||
-- Set icons to characters that are more likely to work in every terminal.
|
-- Set icons to characters that are more likely to work in every terminal.
|
||||||
-- Feel free to remove or use ones that you like more! :)
|
|
||||||
-- Don't feel like these are good choices.
|
|
||||||
icons = { expanded = '▾', collapsed = '▸', current_frame = '*' },
|
icons = { expanded = '▾', collapsed = '▸', current_frame = '*' },
|
||||||
controls = {
|
controls = {
|
||||||
icons = {
|
icons = {
|
||||||
|
Loading…
Reference in New Issue
Block a user