nvim: harpoon, tmux: session manager
This commit is contained in:
parent
f7f7f2bda5
commit
4a9f0c303d
58
home/user/.config/nvim/lua/base/plugins/harpoon.lua
Normal file
58
home/user/.config/nvim/lua/base/plugins/harpoon.lua
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
return {
|
||||||
|
"ThePrimeagen/harpoon",
|
||||||
|
branch = "harpoon2",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"nvim-telescope/telescope.nvim"
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local harpoon = require("harpoon")
|
||||||
|
|
||||||
|
harpoon:setup()
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>a", function() harpoon:list():append() end)
|
||||||
|
vim.keymap.set("n", "<leader>fh", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<A-1>", function() harpoon:list():select(1) end)
|
||||||
|
vim.keymap.set("n", "<A-2>", function() harpoon:list():select(2) end)
|
||||||
|
vim.keymap.set("n", "<A-3>", function() harpoon:list():select(3) end)
|
||||||
|
vim.keymap.set("n", "<A-4>", function() harpoon:list():select(4) end)
|
||||||
|
|
||||||
|
-- Toggle previous & next buffers stored within Harpoon list
|
||||||
|
vim.keymap.set("n", "<C-S-P>", function() harpoon:list():prev() end)
|
||||||
|
vim.keymap.set("n", "<C-S-N>", function() harpoon:list():next() end)
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<C-x>",
|
||||||
|
function()
|
||||||
|
vim.ui.input({ prompt = "Harpoon mark index: " }, function(input)
|
||||||
|
local num = tonumber(input)
|
||||||
|
if num then
|
||||||
|
require("harpoon"):list():select(num)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
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", "<leader>fh", function() toggle_telescope(harpoon:list()) end,
|
||||||
|
{ desc = "Open harpoon window" })
|
||||||
|
|
||||||
|
end
|
||||||
|
}
|
||||||
@ -60,4 +60,11 @@ set -g set-titles on
|
|||||||
set -g set-titles-string '#S:#I.#P #W'
|
set -g set-titles-string '#S:#I.#P #W'
|
||||||
|
|
||||||
setw -g clock-mode-colour green
|
setw -g clock-mode-colour green
|
||||||
setw -g clock-mode-style 24
|
setw -g clock-mode-style 24
|
||||||
|
|
||||||
|
|
||||||
|
bind 1 source-file ~/.tmux/01.conf
|
||||||
|
bind 2 source-file ~/.tmux/02.conf
|
||||||
|
bind 3 source-file ~/.tmux/03.conf
|
||||||
|
bind 4 source-file ~/.tmux/04.conf
|
||||||
|
bind 5 source-file ~/.tmux/05.conf
|
||||||
3
home/user/.tmux/01.conf
Normal file
3
home/user/.tmux/01.conf
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
new -s s01 -A -n main -c "$WORKING_PROJECT" "$EDITOR"
|
||||||
|
send-keys M-1
|
||||||
|
splitw -d -h -l 40% -c '#{pane_current_path}'
|
||||||
2
install
2
install
@ -12,7 +12,7 @@ declare -r -A TARGETS=(
|
|||||||
["colors"]=".config/terminal-colors.d"
|
["colors"]=".config/terminal-colors.d"
|
||||||
["bash"]=".config/bash .bashrc .profile %colors"
|
["bash"]=".config/bash .bashrc .profile %colors"
|
||||||
["zsh"]="%bash .config/zsh .zshenv .inputrc"
|
["zsh"]="%bash .config/zsh .zshenv .inputrc"
|
||||||
["tmux"]=".tmux.conf"
|
["tmux"]=".tmux.conf .tmux"
|
||||||
["alacritty"]=".config/alacritty"
|
["alacritty"]=".config/alacritty"
|
||||||
["nvim"]=".config/nvim .editorconfig .local/bin/vim_askpass_helper"
|
["nvim"]=".config/nvim .editorconfig .local/bin/vim_askpass_helper"
|
||||||
["ssh"]=""
|
["ssh"]=""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user