Skip to content

Commit

Permalink
feat!: move tmux related to extras
Browse files Browse the repository at this point in the history
  • Loading branch information
rafi committed May 17, 2024
1 parent be015b0 commit cc66557
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 35 deletions.
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,6 @@ _Note_ that 95% of the plugins are **lazy-loaded**.
| [nmac427/guess-indent.nvim] | Automatic indentation style detection
| [tweekmonster/helpful.vim] | Display vim version numbers in docs
| [lambdalisue/suda.vim] | An alternative sudo for Vim and Neovim
| [christoomey/tmux-navigator] | Seamless navigation between tmux panes and vim splits
| [folke/persistence.nvim] | Simple lua plugin for automated session management
| [mbbill/undotree] | Ultimate undo history visualizer
| [folke/flash.nvim] | Search labels, enhanced character motions
Expand All @@ -502,7 +501,6 @@ _Note_ that 95% of the plugins are **lazy-loaded**.
| [hrsh7th/cmp-buffer] | nvim-cmp source for buffer words
| [hrsh7th/cmp-path] | nvim-cmp source for path
| [hrsh7th/cmp-emoji] | nvim-cmp source for emoji
| [andersevenrud/cmp-tmux] | Tmux completion source for nvim-cmp
| [L3MON4D3/LuaSnip] | Snippet Engine written in Lua
| [rafamadriz/friendly-snippets] | Preconfigured snippets for different languages
| [saadparwaiz1/cmp_luasnip] | Luasnip completion source for nvim-cmp
Expand Down Expand Up @@ -594,7 +592,6 @@ _Note_ that 95% of the plugins are **lazy-loaded**.

[folke/lazy.nvim]: https://github.com/folke/lazy.nvim
[nmac427/guess-indent.nvim]: https://github.com/nmac427/guess-indent.nvim
[christoomey/tmux-navigator]: https://github.com/christoomey/vim-tmux-navigator
[tweekmonster/helpful.vim]: https://github.com/tweekmonster/helpful.vim
[lambdalisue/suda.vim]: https://github.com/lambdalisue/suda.vim
[folke/persistence.nvim]: https://github.com/folke/persistence.nvim
Expand All @@ -616,7 +613,6 @@ _Note_ that 95% of the plugins are **lazy-loaded**.
[hrsh7th/cmp-buffer]: https://github.com/hrsh7th/cmp-buffer
[hrsh7th/cmp-path]: https://github.com/hrsh7th/cmp-path
[hrsh7th/cmp-emoji]: https://github.com/hrsh7th/cmp-emoji
[andersevenrud/cmp-tmux]: https://github.com/andersevenrud/cmp-tmux
[L3MON4D3/LuaSnip]: https://github.com/L3MON4D3/LuaSnip
[rafamadriz/friendly-snippets]: https://github.com/rafamadriz/friendly-snippets
[saadparwaiz1/cmp_luasnip]: https://github.com/saadparwaiz1/cmp_luasnip
Expand Down Expand Up @@ -789,6 +785,7 @@ Spec: `rafi.plugins.extras.lang.<name>`
| `go` | syntax, lsp, formatter, dap [leoluz/nvim-dap-go], test [nvim-neotest/neotest-go]
| `helm` | syntax, lsp
| `python` | syntax, lsp, dap [mfussenegger/nvim-dap-python], test, [rafi/neoconf-venom.nvim]
| `tmux` | syntax, completion [andersevenrud/cmp-tmux], keymaps [christoomey/tmux-navigator]
| `yaml` | syntax, lsp, schemas, [b0o/SchemaStore.nvim]

[pearofducks/ansible-vim]: https://github.com/pearofducks/ansible-vim
Expand All @@ -797,6 +794,8 @@ Spec: `rafi.plugins.extras.lang.<name>`
[mfussenegger/nvim-dap-python]: https://github.com/mfussenegger/nvim-dap-python
[rafi/neoconf-venom.nvim]: https://github.com/rafi/neoconf-venom.nvim
[b0o/SchemaStore.nvim]: https://github.com/b0o/SchemaStore.nvim
[christoomey/tmux-navigator]: https://github.com/christoomey/vim-tmux-navigator
[andersevenrud/cmp-tmux]: https://github.com/andersevenrud/cmp-tmux

### Extra Plugins: Linting

Expand Down Expand Up @@ -931,10 +930,10 @@ Note that,
| <kbd>gj</kbd> / <kbd>gk</kbd> | 𝐍 𝐕 𝐒 | Jump to edge upward/downward | <small>[haya14busa/vim-edgemotion]</small>
| <kbd>gh</kbd> / <kbd>gl</kbd> | 𝐍 𝐕 | Easier line-wise movement | <small>`g^` `g$`</small>
| <kbd>zl</kbd> / <kbd>zh</kbd> | 𝐍 | Scroll horizontally and vertically wider | <small>`z4` `l/h`</small>
| <kbd>Ctrl</kbd>+<kbd>j</kbd> | 𝐍 | Move to split below | <small>[christoomey/tmux-navigator]</small>
| <kbd>Ctrl</kbd>+<kbd>k</kbd> | 𝐍 | Move to upper split | <small>[christoomey/tmux-navigator]</small>
| <kbd>Ctrl</kbd>+<kbd>h</kbd> | 𝐍 | Move to left split | <small>[christoomey/tmux-navigator]</small>
| <kbd>Ctrl</kbd>+<kbd>l</kbd> | 𝐍 | Move to right split | <small>[christoomey/tmux-navigator]</small>
| <kbd>Ctrl</kbd>+<kbd>j</kbd> | 𝐍 | Move to split below | <small>`<C-w>j` or [christoomey/tmux-navigator]</small>
| <kbd>Ctrl</kbd>+<kbd>k</kbd> | 𝐍 | Move to upper split | <small>`<C-w>k` or [christoomey/tmux-navigator]</small>
| <kbd>Ctrl</kbd>+<kbd>h</kbd> | 𝐍 | Move to left split | <small>`<C-w>h` or [christoomey/tmux-navigator]</small>
| <kbd>Ctrl</kbd>+<kbd>l</kbd> | 𝐍 | Move to right split | <small>`<C-w>l` or [christoomey/tmux-navigator]</small>
| <kbd>Return</kbd> | 𝐍 | Toggle fold under cursor | <small>`za`</small>
| <kbd>Shift</kbd>+<kbd>Return</kbd> | 𝐍 | Focus the current fold by closing all others | <small>`zMzv`</small>
| <kbd>Ctrl</kbd>+<kbd>f</kbd> | 𝐂 | Move cursor forwards in command | <kbd>Right</kbd>
Expand Down
8 changes: 0 additions & 8 deletions lua/rafi/plugins/coding.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ return {
'hrsh7th/cmp-path',
-- nvim-cmp source for emoji
'hrsh7th/cmp-emoji',
-- nvim-cmp source for tmux
'andersevenrud/cmp-tmux',
},
-- Not all LSP servers add brackets when completing a function.
-- To better deal with this, LazyVim adds a custom option to cmp,
Expand Down Expand Up @@ -58,12 +56,6 @@ return {
}, {
{ name = 'buffer', priority = 50, keyword_length = 3 },
{ name = 'emoji', insert = true, priority = 20 },
{
name = 'tmux',
priority = 10,
keyword_length = 3,
option = { all_panes = true, label = 'tmux' },
},
}),
mapping = cmp.mapping.preset.insert({
-- <CR> accepts currently selected item.
Expand Down
18 changes: 0 additions & 18 deletions lua/rafi/plugins/editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,6 @@ return {
-- An alternative sudo for Vim and Neovim
{ 'lambdalisue/suda.vim', event = 'BufRead' },

-----------------------------------------------------------------------------
-- Seamless navigation between tmux panes and vim splits
{
'christoomey/vim-tmux-navigator',
lazy = false,
cond = vim.env.TMUX and vim.uv.os_uname().sysname ~= 'Windows_NT',
-- stylua: ignore
keys = {
{ '<C-h>', '<cmd>TmuxNavigateLeft<CR>', mode = { 'n', 't' }, silent = true, desc = 'Go to Left Window' },
{ '<C-j>', '<cmd>TmuxNavigateDown<CR>', mode = { 'n', 't' }, silent = true, desc = 'Go to Lower Window' },
{ '<C-k>', '<cmd>TmuxNavigateUp<CR>', mode = { 'n', 't' }, silent = true, desc = 'Go to Upper Window' },
{ '<C-l>', '<cmd>TmuxNavigateRight<CR>', mode = { 'n', 't' }, silent = true, desc = 'Go to Right Window' },
},
init = function()
vim.g.tmux_navigator_no_mappings = true
end,
},

-----------------------------------------------------------------------------
-- Simple lua plugin for automated session management
{
Expand Down
54 changes: 54 additions & 0 deletions lua/rafi/plugins/extras/lang/tmux.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
return {

-----------------------------------------------------------------------------
{
'nvim-treesitter/nvim-treesitter',
opts = function(_, opts)
if type(opts.ensure_installed) == 'table' then
vim.list_extend(opts.ensure_installed, { 'tmux' })
end

vim.filetype.add({
filename = { Tmuxfile = 'tmux' },
})
end,
},

-----------------------------------------------------------------------------
-- Seamless navigation between tmux panes and vim splits
{
'christoomey/vim-tmux-navigator',
lazy = false,
cond = vim.env.TMUX and vim.uv.os_uname().sysname ~= 'Windows_NT',
-- stylua: ignore
keys = {
{ '<C-h>', '<cmd>TmuxNavigateLeft<CR>', mode = { 'n', 't' }, silent = true, desc = 'Go to Left Window' },
{ '<C-j>', '<cmd>TmuxNavigateDown<CR>', mode = { 'n', 't' }, silent = true, desc = 'Go to Lower Window' },
{ '<C-k>', '<cmd>TmuxNavigateUp<CR>', mode = { 'n', 't' }, silent = true, desc = 'Go to Upper Window' },
{ '<C-l>', '<cmd>TmuxNavigateRight<CR>', mode = { 'n', 't' }, silent = true, desc = 'Go to Right Window' },
},
init = function()
vim.g.tmux_navigator_no_mappings = true
end,
},

-----------------------------------------------------------------------------
{
'hrsh7th/nvim-cmp',
optional = true,
dependencies = {
-- nvim-cmp source for tmux
'andersevenrud/cmp-tmux',
},
opts = function(_, opts)
opts = opts or {}
opts.sources = opts.sources or {}
table.insert(opts.sources, {
name = 'tmux',
priority = 10,
keyword_length = 3,
option = { all_panes = true, label = 'tmux' },
})
end,
},
}
1 change: 0 additions & 1 deletion lua/rafi/plugins/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ return {
'ssh_config',
'starlark',
'svelte',
'tmux',
'todotxt',
'toml',
'vim',
Expand Down

0 comments on commit cc66557

Please sign in to comment.