This repository has been archived by the owner on Jul 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
tmuxdir.txt
178 lines (118 loc) · 6.72 KB
/
tmuxdir.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
*tmuxdir.txt* tmux session workspace plugin for nvim and vim.
CONTENTS *tmuxdir-contents*
Introduction |tmuxdir-introduction|
Install |tmuxdir-install|
Interface |tmuxdir-interface|
Functions |tmuxdir-functions|
Configuration Examples |tmuxdir-examples|
Release Notes |tmuxdir-release-notes|
==============================================================================
INTRODUCTION *tmuxdir-introduction*
*tmuxdir* tmux session workspace plugin for nvim.
==============================================================================
INSTALL *tmuxdir-install*
Note: tmuxdir requires denite.nvim, pynvim, nvim 0.3+ and Python3.6+.
tmuxdir.nvim was written primarily targeting nvim with its RPC interface.
If you use dein:
>
call dein#add('viniarck/tmuxdir.nvim')
call dein#add('Shougo/denite.nvim')
<
If you use vim-plug:
>
Plug 'viniarck/tmuxdir.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'Shougo/denite.nvim'
<
After installing, and restarting nvim/vim, you should be able invoke this function to confirm it's all set, you shouldn't see any errors being reported:
>
:echo TmuxdirCheck()
<
Note: Make sure you have a recent version of pynvim
>
pip3 install --user --upgrade pynvim
<
==============================================================================
INTERFACE *tmuxdir-interface*
------------------------------------------------------------------------------
FUNCTIONS *tmuxdir-functions*
TmuxdirCheck()
Check if tmuxdir has been installed correctly and if tmux is
available in your bin PATH
TmuxdirAdd({arg})
Add an {arg} directory to the project list regardless or root
markers or not. It should be used when you don't have root
markers or just want to bookmark a directory.
TmuxdirClearAdded({arg})
Remove an {arg} directory of the project list which has been added
with TmuxdirAdd({arg})
TmuxdirListAdded({arg})
List all projects folders that have been either found based on added by TmuxdirAdd({arg})
TmuxdirClearAddedAll({arg})
Remove all added projects by TmuxdirAdd({arg}) from the project list.
TmuxdirIgnore({arg})
Ignore an {arg} directory of the project list. If it's ignored
it won't show up in the project list anymore
TmuxdirClearIgnored({arg})
Remove an {arg} directory of the project list which has been added
with TmuxdirIgnore({arg})
TmuxdirListIgnored({arg})
List all projects folders that have been ignored by TmuxdirIgnore({arg})
TmuxdirClearIgnoredAll({arg})
Stop ignoring all projects that have been ignored
------------------------------------------------------------------------------
CONFIGURATION EXAMPLES *tmuxdir-examples*
Set of base directories to look for your projects:
>
let g:tmuxdir_base_dirs = ['~/repos', '~/projects', '~/src']
<
Root markers to identify projects:
>
let g:tmuxdir_root_markers = ['.git']
Eager mode, by default is v:false, in order to stop the recursion for each base dirs
as soon at a specific depth level (the maximum depth currently is 3) once a root marker is found. Most likely you won't have nested repos, so this will yield faster results. However, if you do have nested repos and want them to be found you want to set this as v:true:
>
let g:tmuxdir_eager_mode = v:false
tmuxdir.nvim doesn't ship with any default key mappings, but the plugin's author uses these mappings:
>
nnoremap <silent> <A-m> :<C-u>Denite -start-filter tmux_session <cr>
inoremap <silent> <A-m> :<C-u>Denite -start-filter tmux_session <cr>
tnoremap <silent> <A-m> <C-\><C-n> :<C-u>Denite -start-filter tmux_session <cr>
nnoremap <silent> <A-n> :<C-u>Denite -start-filter tmux_dir <cr>
inoremap <silent> <A-n> :<C-u>Denite -start-filter tmux_dir <cr>
tnoremap <silent> <A-n> <C-\><C-n> :<C-u>Denite -start-filter tmux_dir <cr>
Both denite open and new actions are used, so you'll also need to have them
mapped, the author uses these mappings:
function! s:denite_my_settings() abort
nnoremap <silent><buffer><expr> <CR>
\ denite#do_map('do_action')
nnoremap <silent><buffer><expr> l
\ denite#do_map('do_action')
nnoremap <silent><buffer><expr> e
\ denite#do_map('do_action', 'new')
endfunction
==============================================================================
RELEASE NOTES *tmuxdir-release-notes*
2021-04-15
Released v2.0
Added support for `Denite` `action_new`, just so you can have additional
workspaces (tmux session) mapped to the same project. For example, you could have one session just for source code editing or reading and another one just for executing process or other background shell related tasks.
Augmented `TmuxdirAdd(directory)` to statically add a directory as a project. This enables you to bookmark some directory regardless of root markers. So, it's like an intermediary helper filling the gap for directories that don't have root markers yet. This is also handy if you have a monorepo and want to treat different folders there as different projects.
I'll have to drop support for vim 8+ because of the dependencies required aren't being maintained anymore and most users of this plugin use nvim. That will simplify the maintenance of this project and to keep the existing quality. So, if you want to use this plugin with vim, please use the version 1.1.
2020-08-02
Released g:tmuxdir_eager_mode option set as v:false. On my machine, with g:tmuxdir_eager_mode it resulted in a 5x speed up:
----------------------------------------------------------------------------------------- benchmark: 2 tests -----------------------------------------------------------------------------
-----------
Name (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds
Iterations
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-----------
test_find_projects_v11_not_eager 3.4188 (1.0) 4.3634 (1.0) 3.5153 (1.0) 0.0992 (1.0) 3.4894 (1.0) 0.0593 (1.0) 21;20 284.4703 (1.0) 274
1
test_find_projects_v10_eager 19.3482 (5.66) 20.1614 (4.62) 19.6167 (5.58) 0.1954 (1.97) 19.5694 (5.61) 0.2906 (4.90) 14;0 50.9769 (0.18) 50
1
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-----------
2020-03-25
Released v1.0 with documentation.
==============================================================================
vim:tw=78:ts=8:ft=help:norl:noet:fen:noet: