Skip to content

Commit 132b6a1

Browse files
author
Ravi Singh
committed
Rename to plantumlit & update plantuml.jar
1 parent cbf5a01 commit 132b6a1

File tree

4 files changed

+31
-35
lines changed

4 files changed

+31
-35
lines changed

README.md

+9-14
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
1-
```
2-
███████╗██╗ ██╗ ██╗███╗ ███╗██╗ ██████╗ ██████╗ ██████╗
3-
██╔════╝██║ ██║ ██║████╗ ████║██║ ██╔═══██╗██╔══██╗██╔══██╗
4-
███████╗██║ ██║ ██║██╔████╔██║██║ ██║ ██║██████╔╝██║ ██║
5-
╚════██║██║ ██║ ██║██║╚██╔╝██║██║ ██║ ██║██╔══██╗██║ ██║
6-
███████║███████╗╚██████╔╝██║ ╚═╝ ██║███████╗╚██████╔╝██║ ██║██████╔╝
7-
╚══════╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝╚═════╝
8-
```
1+
*PlantUMLIt
2+
3+
94

105
Introduction
116
============
127

13-
Slumlord is built atop the wang-hardeningly awesome [plantuml](http://plantuml.com).
8+
plantumlit (PlantUML Inline Text) is built atop the wang-hardeningly awesome [plantuml](http://plantuml.com).
149
It gives you a "live preview" of your UML diagrams when you save.
1510

16-
![Demo](https://github.com/scrooloose/vim-slumlord/raw/master/_assets/demo.gif)
11+
![Demo](https://github.com/rsinghgit/vim-plantumlit/raw/master/_assets/demo.gif)
1712

1813

1914
Installation
@@ -23,17 +18,17 @@ First you need Java installed.
2318

2419
Then, install this plugin with your favourite vim plugin manager.
2520

26-
For [vundle](https://github.com/VundleVim/Vundle.vim), just stick this in your
21+
For [Vim Plug](https://github.com/junegunn/vim-plug), just stick this in your
2722
vimrc and smoke it:
2823

2924
```
30-
Plugin 'scrooloose/vim-slumlord'
25+
Plug 'rsinghgit/vim-plantumlit'
3126
```
3227

33-
Then run `:Vundle install`
28+
Then run `:PlugInstall`
3429

3530
I also recommend installing the
36-
[plantuml-syntax](https://github.com/aklt/plantuml-syntax) plugin as Slumlord
31+
[plantuml-syntax](https://github.com/aklt/plantuml-syntax) plugin as plantumlit
3732
uses this for its syntax file.
3833

3934
```

autoload/slumlord.vim renamed to autoload/plantumlit.vim

+18-17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
" PlantUML Live Preview for ascii/unicode art
2+
" @Updater: Ravi Singh
23
" @Author: Martin Grenfell <[email protected]>
34
" @Date: 2018-12-07 13:00:22
45
" @Last Modified by: Tsuyoshi CHO <[email protected]>
@@ -7,21 +8,21 @@
78
" PlantUML preview plugin core
89

910
" Intro {{{1
10-
if exists("g:autoloaded_slumlord")
11+
if exists("g:autoloaded_plantumlit")
1112
finish
1213
endif
13-
let g:autoloaded_slumlord = 1
14+
let g:autoloaded_plantumlit = 1
1415

1516
let s:save_cpo = &cpo
1617
set cpo&vim
1718

1819
" variable {{{1
19-
let g:slumlord_plantuml_jar_path = get(g:, 'slumlord_plantuml_jar_path', expand("<sfile>:p:h") . "/../plantuml.jar")
20-
let g:slumlord_plantuml_include_path = get(g:, 'slumlord_plantuml_include_path', expand("~/.config/plantuml/include/"))
21-
let g:slumlord_asciiart_utf = get(g:, 'slumlord_asciiart_utf', 1)
20+
let g:plantumlit_plantuml_jar_path = get(g:, 'plantumlit_plantuml_jar_path', expand("<sfile>:p:h") . "/../plantuml.jar")
21+
let g:plantumlit_plantuml_include_path = get(g:, 'plantumlit_plantuml_include_path', expand("~/.config/plantuml/include/"))
22+
let g:plantumlit_asciiart_utf = get(g:, 'plantumlit_asciiart_utf', 1)
2223

2324
" function {{{1
24-
function! slumlord#updatePreview(args) abort
25+
function! plantumlit#updatePreview(args) abort
2526
if !s:shouldInsertPreview()
2627
return
2728
end
@@ -30,16 +31,16 @@ function! slumlord#updatePreview(args) abort
3031

3132
let type = 'utxt'
3233
let ext = 'utxt'
33-
if !g:slumlord_asciiart_utf
34+
if !g:plantumlit_asciiart_utf
3435
let type = 'txt'
3536
let ext = 'atxt'
3637
endif
3738

3839
let tmpfname = tempname()
3940
call s:mungeDiagramInTmpFile(tmpfname)
40-
let b:slumlord_preview_fname = fnamemodify(tmpfname, ':r') . '.' . ext
41+
let b:plantumlit_preview_fname = fnamemodify(tmpfname, ':r') . '.' . ext
4142

42-
let cmd = "java -Dapple.awt.UIElement=true -Dplantuml.include.path=\"". g:slumlord_plantuml_include_path ."\" -splash: -jar ". g:slumlord_plantuml_jar_path ." -charset ". charset ." -t" . type ." ". tmpfname
43+
let cmd = "java -Dapple.awt.UIElement=true -Dplantuml.include.path=\"". g:plantumlit_plantuml_include_path ."\" -splash: -jar ". g:plantumlit_plantuml_jar_path ." -charset ". charset ." -t" . type ." ". tmpfname
4344

4445
let write = has_key(a:args, 'write') && a:args["write"] == 1
4546
if exists("*jobstart")
@@ -160,7 +161,7 @@ function! s:InPlaceUpdater.update(args) abort
160161
let startCol = col(".")
161162

162163
call self.__deletePreviousDiagram()
163-
call self.__insertDiagram(b:slumlord_preview_fname)
164+
call self.__insertDiagram(b:plantumlit_preview_fname)
164165
call s:addTitle()
165166

166167
call cursor(line("$") - (lastLine - startLine), startCol)
@@ -196,7 +197,7 @@ endfunction
196197
" WinUpdater object {{{1
197198
let s:WinUpdater = {}
198199
function! s:WinUpdater.update(args) abort
199-
let fname = b:slumlord_preview_fname
200+
let fname = b:plantumlit_preview_fname
200201
call self.__moveToWin()
201202
%d
202203

@@ -215,11 +216,11 @@ function! s:WinUpdater.update(args) abort
215216
endfunction
216217

217218
function s:WinUpdater.__moveToWin() abort
218-
if exists("b:slumlord_bnum") && bufexists(b:slumlord_bnum)
219-
if bufwinnr(b:slumlord_bnum) != -1
220-
exec bufwinnr(b:slumlord_bnum) . "wincmd w"
219+
if exists("b:plantumlit_bnum") && bufexists(b:plantumlit_bnum)
220+
if bufwinnr(b:plantumlit_bnum) != -1
221+
exec bufwinnr(b:plantumlit_bnum) . "wincmd w"
221222
else
222-
exec b:slumlord_bnum . "sb"
223+
exec b:plantumlit_bnum . "sb"
223224
endif
224225
else
225226
let prev_bnum = bufnr("")
@@ -228,7 +229,7 @@ function s:WinUpdater.__moveToWin() abort
228229
setlocal bufhidden=wipe
229230
setlocal noswapfile
230231
setlocal textwidth=0 " avoid automatic line break
231-
call setbufvar(prev_bnum, "slumlord_bnum", bufnr(""))
232+
call setbufvar(prev_bnum, "plantumlit_bnum", bufnr(""))
232233
call self.__setupWinOpts()
233234
endif
234235
endfunction
@@ -259,7 +260,7 @@ endfunction
259260

260261

261262
" other shit {{{1
262-
if exists("g:slumlord_separate_win") && g:slumlord_separate_win
263+
if exists("g:plantumlit_separate_win") && g:plantumlit_separate_win
263264
let s:updater = s:WinUpdater
264265
else
265266
let s:updater = s:InPlaceUpdater

ftplugin/plantuml.vim

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
" PlantUML Filetype preview kick
88

99
" Intro {{{1
10-
if exists("b:loaded_slumlord")
10+
if exists("b:loaded_plantumlit")
1111
finish
1212
endif
13-
let b:loaded_slumlord=1
13+
let b:loaded_plantumlit=1
1414

1515
let s:save_cpo = &cpo
1616
set cpo&vim
@@ -19,9 +19,9 @@ set cpo&vim
1919
setlocal nowrap
2020

2121
" autocmd {{{1
22-
augroup slumlord
22+
augroup plantumlit
2323
autocmd!
24-
autocmd BufWritePre * if &ft =~ 'plantuml' | silent call slumlord#updatePreview({'write': 1}) | endif
24+
autocmd BufWritePre * if &ft =~ 'plantuml' | silent call plantumlit#updatePreview({'write': 1}) | endif
2525
augroup END
2626

2727
" Outro {{{1

plantuml.jar

2.77 MB
Binary file not shown.

0 commit comments

Comments
 (0)