update: nvim
This commit is contained in:
@@ -5,20 +5,43 @@ return function()
|
||||
misc = require("modules.utils.icons").get("misc", true),
|
||||
ui = require("modules.utils.icons").get("ui", true),
|
||||
}
|
||||
local utils = require("dropbar.utils")
|
||||
local sources = require("dropbar.sources")
|
||||
-- Custom source to display only the leaf filename in the dropbar
|
||||
sources.symbols = {
|
||||
get_symbols = function(buf, win, cursor)
|
||||
local symbols = sources.path.get_symbols(buf, win, cursor)
|
||||
return { symbols[#symbols] }
|
||||
end,
|
||||
}
|
||||
|
||||
require("modules.utils").load_plugin("dropbar", {
|
||||
bar = {
|
||||
hover = false,
|
||||
truncate = true,
|
||||
pick = { pivots = "etovxqpdygfblzhckisuran" },
|
||||
sources = function(buf)
|
||||
if vim.bo[buf].ft == "markdown" then
|
||||
return {
|
||||
sources.symbols,
|
||||
sources.markdown,
|
||||
}
|
||||
end
|
||||
if vim.bo[buf].buftype == "terminal" then
|
||||
return {
|
||||
sources.terminal,
|
||||
}
|
||||
end
|
||||
return {
|
||||
sources.symbols,
|
||||
utils.source.fallback({
|
||||
sources.lsp,
|
||||
sources.treesitter,
|
||||
}),
|
||||
}
|
||||
end,
|
||||
},
|
||||
sources = {
|
||||
path = {
|
||||
relative_to = function()
|
||||
-- Only show the leaf filename in dropbar
|
||||
return vim.fn.expand("%:p:h")
|
||||
end,
|
||||
},
|
||||
terminal = {
|
||||
name = function(buf)
|
||||
local name = vim.api.nvim_buf_get_name(buf)
|
||||
@@ -35,7 +58,6 @@ return function()
|
||||
icons = {
|
||||
enable = true,
|
||||
kinds = {
|
||||
use_devicons = true,
|
||||
symbols = {
|
||||
-- Type
|
||||
Array = icons.type.Array,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
return function()
|
||||
local builtin = require("telescope.builtin")
|
||||
local extensions = require("telescope").extensions
|
||||
local vim_path = require("core.global").vim_path
|
||||
|
||||
require("modules.utils").load_plugin("search", {
|
||||
collections = {
|
||||
@@ -12,7 +13,9 @@ return function()
|
||||
name = "Files",
|
||||
tele_func = function(opts)
|
||||
opts = opts or {}
|
||||
if vim.fn.isdirectory(".git") == 1 then
|
||||
if vim.fn.getcwd() == vim_path then
|
||||
builtin.find_files(vim.tbl_deep_extend("force", opts, { no_ignore = true }))
|
||||
elseif vim.fn.isdirectory(".git") == 1 then
|
||||
builtin.git_files(opts)
|
||||
else
|
||||
builtin.find_files(opts)
|
||||
@@ -46,13 +49,20 @@ return function()
|
||||
{
|
||||
name = "Word in project",
|
||||
tele_func = function()
|
||||
extensions.live_grep_args.live_grep_args()
|
||||
local opts = {}
|
||||
if vim.fn.getcwd() == vim_path then
|
||||
opts["additional_args"] = { "--no-ignore" }
|
||||
end
|
||||
extensions.live_grep_args.live_grep_args(opts)
|
||||
end,
|
||||
},
|
||||
{
|
||||
name = "Word under cursor",
|
||||
tele_func = function(opts)
|
||||
opts = opts or {}
|
||||
if vim.fn.getcwd() == vim_path then
|
||||
opts["additional_args"] = { "--no-ignore" }
|
||||
end
|
||||
builtin.grep_string(opts)
|
||||
end,
|
||||
},
|
||||
|
||||
@@ -44,13 +44,6 @@ return function()
|
||||
buffer_previewer_maker = require("telescope.previewers").buffer_previewer_maker,
|
||||
},
|
||||
extensions = {
|
||||
aerial = {
|
||||
show_lines = false,
|
||||
show_nesting = {
|
||||
["_"] = false, -- This key will be the default
|
||||
lua = true, -- You can set the option for specific filetypes
|
||||
},
|
||||
},
|
||||
fzf = {
|
||||
fuzzy = false,
|
||||
override_generic_sorter = true,
|
||||
@@ -97,6 +90,5 @@ return function()
|
||||
require("telescope").load_extension("undo")
|
||||
require("telescope").load_extension("zoxide")
|
||||
require("telescope").load_extension("persisted")
|
||||
require("telescope").load_extension("aerial")
|
||||
require("telescope").load_extension("advanced_git_search")
|
||||
end
|
||||
|
||||
@@ -8,21 +8,11 @@ return function()
|
||||
return vim.o.columns * 0.40
|
||||
end
|
||||
end,
|
||||
on_open = function(term)
|
||||
on_open = function()
|
||||
-- Prevent infinite calls from freezing neovim.
|
||||
-- Only set these options specific to this terminal buffer.
|
||||
vim.api.nvim_set_option_value("foldmethod", "manual", { scope = "local" })
|
||||
vim.api.nvim_set_option_value("foldexpr", "0", { scope = "local" })
|
||||
|
||||
-- Prevent horizontal terminal from obscuring `nvim-tree`.
|
||||
local api = require("nvim-tree.api")
|
||||
local tree = require("nvim-tree.view")
|
||||
if tree.is_visible() and term.direction == "horizontal" then
|
||||
local width = vim.fn.winwidth(tree.get_winnr())
|
||||
api.tree.toggle()
|
||||
tree.View.width = width
|
||||
api.tree.toggle(false, true)
|
||||
end
|
||||
end,
|
||||
highlights = {
|
||||
Normal = {
|
||||
|
||||
Reference in New Issue
Block a user