mirror of
https://github.com/kogakure/dotfiles.git
synced 2026-02-04 04:35:29 +00:00
chore(vim): add TMUX plugins
This commit is contained in:
@@ -28,4 +28,5 @@ source ~/.config/nvim/plugins/treesitter.lua
|
|||||||
source ~/.config/nvim/plugins/trouble.lua
|
source ~/.config/nvim/plugins/trouble.lua
|
||||||
source ~/.config/nvim/plugins/ultisnips.vim
|
source ~/.config/nvim/plugins/ultisnips.vim
|
||||||
source ~/.config/nvim/plugins/vim-easymotion.vim
|
source ~/.config/nvim/plugins/vim-easymotion.vim
|
||||||
|
source ~/.config/nvim/plugins/vimux.vim
|
||||||
source ~/.config/nvim/plugins/web-devicons.lua
|
source ~/.config/nvim/plugins/web-devicons.lua
|
||||||
|
|||||||
@@ -77,6 +77,11 @@ Plug 'hoob3rt/lualine.nvim'
|
|||||||
Plug 'akinsho/bufferline.nvim'
|
Plug 'akinsho/bufferline.nvim'
|
||||||
Plug 'kyazdani42/nvim-web-devicons'
|
Plug 'kyazdani42/nvim-web-devicons'
|
||||||
|
|
||||||
|
" TMUX
|
||||||
|
Plug 'christoomey/vim-tmux-navigator'
|
||||||
|
Plug 'preservim/vimux'
|
||||||
|
Plug 'tyewang/vimux-jest-test'
|
||||||
|
|
||||||
" Tpope
|
" Tpope
|
||||||
Plug 'tpope/vim-abolish'
|
Plug 'tpope/vim-abolish'
|
||||||
Plug 'tpope/vim-commentary'
|
Plug 'tpope/vim-commentary'
|
||||||
|
|||||||
14
nvim/plugins/vimux.vim
Normal file
14
nvim/plugins/vimux.vim
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
" Vimux
|
||||||
|
" https://github.com/preservim/vimux
|
||||||
|
|
||||||
|
let g:VimuxHeight = "30"
|
||||||
|
let g:VimuxOrientation = 'h'
|
||||||
|
let g:VimuxUseNearestPane = 0
|
||||||
|
|
||||||
|
" Mappings
|
||||||
|
nmap <leader>vt :VimuxTogglePane<CR>
|
||||||
|
nmap <leader>vp :VimuxPromptCommand<CR>
|
||||||
|
nmap <leader>vl :VimuxRunLastCommand<CR>
|
||||||
|
nmap <leader>vj :RunJest<CR>
|
||||||
|
nmap <leader>vjb :RunJestOnBuffer<CR>
|
||||||
|
nmap <leader>vjf :RunJestFocused<CR>
|
||||||
19
tmux.conf
19
tmux.conf
@@ -71,6 +71,25 @@ bind-key -T copy-mode-vi Enter send-keys -X copy-selection
|
|||||||
|
|
||||||
bind p run "tmux paste-buffer"
|
bind p run "tmux paste-buffer"
|
||||||
|
|
||||||
|
# Smart pane switching with awareness of Vim splits.
|
||||||
|
# See: https://github.com/christoomey/vim-tmux-navigator
|
||||||
|
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
|
||||||
|
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
|
||||||
|
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
|
||||||
|
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
|
||||||
|
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
|
||||||
|
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
|
||||||
|
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
|
||||||
|
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
|
||||||
|
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
|
||||||
|
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
|
||||||
|
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
|
||||||
|
|
||||||
|
bind-key -T copy-mode-vi 'C-h' select-pane -L
|
||||||
|
bind-key -T copy-mode-vi 'C-j' select-pane -D
|
||||||
|
bind-key -T copy-mode-vi 'C-k' select-pane -U
|
||||||
|
bind-key -T copy-mode-vi 'C-l' select-pane -R
|
||||||
|
|
||||||
set -g @shell_mode 'vi'
|
set -g @shell_mode 'vi'
|
||||||
|
|
||||||
# List of plugins (prefix + I to install, prefix + U to update)
|
# List of plugins (prefix + I to install, prefix + U to update)
|
||||||
|
|||||||
Reference in New Issue
Block a user