Привёл nvim к достаточному состоянию
This commit is contained in:
parent
020ed86034
commit
4d3bb0270a
27 changed files with 279 additions and 148 deletions
9
nvim/lua/plugins/dap.lua
Normal file
9
nvim/lua/plugins/dap.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
require("dap-go").setup()
|
||||
require("dap").adapters.go = {
|
||||
type = "server",
|
||||
port = "${port}",
|
||||
executable = {
|
||||
command = "dlv",
|
||||
args = { "dap", "-l", "127.0.0.1:${port}" },
|
||||
},
|
||||
}
|
29
nvim/lua/plugins/format.lua
Normal file
29
nvim/lua/plugins/format.lua
Normal file
|
@ -0,0 +1,29 @@
|
|||
local conform = require("conform")
|
||||
|
||||
conform.setup({
|
||||
formatters_by_ft = {
|
||||
javascript = { "prettier" },
|
||||
typescript = { "prettier" },
|
||||
javascriptreact = { "prettier" },
|
||||
typescriptreact = { "prettier" },
|
||||
svelte = { "prettier" },
|
||||
css = { "prettier" },
|
||||
html = { "prettier" },
|
||||
json = { "prettier" },
|
||||
yaml = { "prettier" },
|
||||
markdown = { "prettier" },
|
||||
graphql = { "prettier" },
|
||||
lua = { "stylua" },
|
||||
python = { "isort", "black" },
|
||||
go = { "gofmt" },
|
||||
},
|
||||
format_on_save = {
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 500,
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set({ "n", "v" }, "<leader>mp", function()
|
||||
conform.format({ lsp_fallback = true, async = false, timeout_ms = 500 })
|
||||
end, { desc = "Format file or range (in visual mode)" })
|
|
@ -1,61 +1,100 @@
|
|||
return require('packer').startup{function(use)
|
||||
use 'wbthomason/packer.nvim'
|
||||
use 'nvim-lua/plenary.nvim'
|
||||
use 'neovim/nvim-lspconfig'
|
||||
use 'bluz71/vim-moonfly-colors'
|
||||
use {
|
||||
'hrsh7th/nvim-cmp',
|
||||
requires = {
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'hrsh7th/cmp-buffer',
|
||||
'hrsh7th/cmp-path',
|
||||
'hrsh7th/cmp-vsnip',
|
||||
'hrsh7th/vim-vsnip',
|
||||
},
|
||||
config = function()
|
||||
require 'plugins.cmp'
|
||||
return require("packer").startup({
|
||||
function(use)
|
||||
use("wbthomason/packer.nvim")
|
||||
use("nvim-lua/plenary.nvim")
|
||||
use("neovim/nvim-lspconfig")
|
||||
use("bluz71/vim-moonfly-colors")
|
||||
use("Snyssfx/goerr-nvim")
|
||||
use({
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
config = function()
|
||||
require("ibl").setup()
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"rcarriga/nvim-dap-ui",
|
||||
requires = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" },
|
||||
config = function()
|
||||
require("dapui").setup()
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"leoluz/nvim-dap-go",
|
||||
requires = { "mfussenegger/nvim-dap" },
|
||||
config = function()
|
||||
require("plugins.dap")
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"hrsh7th/nvim-cmp",
|
||||
requires = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-vsnip",
|
||||
"hrsh7th/vim-vsnip",
|
||||
},
|
||||
config = function()
|
||||
require("plugins.cmp")
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"nvim-lualine/lualine.nvim",
|
||||
config = function()
|
||||
require("plugins.lualine")
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
run = ":TSUpdate",
|
||||
config = function()
|
||||
require("plugins.treesitter")
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"nvim-telescope/telescope.nvim",
|
||||
config = function()
|
||||
require("plugins.telescope")
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
requires = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
config = function()
|
||||
require("plugins.tree")
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"stevearc/conform.nvim",
|
||||
config = function()
|
||||
require("plugins.format")
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"mfussenegger/nvim-dap",
|
||||
config = function()
|
||||
local dap = require("dap")
|
||||
-- Общие конфигурации для Go
|
||||
dap.configurations.go = {
|
||||
{
|
||||
type = "go",
|
||||
name = "Debug",
|
||||
request = "launch",
|
||||
program = "${file}",
|
||||
showLog = true,
|
||||
console = "integratedTerminal",
|
||||
},
|
||||
}
|
||||
end,
|
||||
})
|
||||
if packer_bootstrap then
|
||||
require("packer").sync()
|
||||
end
|
||||
}
|
||||
use {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
config = function()
|
||||
require 'plugins.lualine'
|
||||
end
|
||||
}
|
||||
use {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
run = ':TSUpdate',
|
||||
config = function()
|
||||
require 'plugins.treesitter'
|
||||
end
|
||||
}
|
||||
use {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
config = function()
|
||||
require 'plugins.telescope'
|
||||
end
|
||||
}
|
||||
use {
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
requires = {
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
},
|
||||
config = function()
|
||||
require 'plugins.tree'
|
||||
end
|
||||
}
|
||||
use {
|
||||
"stevearc/conform.nvim",
|
||||
config = function()
|
||||
require("conform").setup()
|
||||
end,
|
||||
}
|
||||
if packer_bootstrap then
|
||||
require('packer').sync()
|
||||
end
|
||||
end,
|
||||
config = {
|
||||
-- The root has to be a directory named "pack"
|
||||
package_root = vim.fn.stdpath('config') .. '/pack',
|
||||
}}
|
||||
|
||||
end,
|
||||
config = {
|
||||
-- The root has to be a directory named "pack"
|
||||
package_root = vim.fn.stdpath("data") .. "/site/pack",
|
||||
},
|
||||
})
|
||||
|
|
|
@ -3,5 +3,8 @@ require('telescope').setup{
|
|||
buffers = {
|
||||
initial_mode = 'normal'
|
||||
}
|
||||
},
|
||||
defaults = {
|
||||
file_ignore_patterns = {"vendor", "node_modules"}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,10 +5,23 @@ require("nvim-tree").setup({
|
|||
view = {
|
||||
width = 30,
|
||||
},
|
||||
git = {
|
||||
enable = true,
|
||||
},
|
||||
renderer = {
|
||||
group_empty = true,
|
||||
highlight_git = true,
|
||||
icons = {
|
||||
show = {
|
||||
git = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
filters = {
|
||||
dotfiles = true,
|
||||
dotfiles = false,
|
||||
},
|
||||
update_focused_file = {
|
||||
enable = true,
|
||||
update_root = false,
|
||||
},
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue