[MAJOR] Tmux + nvim integration panels

This commit is contained in:
Afonso Franco 2023-05-18 14:40:19 +01:00
parent ec0f50d10b
commit e253c1fbe5
Signed by: afonso
SSH key fingerprint: SHA256:JiuxZNdA5bRWXPMUJChI0AQ75yC+cXY4xM0IaVwEVys
2 changed files with 83 additions and 24 deletions

View file

@ -6,7 +6,8 @@ lazy.setup({
-------------------------------------------THEMES------------------------------------------
'joshdick/onedark.vim',
{ 'catppuccin/nvim',
{
'catppuccin/nvim',
lazy = false,
priority = 1000,
config = function()
@ -15,13 +16,15 @@ lazy.setup({
},
-------------------------------------------------------QOL---------------------------------
--better navigation with 's-letter'
{ 'ggandor/leap.nvim',
{
'ggandor/leap.nvim',
config = function()
require('leap').add_default_mappings()
end
},
{ 'folke/zen-mode.nvim',
{
'folke/zen-mode.nvim',
config = function()
require("zen-mode").setup {
vim.keymap.set('n', '<leader>z', '<Cmd> ZenMode <CR>', { noremap = true, silent = true })
@ -32,11 +35,28 @@ lazy.setup({
--Change add and remove surroundings from words
'tpope/vim-surround',
--Tmux navigation
{
'alexghergh/nvim-tmux-navigation',
config = function()
require 'nvim-tmux-navigation'.setup {
disable_when_zoomed = true, -- defaults to false
keybindings = {
left = "<F5>",
down = "<F6>",
up = "<F7>",
right = "<F8>",
}
}
end
},
-- Rename variable pop up
'stevearc/dressing.nvim',
{ 'windwp/nvim-autopairs',
config = function() require('nvim-autopairs').setup {}
{
'windwp/nvim-autopairs',
config = function()
require('nvim-autopairs').setup {}
end
},
@ -51,7 +71,8 @@ lazy.setup({
},
-------------------------------------------------------LSP----------------------------------------------
{ 'hrsh7th/nvim-cmp',
{
'hrsh7th/nvim-cmp',
dependencies = {
'hrsh7th/cmp-nvim-lsp', -- lsp
'hrsh7th/cmp-nvim-lua', -- Nvim API completions
@ -69,7 +90,8 @@ lazy.setup({
},
--LSP Status
{ 'j-hui/fidget.nvim',
{
'j-hui/fidget.nvim',
config = function()
require('fidget').setup {
window = {
@ -79,7 +101,8 @@ lazy.setup({
end
},
{ 'williamboman/mason.nvim',
{
'williamboman/mason.nvim',
config = function()
require 'plugins.mason'
end
@ -87,19 +110,22 @@ lazy.setup({
'williamboman/mason-lspconfig.nvim',
{ 'neovim/nvim-lspconfig',
{
'neovim/nvim-lspconfig',
config = function()
require 'plugins.lspconfig'
end
},
{ 'jose-elias-alvarez/null-ls.nvim',
{
'jose-elias-alvarez/null-ls.nvim',
config = function()
require 'plugins.null-ls'
end
},
{ 'lervag/vimtex',
{
'lervag/vimtex',
config = function()
require 'plugins.vimtex'
end
@ -108,21 +134,24 @@ lazy.setup({
{ 'github/copilot.vim' },
-------------------------------------------------------------------------------------------
-- Syntax Highlighting
{ 'nvim-treesitter/nvim-treesitter',
{
'nvim-treesitter/nvim-treesitter',
config = function()
require 'plugins.treesitter'
end
},
--Sticky headers
{ 'nvim-treesitter/nvim-treesitter-context',
{
'nvim-treesitter/nvim-treesitter-context',
config = function()
require 'plugins.treesitter-context'
end
},
--Tabs
{ 'akinsho/bufferline.nvim',
{
'akinsho/bufferline.nvim',
version = 'v3.*',
dependencies = 'nvim-tree/nvim-web-devicons',
config = function()
@ -132,7 +161,8 @@ lazy.setup({
--does so much
{
'nvim-telescope/telescope.nvim', tag = '0.1.0',
'nvim-telescope/telescope.nvim',
tag = '0.1.0',
-- or , branch = '0.1.x',
dependencies = { 'nvim-lua/plenary.nvim' },
config = function() require('plugins.telescope') end
@ -140,7 +170,8 @@ lazy.setup({
--Main menu
{ 'startup-nvim/startup.nvim',
{
'startup-nvim/startup.nvim',
dependencies = { 'nvim-telescope/telescope.nvim', 'nvim-lua/plenary.nvim' },
config = function()
require('startup').setup { theme = 'dashboard' }

View file

@ -3,7 +3,35 @@ set -ag terminal-overrides ",$TERM:RGB"
set -sg escape-time 0
#binds
bind-key x kill-pane
bind-key 'x' kill-pane
bind-key 'h' previous-window
bind-key 'j' switch-client -p
bind-key 'k' switch-client -n
bind-key 'l' next-window
bind-key 'n' new-window
bind-key 'c' kill-window
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
# decide whether we're in a Vim process
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
unbind y
bind-key 'y' if-shell "$is_vim" 'send-keys F5' 'select-pane -L'
unbind u
bind-key 'u' if-shell "$is_vim" 'send-keys F6' 'select-pane -D'
unbind i
bind-key 'i' if-shell "$is_vim" 'send-keys F7' 'select-pane -U'
unbind o
bind-key 'o' if-shell "$is_vim" 'send-keys F8' 'select-pane -R'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
bind-key -T copy-mode-vi 'y' select-pane -L
bind-key -T copy-mode-vi 'u' select-pane -D
bind-key -T copy-mode-vi 'i' select-pane -U
bind-key -T copy-mode-vi 'o' select-pane -R
# List of plugins
set -g @plugin 'tmux-plugins/tpm'