Add session managment to tmux and neovim

This commit is contained in:
Alexander Navarro 2023-10-30 16:43:53 -03:00
parent 58f515d9d0
commit 5898f6b5a6
7 changed files with 69 additions and 60 deletions

View file

@ -1,6 +1,7 @@
{ {
"LuaSnip": { "branch": "master", "commit": "80a8528f084a97b624ae443a6f50ff8074ba486b" }, "LuaSnip": { "branch": "master", "commit": "80a8528f084a97b624ae443a6f50ff8074ba486b" },
"alpha-nvim": { "branch": "main", "commit": "234822140b265ec4ba3203e3e0be0e0bb826dff5" }, "alpha-nvim": { "branch": "main", "commit": "234822140b265ec4ba3203e3e0be0e0bb826dff5" },
"auto-session": { "branch": "main", "commit": "3eb26b949e1b90798e84926848551046e2eb0721" },
"bufferline.nvim": { "branch": "main", "commit": "357cc8f8eeb64702e6fcf2995e3b9becee99a5d3" }, "bufferline.nvim": { "branch": "main", "commit": "357cc8f8eeb64702e6fcf2995e3b9becee99a5d3" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" },

View file

@ -50,6 +50,8 @@ opt.wildmode = "longest:full,full" -- Command-line completion mode
opt.winminwidth = 5 -- Minimum window width opt.winminwidth = 5 -- Minimum window width
opt.wrap = false -- Disable line wrap opt.wrap = false -- Disable line wrap
vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
vim.filetype.add({ vim.filetype.add({
-- Detect and assign filetype based on the extension of the filename -- Detect and assign filetype based on the extension of the filename
extension = { extension = {

View file

@ -10,6 +10,7 @@ return {
"petertriho/cmp-git", "petertriho/cmp-git",
"hrsh7th/cmp-cmdline", "hrsh7th/cmp-cmdline",
"saadparwaiz1/cmp_luasnip", "saadparwaiz1/cmp_luasnip",
"L3MON4D3/LuaSnip",
}, },
config = function() config = function()
vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true }) vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true })

View file

@ -1,16 +1,9 @@
return { return {
-- NOTE: First, some plugins that don't require any configuration
-- Detect tabstop and shiftwidth automatically -- Detect tabstop and shiftwidth automatically
"tpope/vim-sleuth", "tpope/vim-sleuth",
{ {
-- Autocompletion -- Highlight word under cursor
"hrsh7th/nvim-cmp",
dependencies = { "hrsh7th/cmp-nvim-lsp", "L3MON4D3/LuaSnip", "saadparwaiz1/cmp_luasnip" },
},
{
"RRethy/vim-illuminate", "RRethy/vim-illuminate",
event = { "BufReadPost", "BufNewFile" }, event = { "BufReadPost", "BufNewFile" },
opts = { delay = 200 }, opts = { delay = 200 },

View file

@ -0,0 +1,10 @@
return {
-- sessions
"rmagatti/auto-session",
config = function()
require("auto-session").setup({
log_level = "error",
auto_session_suppress_dirs = { "~/", "~/Downloads", "/" },
})
end,
}

View file

@ -23,7 +23,7 @@ set -g prefix C-Space
# Reload Config # Reload Config
unbind R unbind R
bind R source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf" bind R source-file ~/.config/tmux/tmux.conf \; display "Reloaded ~/.config/tmux/tmux.conf"
# Copy Mode # Copy Mode
unbind [ unbind [
@ -71,8 +71,8 @@ bind l next-window
if "test ! -d ~/.config/tmux/plugins/tpm" \ if "test ! -d ~/.config/tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm && ~/.config/tmux/plugins/tpm/bin/install_plugins'" "run 'git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm && ~/.config/tmux/plugins/tpm/bin/install_plugins'"
set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.config/tmux/plugins/tpm'
run -b '~/.config/tmux/plugins/tpm/tpm' run -b '~/.config/tmux/plugins/tpm/tpm'
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'catppuccin/tmux' set -g @plugin 'catppuccin/tmux'
# set -g @plugin 'rwxd/catppuccin-tmux' # set -g @plugin 'rwxd/catppuccin-tmux'
@ -82,8 +82,8 @@ set -g @plugin 'laktak/extrakto'
set -g @plugin 'christoomey/vim-tmux-navigator' set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'sainnhe/tmux-fzf' set -g @plugin 'sainnhe/tmux-fzf'
set -g @plugin 'tmux-plugins/tmux-resurrect' set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tpm'
## Plugin Config ## Plugin Config
set -g @catppuccin_flavour 'macchiato' set -g @catppuccin_flavour 'macchiato'
@ -94,10 +94,12 @@ set -g @catppuccin_status_right_separator ""
set -g @catppuccin_status_right_separator_inverse "no" set -g @catppuccin_status_right_separator_inverse "no"
set -g @catppuccin_status_fill "icon" set -g @catppuccin_status_fill "icon"
set -g @catppuccin_status_connect_separator "no" set -g @catppuccin_status_connect_separator "no"
set -g @continuum-restore 'on'
set -g @resurrect-processes 'vi vim nvim man "~pnpm dev->pnpm dev *"'
TMUX_FZF_LAUNCH_KEY="w" TMUX_FZF_LAUNCH_KEY="w"
TMUX_FZF_OPTIONS="-p -w 80% -h 60% -m" TMUX_FZF_OPTIONS="-p -w 80% -h 60% -m"
# Tmux Managment # Tmux Managment
bind-key "f" run-shell -b "$HOME/.tmux/plugins/tmux-fzf/scripts/session.sh switch" bind-key "f" run-shell -b "$HOME/.config/tmux/plugins/tmux-fzf/scripts/session.sh switch"
bind-key "F" run-shell -b "$HOME/.tmux/plugins/tmux-fzf/scripts/window.sh switch" bind-key "F" run-shell -b "$HOME/.config/tmux/plugins/tmux-fzf/scripts/window.sh switch"