forgot
This commit is contained in:
@@ -1,62 +0,0 @@
|
||||
require("focus").setup({
|
||||
enable = true,
|
||||
commands = true,
|
||||
autoresize = {
|
||||
enable = true,
|
||||
width = 0,
|
||||
height = 0,
|
||||
minwidth = 0,
|
||||
minheight = 0,
|
||||
height_quickfix = 10,
|
||||
},
|
||||
split = {
|
||||
bufnew = false,
|
||||
tmux = false,
|
||||
},
|
||||
ui = {
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
hybridnumber = false,
|
||||
absolutenumber_unfocussed = false,
|
||||
|
||||
cursorline = true,
|
||||
cursorcolumn = false,
|
||||
colorcolumn = {
|
||||
enable = false,
|
||||
list = '+1',
|
||||
},
|
||||
signcolumn = false,
|
||||
winhighlight = false,
|
||||
}
|
||||
})
|
||||
|
||||
local ignore_filetypes = {"NvimTree"}
|
||||
local ignore_buftypes = {"prompt", "popup"}
|
||||
|
||||
local augroup =
|
||||
vim.api.nvim_create_augroup("FocusDisable", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd("WinEnter", {
|
||||
group = augroup,
|
||||
callback = function(_)
|
||||
if vim.tbl_contains(ignore_buftypes, vim.bo.buftype)
|
||||
then
|
||||
vim.w.focus_disable = true
|
||||
else
|
||||
vim.w.focus_disable = false
|
||||
end
|
||||
end,
|
||||
desc = "Disable focus autoresize for BufType",
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = augroup,
|
||||
callback = function(_)
|
||||
if vim.tbl_contains(ignore_filetypes, vim.bo.filetype) then
|
||||
vim.b.focus_disable = true
|
||||
else
|
||||
vim.b.focus_disable = false
|
||||
end
|
||||
end,
|
||||
desc = "Disable focus autoresize for FileType",
|
||||
})
|
||||
@@ -0,0 +1,34 @@
|
||||
local harpoon = require("harpoon")
|
||||
|
||||
harpoon:setup()
|
||||
|
||||
local conf = require("telescope.config").values
|
||||
local function toggle_telescope(harpoon_files)
|
||||
local file_paths = {}
|
||||
for _, item in ipairs(harpoon_files.items) do
|
||||
table.insert(file_paths, item.value)
|
||||
end
|
||||
|
||||
require("telescope.pickers").new({}, {
|
||||
prompt_title = "Harpoon",
|
||||
finder = require("telescope.finders").new_table({
|
||||
results = file_paths,
|
||||
}),
|
||||
previewer = conf.file_previewer({}),
|
||||
sorter = conf.generic_sorter({}),
|
||||
}):find()
|
||||
end
|
||||
|
||||
vim.keymap.set("n", "<C-e>", function() toggle_telescope(harpoon:list()) end,
|
||||
{ desc = "Open harpoon window" })
|
||||
|
||||
vim.keymap.set("n", "<leader>a", function() harpoon:list():add() end)
|
||||
vim.keymap.set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
|
||||
|
||||
vim.keymap.set("n", "<C-h>", function() harpoon:list():select(1) end)
|
||||
vim.keymap.set("n", "<C-t>", function() harpoon:list():select(2) end)
|
||||
vim.keymap.set("n", "<C-n>", function() harpoon:list():select(3) end)
|
||||
vim.keymap.set("n", "<C-s>", function() harpoon:list():select(4) end)
|
||||
|
||||
vim.keymap.set("n", "<C-S-P>", function() harpoon:list():prev() end)
|
||||
vim.keymap.set("n", "<C-S-N>", function() harpoon:list():next() end)
|
||||
Reference in New Issue
Block a user