You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+62-18
Original file line number
Diff line number
Diff line change
@@ -29,55 +29,99 @@ Plug 'segeljakt/vim-silicon'
29
29
30
30
# Commands
31
31
32
-
The available commands are `Silicon`, and `SiliconHighlight`:
32
+
This plugin provides a single command `Silicon`:
33
33
34
34
```vim
35
35
" Generate an image of the current buffer and write it to /path/to/output.png
36
36
:Silicon /path/to/output.png
37
37
38
+
" Generate an image of the current buffer and write it to /path/to/output.png and clipboard.
39
+
:Silicon /path/to/output.png --to-clipboard
40
+
38
41
" Generate an image of the current buffer and write it to /path/to/<filename>.png
39
42
:Silicon /path/to/
40
43
41
44
" Generate an image of the current visual line selection and write it to /path/to/output.png
42
45
:'<,'>Silicon /path/to/output.png
43
46
44
47
" Generate an image of the current buffer, with the current visual line selection highlighted.
45
-
:'<,'>SiliconHighlight /path/to/output.png
48
+
:'<,'>Silicon! /path/to/output.png
46
49
```
47
50
48
-
If no `/path/to/output.png` is specified, then the generated image is copied to clipboard. However, this feature is only supported on Linux at the moment.
49
-
50
51
# Options
51
52
52
53
This is the default configuration:
53
54
54
55
```vim
55
56
let g:silicon = {
56
-
\ 'theme': 'Dracula',
57
-
\ 'font': 'Hack',
58
-
\ 'background': '#aaaaff',
59
-
\ 'shadow-color': '#555555',
60
-
\ 'line-pad': 2,
61
-
\ 'pad-horiz': 80,
62
-
\ 'pad-vert': 100,
63
-
\ 'shadow-blur-radius': 0,
64
-
\ 'shadow-offset-x': 0,
65
-
\ 'shadow-offset-y': 0,
66
-
\ 'line-number': v:true,
67
-
\ 'round-corner': v:true,
68
-
\ 'window-controls': v:true,
69
-
\ 'default-file-pattern' '',
57
+
\ 'theme': 'Dracula',
58
+
\ 'font': 'Hack',
59
+
\ 'background': '#AAAAFF',
60
+
\ 'shadow-color': '#555555',
61
+
\ 'line-pad': 2,
62
+
\ 'pad-horiz': 80,
63
+
\ 'pad-vert': 100,
64
+
\ 'shadow-blur-radius': 0,
65
+
\ 'shadow-offset-x': 0,
66
+
\ 'shadow-offset-y': 0,
67
+
\ 'line-number': v:true,
68
+
\ 'round-corner': v:true,
69
+
\ 'window-controls': v:true,
70
70
\ }
71
71
```
72
72
73
+
Images are by default saved to the working directory with a unique filename,
74
+
you can change this filepath by setting:
75
+
76
+
```vim
77
+
let g:silicon['output'] = '~/images/silicon-{time:%Y-%m-%d-%H%M%S}.png'
78
+
```
79
+
73
80
To get the list of available themes, you can run this in the terminal:
74
81
75
82
```sh
76
83
silicon --list-themes
77
84
```
78
85
86
+
Silicon internally uses [`bat`'s](https://github.com/sharkdp/bat) themes and syntaxes. To get the list of supported languages, you could:
87
+
88
+
```sh
89
+
cargo install bat
90
+
bat --list-languages
91
+
```
92
+
79
93
For more details about options, see https://github.com/Aloxaf/silicon.
80
94
95
+
## Advanced Configuration
96
+
97
+
Instead of assigning values to flags in g:silicon, you can assign functions which expand into values right before generating the images.
98
+
99
+
For example, to save images into different directories depending on whether you are at work or not:
0 commit comments