feat: update nvim
This commit is contained in:
parent
6a285955c8
commit
d4f2d27b3f
32 changed files with 2682 additions and 0 deletions
64
nvim/lua/configs/bufferline.lua
Normal file
64
nvim/lua/configs/bufferline.lua
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
local bufferline = require('bufferline')
|
||||
bufferline.setup {
|
||||
options = {
|
||||
mode = "buffers", -- set to "tabs" to only show tabpages instead
|
||||
style_preset = bufferline.style_preset.default,
|
||||
themable = true,
|
||||
indicator = {
|
||||
icon = '▎',
|
||||
style = 'icon',
|
||||
},
|
||||
buffer_close_icon = '',
|
||||
modified_icon = '● ',
|
||||
close_icon = ' ',
|
||||
left_trunc_marker = ' ',
|
||||
right_trunc_marker = ' ',
|
||||
max_name_length = 18,
|
||||
max_prefix_length = 15,
|
||||
truncate_names = true,
|
||||
tab_size = 18,
|
||||
custom_filter = function(buf_number, buf_numbers)
|
||||
if vim.bo[buf_number].filetype ~= "<i-dont-want-to-see-this>" then
|
||||
return true
|
||||
end
|
||||
if vim.fn.bufname(buf_number) ~= "<buffer-name-I-dont-want>" then
|
||||
return true
|
||||
end
|
||||
if vim.fn.getcwd() == "<work-repo>" and vim.bo[buf_number].filetype ~= "wiki" then
|
||||
return true
|
||||
end
|
||||
if buf_numbers[1] ~= buf_number then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
offsets = {
|
||||
{
|
||||
filetype = "NvimTree",
|
||||
text = "File Explorer",
|
||||
text_align = "left",
|
||||
separator = true
|
||||
}
|
||||
},
|
||||
color_icons = true,
|
||||
get_element_icon = function(element)
|
||||
local icon, hl = require('nvim-web-devicons').get_icon_by_filetype(element.filetype, { default = false })
|
||||
return icon, hl
|
||||
end,
|
||||
show_buffer_icons = true,
|
||||
show_buffer_close_icons = true,
|
||||
show_close_icon = true,
|
||||
show_tab_indicators = true,
|
||||
separator_style = "slant",
|
||||
enforce_regular_tabs = false,
|
||||
always_show_bufferline = true,
|
||||
auto_toggle_bufferline = true,
|
||||
hover = {
|
||||
enabled = true,
|
||||
delay = 200,
|
||||
reveal = {'close'}
|
||||
},
|
||||
pick = {
|
||||
alphabet = "abcdefghijklmopqrstuvwxyzABCDEFGHIJKLMOPQRSTUVWXYZ1234567890",
|
||||
},
|
||||
}
|
||||
}
|
||||
55
nvim/lua/configs/cmp.lua
Normal file
55
nvim/lua/configs/cmp.lua
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
local cmp = require "cmp"
|
||||
|
||||
local options = {
|
||||
completion = { completeopt = "menu,menuone" },
|
||||
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
|
||||
mapping = {
|
||||
["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||
["<C-n>"] = cmp.mapping.select_next_item(),
|
||||
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.close(),
|
||||
|
||||
["<CR>"] = cmp.mapping.confirm {
|
||||
behavior = cmp.ConfirmBehavior.Insert,
|
||||
select = true,
|
||||
},
|
||||
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif require("luasnip").expand_or_jumpable() then
|
||||
require("luasnip").expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif require("luasnip").jumpable(-1) then
|
||||
require("luasnip").jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
},
|
||||
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "buffer" },
|
||||
{ name = "nvim_lua" },
|
||||
{ name = "async_path" },
|
||||
},
|
||||
}
|
||||
|
||||
return vim.tbl_deep_extend("force", options, {})
|
||||
14
nvim/lua/configs/conform.lua
Normal file
14
nvim/lua/configs/conform.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
require('conform').setup({
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
cpp = { "clang-format" },
|
||||
go = { "gofmr" },
|
||||
},
|
||||
|
||||
format_on_save = {
|
||||
-- These options will be passed to conform.format()
|
||||
timeout_ms = 500,
|
||||
lsp_fallback = true,
|
||||
},
|
||||
notify_on_error = true,
|
||||
})
|
||||
53
nvim/lua/configs/gitsigns.lua
Normal file
53
nvim/lua/configs/gitsigns.lua
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
return {
|
||||
signs = {
|
||||
add = { text = "▎" },
|
||||
change = { text = "▎" },
|
||||
delete = { text = "" },
|
||||
topdelete = { text = "" },
|
||||
changedelete = { text = "▎" },
|
||||
untracked = { text = "▎" },
|
||||
},
|
||||
signs_staged = {
|
||||
add = { text = "▎" },
|
||||
change = { text = "▎" },
|
||||
delete = { text = "" },
|
||||
topdelete = { text = "" },
|
||||
changedelete = { text = "▎" },
|
||||
},
|
||||
on_attach = function(buffer)
|
||||
local gs = package.loaded.gitsigns
|
||||
|
||||
local function map(mode, l, r, desc)
|
||||
vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc, silent = true })
|
||||
end
|
||||
|
||||
-- stylua: ignore start
|
||||
map("n", "]h", function()
|
||||
if vim.wo.diff then
|
||||
vim.cmd.normal({ "]c", bang = true })
|
||||
else
|
||||
gs.nav_hunk("next")
|
||||
end
|
||||
end, "Next Hunk")
|
||||
map("n", "[h", function()
|
||||
if vim.wo.diff then
|
||||
vim.cmd.normal({ "[c", bang = true })
|
||||
else
|
||||
gs.nav_hunk("prev")
|
||||
end
|
||||
end, "Prev Hunk")
|
||||
map("n", "]H", function() gs.nav_hunk("last") end, "Last Hunk")
|
||||
map("n", "[H", function() gs.nav_hunk("first") end, "First Hunk")
|
||||
map({ "n", "x" }, "<leader>ghs", ":Gitsigns stage_hunk<CR>", "Stage Hunk")
|
||||
map({ "n", "x" }, "<leader>ghr", ":Gitsigns reset_hunk<CR>", "Reset Hunk")
|
||||
map("n", "<leader>ghS", gs.stage_buffer, "Stage Buffer")
|
||||
map("n", "<leader>ghu", gs.undo_stage_hunk, "Undo Stage Hunk")
|
||||
map("n", "<leader>ghR", gs.reset_buffer, "Reset Buffer")
|
||||
map("n", "<leader>ghp", gs.preview_hunk_inline, "Preview Hunk Inline")
|
||||
map("n", "<leader>ghb", function() gs.blame_line({ full = true }) end, "Blame Line")
|
||||
map("n", "<leader>ghB", function() gs.blame() end, "Blame Buffer")
|
||||
map("n", "<leader>ghd", gs.diffthis, "Diff This")
|
||||
map("n", "<leader>ghD", function() gs.diffthis("~") end, "Diff This ~")
|
||||
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>", "GitSigns Select Hunk")
|
||||
end,
|
||||
}
|
||||
26
nvim/lua/configs/lazy.lua
Normal file
26
nvim/lua/configs/lazy.lua
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = "\\"
|
||||
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
{ import = "plugins" },
|
||||
},
|
||||
install = { colorscheme = { "habamax" } },
|
||||
checker = { enabled = true },
|
||||
})
|
||||
55
nvim/lua/configs/lsp/e-lspconfig.lua
Normal file
55
nvim/lua/configs/lsp/e-lspconfig.lua
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
local M = {}
|
||||
local map = vim.keymap.set
|
||||
|
||||
-- export on_attach & capabilities
|
||||
M.on_attach = function(_, bufnr)
|
||||
local function opts(desc)
|
||||
return { buffer = bufnr, desc = "LSP " .. desc }
|
||||
end
|
||||
|
||||
map("n", "gD", vim.lsp.buf.declaration, opts "Go to declaration")
|
||||
map("n", "gd", vim.lsp.buf.definition, opts "Go to definition")
|
||||
map("n", "<leader>wa", vim.lsp.buf.add_workspace_folder, opts "Add workspace folder")
|
||||
map("n", "<leader>wr", vim.lsp.buf.remove_workspace_folder, opts "Remove workspace folder")
|
||||
|
||||
map("n", "<leader>wl", function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, opts "List workspace folders")
|
||||
|
||||
map("n", "<leader>D", vim.lsp.buf.type_definition, opts "Go to type definition")
|
||||
end
|
||||
|
||||
-- disable semanticTokens
|
||||
M.on_init = function(client, _)
|
||||
if vim.fn.has "nvim-0.11" ~= 1 then
|
||||
if client.supports_method "textDocument/semanticTokens" then
|
||||
client.server_capabilities.semanticTokensProvider = nil
|
||||
end
|
||||
else
|
||||
if client:supports_method "textDocument/semanticTokens" then
|
||||
client.server_capabilities.semanticTokensProvider = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
M.capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
|
||||
M.capabilities.textDocument.completion.completionItem = {
|
||||
documentationFormat = { "markdown", "plaintext" },
|
||||
snippetSupport = true,
|
||||
preselectSupport = true,
|
||||
insertReplaceSupport = true,
|
||||
labelDetailsSupport = true,
|
||||
deprecatedSupport = true,
|
||||
commitCharactersSupport = true,
|
||||
tagSupport = { valueSet = { 1 } },
|
||||
resolveSupport = {
|
||||
properties = {
|
||||
"documentation",
|
||||
"detail",
|
||||
"additionalTextEdits",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
111
nvim/lua/configs/lsp/lspconfig.lua
Normal file
111
nvim/lua/configs/lsp/lspconfig.lua
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
local on_attach = require("configs.lsp.e-lspconfig").on_attach
|
||||
local on_init = require("configs.lsp.e-lspconfig").on_init
|
||||
local capabilities = require("configs.lsp.e-lspconfig").capabilities
|
||||
|
||||
-- C/C++
|
||||
vim.lsp.config('clangd', {
|
||||
on_attach = on_attach,
|
||||
on_init = on_init,
|
||||
capabilities = capabilities,
|
||||
cmd = {
|
||||
"clangd-22",
|
||||
"--clang-tidy",
|
||||
},
|
||||
filetypes = { "c", "cpp", "h", "hpp", "objc", "objcpp" },
|
||||
root_markers = { '.git' },
|
||||
})
|
||||
vim.lsp.enable('clangd')
|
||||
|
||||
-- Go (gopls) lsp server
|
||||
vim.lsp.config('gopls', {
|
||||
on_attach = on_attach,
|
||||
on_init = on_init,
|
||||
capabilities = capabilities,
|
||||
cmd = { 'gopls' },
|
||||
filetypes = { 'go', 'gomod', 'gowork', 'gotmpl' },
|
||||
root_markers = { 'go.mod', '.git' },
|
||||
single_file_support = true,
|
||||
settings = {
|
||||
gopls = {
|
||||
completeUnimported = true,
|
||||
usePlaceholders = true,
|
||||
analyses = {
|
||||
unusedparams = true,
|
||||
},
|
||||
staticcheck = true,
|
||||
gofumpt = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.lsp.enable('gopls')
|
||||
|
||||
-- PhP
|
||||
vim.lsp.config('phpactor', {
|
||||
on_attach = on_attach,
|
||||
on_init = on_init,
|
||||
capabilities = capabilities,
|
||||
cmd = { 'phpactor', 'language-server' },
|
||||
filetypes = { 'php' },
|
||||
root_markers = { 'composer.json', '.git' },
|
||||
init_options = {
|
||||
["language_server_phpstan.enabled"] = false,
|
||||
["language_server_psalm.enabled"] = false,
|
||||
}
|
||||
})
|
||||
vim.lsp.enable('phpactor')
|
||||
|
||||
-- Lua
|
||||
vim.lsp.config('lua_ls', {
|
||||
on_attach = on_attach,
|
||||
on_init = on_init,
|
||||
capabilities = capabilities,
|
||||
cmd = { 'lua-language-server' },
|
||||
filetypes = { 'lua' },
|
||||
root_markers = { '.luarc.json', '.luarc.jsonc', '.git' },
|
||||
single_file_support = true,
|
||||
settings = {
|
||||
Lua = {
|
||||
telemetry = { enable = false },
|
||||
runtime = { version = 'LuaJIT' },
|
||||
diagnostics = { globals = { 'vim' } },
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
library = {
|
||||
vim.env.VIMRUNTIME,
|
||||
vim.fn.stdpath('config'),
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
vim.lsp.enable('lua_ls')
|
||||
|
||||
-- Bash
|
||||
vim.lsp.config('bashls', {
|
||||
on_attach = on_attach,
|
||||
on_init = on_init,
|
||||
capabilities = capabilities,
|
||||
cmd = { 'bash-language-server', 'start' },
|
||||
filetypes = { 'sh', 'bash' },
|
||||
root_markers = { '.git' },
|
||||
single_file_support = true,
|
||||
})
|
||||
vim.lsp.enable('bashls')
|
||||
|
||||
-- Meson
|
||||
vim.lsp.config('meson_ls', {
|
||||
on_attach = on_attach,
|
||||
on_init = on_init,
|
||||
capabilities = capabilities,
|
||||
cmd = { 'mesonlsp' },
|
||||
filetypes = { 'meson' },
|
||||
root_markers = { 'meson.build', '.git' },
|
||||
single_file_support = true,
|
||||
settings = {}
|
||||
})
|
||||
vim.lsp.enable('meson_ls')
|
||||
|
||||
-- For all
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false,
|
||||
})
|
||||
54
nvim/lua/configs/lualine.lua
Normal file
54
nvim/lua/configs/lualine.lua
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
require('lualine').setup {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'auto',
|
||||
component_separators = { left = '', right = '' },
|
||||
section_separators = { left = '', right = '' },
|
||||
disabled_filetypes = {
|
||||
statusline = {},
|
||||
winbar = {},
|
||||
},
|
||||
ignore_focus = {},
|
||||
always_divide_middle = true,
|
||||
always_show_tabline = true,
|
||||
globalstatus = false,
|
||||
refresh = {
|
||||
statusline = 1000,
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
refresh_time = 16, -- ~60fps
|
||||
events = {
|
||||
'WinEnter',
|
||||
'BufEnter',
|
||||
'BufWritePost',
|
||||
'SessionLoadPost',
|
||||
'FileChangedShellPost',
|
||||
'VimResized',
|
||||
'Filetype',
|
||||
'CursorMoved',
|
||||
'CursorMovedI',
|
||||
'ModeChanged',
|
||||
},
|
||||
}
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { 'mode' },
|
||||
lualine_b = { 'branch', 'diff', 'diagnostics' },
|
||||
lualine_c = { 'filename' },
|
||||
lualine_x = { 'fileformat', 'filetype' },
|
||||
lualine_y = { 'lsp_status' },
|
||||
lualine_z = { 'location' }
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { 'filename' },
|
||||
lualine_x = { 'location' },
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {},
|
||||
inactive_winbar = {},
|
||||
extensions = {}
|
||||
}
|
||||
11
nvim/lua/configs/luasnip.lua
Normal file
11
nvim/lua/configs/luasnip.lua
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
-- vscode format
|
||||
require("luasnip.loaders.from_vscode").lazy_load { exclude = vim.g.vscode_snippets_exclude or {} }
|
||||
require("luasnip.loaders.from_vscode").lazy_load { paths = vim.g.vscode_snippets_path or "" }
|
||||
|
||||
-- snipmate format
|
||||
require("luasnip.loaders.from_snipmate").load()
|
||||
require("luasnip.loaders.from_snipmate").lazy_load { paths = vim.g.snipmate_snippets_path or "" }
|
||||
|
||||
-- lua format
|
||||
require("luasnip.loaders.from_lua").load()
|
||||
require("luasnip.loaders.from_lua").lazy_load { paths = vim.g.lua_snippets_path or "" }
|
||||
94
nvim/lua/configs/nvim-dap.lua
Normal file
94
nvim/lua/configs/nvim-dap.lua
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
local M = {}
|
||||
|
||||
function M.setup()
|
||||
local dap = require("dap")
|
||||
local dapui = require("dapui")
|
||||
|
||||
-- Настройка адаптера codelldb для C/C++
|
||||
dap.adapters.codelldb = {
|
||||
type = 'server',
|
||||
port = '${port}',
|
||||
executable = {
|
||||
command = vim.fn.stdpath("data") .. '/mason/bin/codelldb',
|
||||
args = { '--port', '${port}' },
|
||||
env = {
|
||||
ASAN_OPTIONS = "ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
-- Конфигурации для C/C++
|
||||
dap.configurations.cpp = {
|
||||
{
|
||||
name = "Launch file",
|
||||
type = "codelldb",
|
||||
request = "launch",
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||
end,
|
||||
cwd = '${workspaceFolder}',
|
||||
stopOnEntry = false,
|
||||
args = {},
|
||||
},
|
||||
}
|
||||
|
||||
-- Используем те же конфигурации для C
|
||||
dap.configurations.c = dap.configurations.cpp
|
||||
|
||||
-- Настройка dap-ui :cite[1]:cite[4]
|
||||
dapui.setup({
|
||||
layouts = {
|
||||
{
|
||||
elements = {
|
||||
{ id = "scopes", size = 0.33 },
|
||||
{ id = "stacks", size = 0.25 },
|
||||
{ id = "watches", size = 0.25 },
|
||||
},
|
||||
size = 0.33,
|
||||
position = "right",
|
||||
},
|
||||
{
|
||||
elements = {
|
||||
{ id = "console", size = 0.55 },
|
||||
},
|
||||
size = 0.67,
|
||||
position = "bottom",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Автоматическое открытие/закрытие UI :cite[1]:cite[9]
|
||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||
dapui.open({})
|
||||
end
|
||||
|
||||
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||
dapui.close({})
|
||||
end
|
||||
|
||||
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||
dapui.close({})
|
||||
end
|
||||
|
||||
-- Цвета на задний фон для debug
|
||||
vim.api.nvim_set_hl(0, 'DapBreakpoint', { fg = '#993939', bg = '#31353f' })
|
||||
vim.api.nvim_set_hl(0, 'DapLogPoint', { fg = '#61afef', bg = '#31353f' })
|
||||
vim.api.nvim_set_hl(0, 'DapStopped', { fg = '#98c379', bg = '#31353f' })
|
||||
-- Настройка значков для точек останова :cite[1]:cite[10]
|
||||
vim.fn.sign_define('DapBreakpoint', {
|
||||
text = '',
|
||||
texthl = 'DapBreakpoint',
|
||||
linehl = 'DapBreakpoint',
|
||||
numhl =
|
||||
'DapBreakpoint'
|
||||
})
|
||||
vim.fn.sign_define('DapBreakpointCondition',
|
||||
{ text = 'ﳁ', texthl = 'DapBreakpoint', linehl = 'DapBreakpoint', numhl = 'DapBreakpoint' })
|
||||
vim.fn.sign_define('DapBreakpointRejected',
|
||||
{ text = '', texthl = 'DapBreakpoint', linehl = 'DapBreakpoint', numhl = 'DapBreakpoint' })
|
||||
vim.fn.sign_define('DapLogPoint', { text = '', texthl = 'DapLogPoint', linehl = 'DapLogPoint', numhl = 'DapLogPoint' })
|
||||
vim.fn.sign_define('DapStopped', { text = '', texthl = 'DapStopped', linehl = 'DapStopped', numhl = 'DapStopped' })
|
||||
vim.fn.sign_define("DapBreakpointRejected", { text = "❌", texthl = "LspDiagnosticsSignHint" })
|
||||
end
|
||||
|
||||
return M
|
||||
105
nvim/lua/configs/nvimtree.lua
Normal file
105
nvim/lua/configs/nvimtree.lua
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
-- return {
|
||||
-- filters = { dotfiles = false, git_ignored = false, },
|
||||
-- disable_netrw = true,
|
||||
-- hijack_cursor = true,
|
||||
-- sync_root_with_cwd = true,
|
||||
-- update_focused_file = {
|
||||
-- enable = true,
|
||||
-- update_root = false,
|
||||
-- },
|
||||
-- bookmarks = {
|
||||
-- persist = true,
|
||||
-- },
|
||||
-- view = {
|
||||
-- width = 30,
|
||||
-- preserve_window_proportions = true,
|
||||
-- },
|
||||
-- renderer = {
|
||||
-- root_folder_label = false,
|
||||
-- highlight_git = true,
|
||||
-- indent_markers = { enable = true },
|
||||
-- icons = {
|
||||
-- glyphs = {
|
||||
-- default = "",
|
||||
-- folder = {
|
||||
-- default = "",
|
||||
-- empty = "",
|
||||
-- empty_open = "",
|
||||
-- open = "",
|
||||
-- symlink = "",
|
||||
-- },
|
||||
-- git = { unmerged = "" },
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- }
|
||||
return {
|
||||
filters = {
|
||||
dotfiles = false,
|
||||
git_ignored = false,
|
||||
},
|
||||
|
||||
disable_netrw = true,
|
||||
hijack_cursor = true,
|
||||
sync_root_with_cwd = true,
|
||||
|
||||
update_focused_file = {
|
||||
enable = true,
|
||||
update_root = false,
|
||||
},
|
||||
|
||||
bookmarks = {
|
||||
persist = true,
|
||||
},
|
||||
|
||||
git = {
|
||||
enable = true,
|
||||
ignore = false,
|
||||
timeout = 5000,
|
||||
},
|
||||
|
||||
|
||||
view = {
|
||||
width = 30,
|
||||
preserve_window_proportions = true,
|
||||
},
|
||||
|
||||
renderer = {
|
||||
root_folder_label = false,
|
||||
highlight_git = "all",
|
||||
|
||||
indent_markers = {
|
||||
enable = true,
|
||||
},
|
||||
|
||||
icons = {
|
||||
show = {
|
||||
git = true,
|
||||
modified = false,
|
||||
file = true,
|
||||
folder = true,
|
||||
folder_arrow = true,
|
||||
},
|
||||
|
||||
glyphs = {
|
||||
default = "",
|
||||
folder = {
|
||||
default = "",
|
||||
empty = "",
|
||||
empty_open = "",
|
||||
open = "",
|
||||
symlink = "",
|
||||
},
|
||||
git = {
|
||||
unstaged = "✗",
|
||||
staged = "✓",
|
||||
unmerged = "",
|
||||
renamed = "➜",
|
||||
untracked = "★",
|
||||
deleted = "",
|
||||
ignored = "◌",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
22
nvim/lua/configs/telescope.lua
Normal file
22
nvim/lua/configs/telescope.lua
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
require("telescope").setup(){
|
||||
defaults = {
|
||||
prompt_prefix = " ",
|
||||
selection_caret = " ",
|
||||
entry_prefix = " ",
|
||||
sorting_strategy = "ascending",
|
||||
layout_config = {
|
||||
horizontal = {
|
||||
prompt_position = "top",
|
||||
preview_width = 0.55,
|
||||
},
|
||||
width = 0.87,
|
||||
height = 0.80,
|
||||
},
|
||||
mappings = {
|
||||
n = { ["q"] = require("telescope.actions").close },
|
||||
},
|
||||
},
|
||||
|
||||
extensions_list = { "themes", "terms", "noice", "persisted" },
|
||||
extensions = { "noice", "persisted" },
|
||||
}
|
||||
1
nvim/lua/configs/treesitter.lua
Normal file
1
nvim/lua/configs/treesitter.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
return {}
|
||||
21
nvim/lua/configs/ufo.lua
Normal file
21
nvim/lua/configs/ufo.lua
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
vim.o.foldcolumn = '1' -- '0' is not bad
|
||||
vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
|
||||
vim.o.foldlevelstart = 99
|
||||
vim.o.foldenable = true
|
||||
|
||||
-- Using ufo provider need remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself
|
||||
vim.keymap.set('n', 'zR', require('ufo').openAllFolds)
|
||||
vim.keymap.set('n', 'zM', require('ufo').closeAllFolds)
|
||||
vim.keymap.set('n', 'zK', function()
|
||||
local winid = require('ufo').peekFoldedLinesUnderCursor()
|
||||
if not winid then
|
||||
vim.lsp.buf.hover()
|
||||
end
|
||||
end, {desc = "Peek Fold"})
|
||||
|
||||
require("ufo").setup({
|
||||
provider_selector = function(bufnr, filetype, buftype)
|
||||
return { 'lsp', 'indent' }
|
||||
end
|
||||
})
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue