Skip to content

Commit dca498c

Browse files
making padding customizable
1 parent a2ddf12 commit dca498c

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

docs/CONFIG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,18 @@ Hide empty plugins
8888
set -g @dracula-show-empty-plugins false
8989
```
9090

91+
Set plugin padding
92+
Whilst the padding is one space per default, can be whatever you want it to be, whether that's whitespace or other characters.
93+
**If you want to remove any padding, you need to use a zero width space!**
94+
95+
```bash
96+
set -g @dracula-left-pad ' ° '
97+
set -g @dracula-right-pad ' ° '
98+
# no padding with zero width space
99+
set -g @dracula-left-pad ''
100+
set -g @dracula-right-pad ''
101+
```
102+
91103
### Powerline - [up](#table-of-contents)
92104

93105
Enable powerline symbols

scripts/dracula.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ main() {
3838
show_ssh_session_port=$(get_tmux_option "@dracula-show-ssh-session-port" false)
3939
show_libreview=$(get_tmux_option "@dracula-show-libreview" false)
4040
show_empty_plugins=$(get_tmux_option "@dracula-show-empty-plugins" true)
41+
left_pad=$(get_tmux_option "@dracula-left-pad" " ")
42+
right_pad=$(get_tmux_option "@dracula-right-pad" " ")
4143

4244
narrow_mode=$(get_tmux_option "@dracula-narrow-mode" false)
4345
if $narrow_mode; then
@@ -361,18 +363,21 @@ main() {
361363
background_color=${powerbg}
362364
fi
363365

366+
# padding
367+
pad_script="$left_pad$script$right_pad"
368+
364369
if $show_powerline; then
365370
if $show_empty_plugins; then
366-
tmux set-option -ga status-right " #[fg=${!colors[0]},bg=${background_color},nobold,nounderscore,noitalics]${right_sep}#[fg=${!colors[1]},bg=${!colors[0]}] $script $right_edge_icon"
371+
tmux set-option -ga status-right " #[fg=${!colors[0]},bg=${background_color},nobold,nounderscore,noitalics]${right_sep}#[fg=${!colors[1]},bg=${!colors[0]}]$pad_script$right_edge_icon"
367372
else
368-
tmux set-option -ga status-right "#{?#{==:$script,},,#[fg=${!colors[0]},nobold,nounderscore,noitalics] ${right_sep}#[fg=${!colors[1]},bg=${!colors[0]}] $script $right_edge_icon}"
373+
tmux set-option -ga status-right "#{?#{==:$script,},,#[fg=${!colors[0]},nobold,nounderscore,noitalics]${right_sep}#[fg=${!colors[1]},bg=${!colors[0]}]$pad_script$right_edge_icon}"
369374
fi
370375
powerbg=${!colors[0]}
371376
else
372377
if $show_empty_plugins; then
373-
tmux set-option -ga status-right "#[fg=${!colors[1]},bg=${!colors[0]}] $script "
378+
tmux set-option -ga status-right "#[fg=${!colors[1]},bg=${!colors[0]}]$pad_script"
374379
else
375-
tmux set-option -ga status-right "#{?#{==:$script,},,#[fg=${!colors[1]},bg=${!colors[0]}] $script }"
380+
tmux set-option -ga status-right "#{?#{==:$script,},,#[fg=${!colors[1]},bg=${!colors[0]}]$pad_script}"
376381
fi
377382
fi
378383

0 commit comments

Comments
 (0)