finish config
This commit is contained in:
parent
1a971cbdcf
commit
c131687240
6 changed files with 159 additions and 22 deletions
15
lua/custom/plugins/autopairs.lua
Normal file
15
lua/custom/plugins/autopairs.lua
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
return {
|
||||
"windwp/nvim-autopairs",
|
||||
-- Optional dependency
|
||||
dependencies = { 'hrsh7th/nvim-cmp' },
|
||||
config = function()
|
||||
require("nvim-autopairs").setup {}
|
||||
-- If you want to automatically add `(` after selecting a function or method
|
||||
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
|
||||
local cmp = require('cmp')
|
||||
cmp.event:on(
|
||||
'confirm_done',
|
||||
cmp_autopairs.on_confirm_done()
|
||||
)
|
||||
end,
|
||||
}
|
||||
30
lua/custom/plugins/bufferline.lua
Normal file
30
lua/custom/plugins/bufferline.lua
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
return {
|
||||
'akinsho/bufferline.nvim',
|
||||
version = "*",
|
||||
dependencies = 'nvim-tree/nvim-web-devicons',
|
||||
config = function()
|
||||
local bufferline = require("bufferline")
|
||||
bufferline.setup {
|
||||
options = {
|
||||
style_preset = bufferline.style_preset.minimal,
|
||||
indicator = {
|
||||
style = 'underline',
|
||||
},
|
||||
offsets = {
|
||||
{
|
||||
filetype = "NvimTree",
|
||||
}
|
||||
},
|
||||
show_buffer_close_icons = false,
|
||||
show_close_icon = false,
|
||||
separator_style = "thin",
|
||||
diagnostics = "nvim_lsp",
|
||||
diagnostics_update_in_insert = false,
|
||||
-- The diagnostics indicator can be set to nil to keep the buffer name highlight but delete the highlighting
|
||||
diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
||||
return "(" .. count .. ")"
|
||||
end,
|
||||
}
|
||||
}
|
||||
end
|
||||
}
|
||||
52
lua/custom/plugins/filetree.lua
Normal file
52
lua/custom/plugins/filetree.lua
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
-- vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])
|
||||
-- return {
|
||||
-- "nvim-neo-tree/neo-tree.nvim",
|
||||
-- version = "*",
|
||||
-- dependencies = {
|
||||
-- "nvim-lua/plenary.nvim",
|
||||
-- "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
||||
-- "MunifTanjim/nui.nvim",
|
||||
-- },
|
||||
-- config = function ()
|
||||
-- require('neo-tree').setup {}
|
||||
-- end,
|
||||
-- }
|
||||
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
return {
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
version = "*",
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons"
|
||||
},
|
||||
config = function()
|
||||
require("nvim-tree").setup({
|
||||
view = {
|
||||
width = 36,
|
||||
},
|
||||
renderer = {
|
||||
group_empty = true,
|
||||
},
|
||||
-- filters = {
|
||||
-- dotfiles = true,
|
||||
-- },
|
||||
on_attach = function(bufnr)
|
||||
local api = require "nvim-tree.api"
|
||||
local function opts(desc)
|
||||
return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
|
||||
end
|
||||
api.config.mappings.default_on_attach(bufnr)
|
||||
vim.keymap.set('n', '?', api.tree.toggle_help, opts('Help'))
|
||||
vim.keymap.set('n', 'h', api.node.navigate.parent_close, opts('Close Parent'))
|
||||
vim.keymap.set('n', 'l', api.node.open.edit, opts('Open'))
|
||||
|
||||
vim.cmd [[highlight link NvimTreeWinSeparator EndOfBuffer]]
|
||||
end,
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>o", "<cmd>:NvimTreeFocus<cr>", desc = "Focus NvimTree" }
|
||||
},
|
||||
}
|
||||
10
lua/custom/plugins/mini.lua
Normal file
10
lua/custom/plugins/mini.lua
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
return {
|
||||
"echasnovski/mini.nvim",
|
||||
version = "*",
|
||||
config = function()
|
||||
local bufremove = require("mini.bufremove")
|
||||
bufremove.setup()
|
||||
local cursorword = require("mini.cursorword")
|
||||
cursorword.setup()
|
||||
end
|
||||
}
|
||||
13
lua/custom/plugins/session.lua
Normal file
13
lua/custom/plugins/session.lua
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
return {
|
||||
'rmagatti/auto-session',
|
||||
config = function()
|
||||
require("auto-session").setup {
|
||||
log_level = "error",
|
||||
post_restore_cmds = {
|
||||
function()
|
||||
require('nvim-tree.api').tree.toggle(false, true)
|
||||
end
|
||||
}
|
||||
}
|
||||
end
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue