File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -127,9 +127,20 @@ See the [null-ls documentation](https://github.com/jose-elias-alvarez/null-ls.nv
127127
128128### Vim
129129
130- 1 . Run ` cargo build --release `
131- 2 . Add ` source /path/to/rubyfmt.vim ` to your ` ~/.vimrc `
132- 3 . Add ` let g:rubyfmt_path = /path/to/target/release/rubyfmt-main ` beneath the source line
130+ vim-plug:
131+
132+ ``` vim
133+ Plug 'fables-tales/rubyfmt', { 'rtp': 'editor_plugins/vim' }
134+ ```
135+
136+ Native packages:
137+
138+ ``` sh
139+ git clone https://github.com/fables-tales/rubyfmt ~ /.rubyfmt
140+ ln -s ~ /.rubyfmt/editor_plugins/vim ~ /.vim/pack/rubyfmt/start/rubyfmt
141+ ```
142+
143+ Set ` g:rubyfmt_path ` if ` rubyfmt ` is not on your ` $PATH ` .
133144
134145### RubyMine (and JetBrains IDEs)
135146
Original file line number Diff line number Diff line change 11let s: cpo_save = &cpo
22set cpo &vim
33
4- let g: rubyfmt_path = ' /Users/penelope/dev/rubyfmt/target/release/rubyfmt-main'
5-
64function ! rubyfmt#format () abort
75 let l: bin_args = [g: rubyfmt_path , ' -i' ]
86 let l: curw = winsaveview ()
@@ -69,10 +67,5 @@ function! rubyfmt#show_errors(errors) abort
6967 echom a: errors
7068endfunction
7169
72- if ! exists (" s:rubyfmt_ac_set" )
73- let s: rubyfmt_ac_set= 1
74- autocmd FileType ruby autocmd ! BufWritePre <buffer> call rubyfmt#format ()
75- endif
76-
7770let &cpo = s: cpo_save
7871unlet s: cpo_save
Original file line number Diff line number Diff line change 1+ if exists (' g:loaded_rubyfmt' )
2+ finish
3+ endif
4+ let g: loaded_rubyfmt = 1
5+
6+ let s: cpo_save = &cpo
7+ set cpo &vim
8+
9+ " Path to the rubyfmt binary. Defaults to whatever is on $PATH; override in
10+ " your vimrc, e.g. let g:rubyfmt_path = '/path/to/target/release/rubyfmt-main'
11+ if ! exists (' g:rubyfmt_path' )
12+ let g: rubyfmt_path = ' rubyfmt'
13+ endif
14+
15+ if ! exists (" s:rubyfmt_ac_set" )
16+ let s: rubyfmt_ac_set= 1
17+ autocmd FileType ruby autocmd ! BufWritePre <buffer> call rubyfmt#format ()
18+ endif
19+
20+ let &cpo = s: cpo_save
21+ unlet s: cpo_save
You can’t perform that action at this time.
0 commit comments