Skip to content

Commit af234da

Browse files
committed
Updates unpublished plugin before removing.
1 parent dfea850 commit af234da

File tree

4 files changed

+85
-19
lines changed

4 files changed

+85
-19
lines changed

vim/unpublished/working-set/doc/working-set.txt

Lines changed: 69 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ CONTENTS *working-set-contents*
1515
INTRO *working-set-intro*
1616

1717
Working Set is an programming editor companion that makes searching, and using
18-
search results for jumping around, super nice.
18+
search results for navigation, super nice.
1919

2020
This is the vim plugin that integrates vim with Working Set. If you're using
2121
vim 8, then the async features will be used, and the integration is smoother.
@@ -46,15 +46,15 @@ COMMANDS *working-set-commands*
4646

4747
All interaction with Working Set can be driven by commands in ex mode.
4848

49-
WS {term} - does a search in Working Set.
49+
:WS {term} - does a search in Working Set.
5050

51-
WSSync - jumps to currently selected location.
51+
:WSSync - jumps to currently selected location.
5252

53-
WSSelectNextItem - selects next match in Working Set, then syncs.
53+
:WSSelectNextItem - selects next match in Working Set, then syncs.
5454

55-
WSSelectPrevItem - selects previous match in Working Set, then syncs.
55+
:WSSelectPrevItem - selects previous match in Working Set, then syncs.
5656

57-
WSSearchCurrentWord - does a word-boundary search on the word under the
57+
:WSSearchCurrentWord - does a word-boundary search on the word under the
5858
cursor.
5959

6060
Examples:
@@ -81,6 +81,67 @@ commands.
8181
<Leader>* This does a word match on the word under the cursor in vim (like *)
8282
followed by :WSSearchCurrentWord.
8383

84+
Note: If you don't want the default mappings, you can disable them by setting
85+
"g:WorkingSetSkipMappings" to any value before loading the plugin.
86+
87+
===============================================================================
88+
USAGE GUIDE *working-set-usage-guide*
89+
90+
Working Set (the standalone program) is intended to run separately, alongside
91+
your editor. Your editor will communicate with Working Set via a file socket,
92+
sending and receiving commands. Those commands will run searches, display
93+
results, facilitate navigation and other operations.
94+
95+
Working Set works best running in a terminal window that is tall, and placed
96+
juxtaposed to the side of your editor. If you use Tmux, this is a perfect time
97+
to use split panes.
98+
99+
For example, on a laptop, I would suggest running your terminal full screen with
100+
Vim taking most of the space on the left, and Working Set running in a pane that
101+
takes up a smaller space on the right.
102+
103+
Laptop Screen
104+
+----------------------------+----------+
105+
| | |
106+
| | |
107+
| | |
108+
| | |
109+
| | |
110+
| Vim | Working |
111+
| | Set |
112+
| | |
113+
| | |
114+
| | |
115+
| | |
116+
+----------------------------+----------+
117+
118+
On a larger desktop or multi-monitor setup, you could be more creative, running
119+
Working Set in a separate window, even on a separate monitor.
120+
121+
With that in mind, here's the steps:
122+
123+
1) Install Working Set (gem install working_set)
124+
125+
2) Install working-set.vim plugin
126+
- don't forget to install socat
127+
128+
3) Change to your project's directory and run `working_set`
129+
130+
$ working_set [whatever options you want]
131+
132+
By default, Working Set will create a hidden socket file in that directory
133+
that the vim plugin will use for communication.
134+
135+
4) In another terminal, change to your project's directory and open vim.
136+
137+
$ vim
138+
139+
5) Use "<leader>*" in normal mode, or the :WS commands to drive searches.
140+
141+
Working Set has an ncurses based interface with various keybindings that will
142+
feel natural to vim users. Checkout Working Set's help to learn more about what
143+
you can do with it.
144+
84145
===============================================================================
85146
CONTRIBUTING *working-set-contributing*
86147

@@ -100,5 +161,6 @@ Git repository: https://github.com/coderifous/working-set.vim
100161
===============================================================================
101162
CHANGELOG *working-set-changelog*
102163

103-
2016/12/25: First Public Release.
164+
2020/09/02: Actual first public release.
165+
2016/12/25: First public release.
104166

vim/unpublished/working-set/plugin/working-set-vim7.vim

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,11 @@ command! WSSelectPrevItem call s:WS_select_prev_item()
143143
command! WSSearchCurrentWord call s:WS_search_current_word()
144144
command! WSWaitForSync call s:WS_wait_for_sync()
145145

146-
nnoremap <silent> <C-n> :WSSelectNextItem<CR>
147-
nnoremap <silent> <C-p> :WSSelectPrevItem<CR>
148-
nnoremap <silent> <Leader>* *N:WSSearchCurrentWord<CR>
149-
nnoremap <silent> <Leader><Leader> :WSWaitForSync<CR>
146+
if !exists('g:WorkingSetSkipMappings')
147+
nnoremap <silent> <C-n> :WSSelectNextItem<CR>
148+
nnoremap <silent> <C-p> :WSSelectPrevItem<CR>
149+
nnoremap <silent> <Leader>* *N:WSSearchCurrentWord<CR>
150+
nnoremap <silent> <Leader><Leader> :WSWaitForSync<CR>
151+
endif
150152

151153
endif

vim/unpublished/working-set/plugin/working-set-vim8.vim

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ func! s:Connect(socketfile)
2222
let g:WSjob = job_start("socat - UNIX-CONNECT:" . a:socketfile, { "err_cb": function("s:ErrorHandler"), "out_cb": function("s:BasicInputHandler") })
2323
let g:WSchannel = job_getchannel(g:WSjob)
2424

25-
if ch_status(g:WSchannel) == "open"
26-
echomsg "WS connected."
27-
else
25+
if ch_status(g:WSchannel) != "open"
2826
echomsg "Unable to connect to .working_set_socket"
2927
endif
3028
endfunc
@@ -127,10 +125,12 @@ command! WSSelectNextItem call s:SelectNextItem()
127125
command! WSSelectPrevItem call s:SelectPrevItem()
128126
command! WSSearchCurrentWord call s:SearchCurrentWord()
129127

130-
nnoremap <silent> <C-n> :WSSelectNextItem<CR>
131-
nnoremap <silent> <C-p> :WSSelectPrevItem<CR>
132-
nnoremap <silent> <Leader>* *N:WSSearchCurrentWord<CR>
133-
nnoremap <silent> <Leader>p :WSGrab p<CR>
134-
nnoremap <silent> <Leader>P :WSGrab P<CR>
128+
if !exists('g:WorkingSetSkipMappings')
129+
nnoremap <silent> <C-n> :WSSelectNextItem<CR>
130+
nnoremap <silent> <C-p> :WSSelectPrevItem<CR>
131+
nnoremap <silent> <Leader>* *N:WSSearchCurrentWord<CR>
132+
nnoremap <silent> <Leader>p :WSGrab p<CR>
133+
nnoremap <silent> <Leader>P :WSGrab P<CR>
134+
endif
135135

136136
endif
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
let g:WorkingSetVersion = "1.0.0"
2+

0 commit comments

Comments
 (0)