Skip to content

Commit a640094

Browse files
committed
chore(lint): fish_indent
Signed-off-by: Ismo Vuorinen <[email protected]>
1 parent 5ec8e89 commit a640094

File tree

5 files changed

+111
-69
lines changed

5 files changed

+111
-69
lines changed

.editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ max_line_length = 100
1414
[*.lua]
1515
max_line_length = 120
1616

17-
[*.php]
17+
[*.{php,fish}]
1818
indent_size = 4
1919

2020
[.git{ignore,modules}]

.pre-commit-config.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,9 @@ repos:
5757
rev: v2.0.2
5858
hooks:
5959
- id: stylua # or stylua-system / stylua-github
60+
61+
- repo: https://github.com/hugoh/pre-commit-fish.git
62+
rev: v1.2
63+
hooks:
64+
- id: fish_syntax
65+
- id: fish_indent

config/fish/alias.fish

+81-45
Original file line numberDiff line numberDiff line change
@@ -3,70 +3,106 @@
33
alias vim='vim -u "$XDG_CONFIG_HOME/vim/vimrc"'
44

55
# eza aliases if eza is installed
6-
if type -q eza > /dev/null
7-
8-
function eza_git -d "Use eza and its git options if in a git repo"
9-
if git rev-parse --is-inside-work-tree &>/dev/null
10-
eza --group-directories-first --icons=always --smart-group --git $argv
11-
else
12-
eza --group-directories-first --icons=always --smart-group $argv
13-
end
14-
end
15-
16-
function lsa --wraps='eza_git -al' --description 'eza -al'
17-
eza_git -al $argv
18-
end
19-
20-
function ls --wraps='eza_git' --description 'eza'
21-
eza_git $argv
22-
end
23-
24-
function ll --wraps='eza_git -l' --description 'eza -l'
25-
eza_git -l $argv
26-
end
27-
28-
function l --wraps='eza_git' --description 'eza'
29-
eza_git $argv
30-
end
6+
if type -q eza >/dev/null
7+
function eza_git -d "Use eza and its git options if in a git repo"
8+
if git rev-parse --is-inside-work-tree &>/dev/null
9+
eza --group-directories-first --icons=always --smart-group --git $argv
10+
else
11+
eza --group-directories-first --icons=always --smart-group $argv
12+
end
13+
end
14+
15+
function lsa --wraps='eza_git -al' --description 'eza -al'
16+
eza_git -al $argv
17+
end
18+
19+
function ls --wraps='eza_git' --description eza
20+
eza_git $argv
21+
end
22+
23+
function ll --wraps='eza_git -l' --description 'eza -l'
24+
eza_git -l $argv
25+
end
26+
27+
function l --wraps='eza_git' --description eza
28+
eza_git $argv
29+
end
3130
end
3231

3332
# Edit fish alias file
34-
function .a --wraps='nvim ~/.dotfiles/config/fish/alias.fish' --description 'alias .a=nvim ~/.dotfiles/config/fish/alias.fish'
35-
nvim ~/.dotfiles/config/fish/alias.fish $argv
36-
33+
function .a --wraps='nvim ~/.dotfiles/config/fish/alias.fish' --description 'edit alias.fish'
34+
nvim ~/.dotfiles/config/fish/alias.fish $argv
3735
end
3836

3937
# Go to the directory where my projects are stored
4038
function .c --wraps='cd ~/Code' --description 'cd ~/Code'
41-
cd ~/Code $argv
42-
39+
cd ~/Code $argv
4340
end
4441

4542
# Go to the directory where the dotfiles are stored
4643
function .d --wraps='cd ~/.dotfiles' --description 'cd ~/.dotfiles'
47-
cd ~/.dotfiles $argv
48-
44+
cd ~/.dotfiles $argv
4945
end
5046

47+
# Go to the directory where my work codes are stored
5148
function .s --wraps='cd ~/Code/s' --description 'cd ~/Code/s'
52-
cd ~/Code/s $argv
49+
cd ~/Code/s $argv
50+
end
5351

52+
# Go to the directory where my personal codes are stored
53+
function .p --wraps='cd ~/Code/ivuorinen' --description 'cd ~/Code/ivuorinen'
54+
cd ~/Code/ivuorinen $argv
5455
end
5556

5657
# shortcut to commit with a message
5758
function commit --wraps='git commit -a -m "chore: automated commit"' --description 'commit shortcut'
58-
set -l commitMessage $argv
59-
git add .
60-
61-
if test -z "$commitMessage"
62-
if type -q aicommits
63-
aicommits --type conventional
64-
else
65-
git commit -a -m "chore: automated commit"
59+
set -l commitMessage $argv
60+
git add .
61+
62+
if test -z "$commitMessage"
63+
if type -q aicommits
64+
aicommits --type conventional
65+
else
66+
git commit -a -m "chore: automated commit"
67+
end
68+
return
6669
end
67-
return
68-
end
6970

70-
git commit -a -m "$commitMessage"
71-
end
71+
git commit -a -m "$commitMessage"
72+
end
73+
74+
function configure_tide --description 'Configure tide with the lean style and my preferences'
75+
tide configure \
76+
--auto \
77+
--style=Lean \
78+
--prompt_colors='True color' \
79+
--show_time=No \
80+
--lean_prompt_height='Two lines' \
81+
--prompt_connection=Disconnected \
82+
--prompt_spacing=Sparse \
83+
--icons='Many icons' \
84+
--transient=Yes
85+
end
7286

87+
# Abbreviations for git
88+
abbr --add gau git add -u
89+
abbr --add gaa git add -A
90+
abbr --add gcv git commit -v
91+
92+
# Abbreviations for composer
93+
abbr --add c composer
94+
abbr --add cu composer update
95+
abbr --add ci composer install
96+
97+
# Abbreviations for php artisan
98+
abbr --add .pa php artisan
99+
abbr --add .paf php artisan fresh
100+
abbr --add .pam php artisan migrate
101+
abbr --add .pams php artisan migrate --seed
102+
abbr --add .pat php artisan test
103+
104+
# Abbreviations for npm
105+
abbr --add .n npm
106+
abbr --add .nt npm test --if-present
107+
abbr --add .nb npm run build --if-present
108+
abbr --add .ns npm run start --if-present

config/fish/config.fish

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
# ╰──────────────────────────────────────────────────────────╯
44

55
test -e "$HOME/.config/fish/alias.fish" &&
6-
source "$HOME/.config/fish/alias.fish"
6+
source "$HOME/.config/fish/alias.fish"
77

88
test -e "$HOME/.config/fish/exports.fish" &&
9-
source "$HOME/.config/fish/exports.fish"
9+
source "$HOME/.config/fish/exports.fish"
1010

1111
if status is-interactive
1212
# Commands to run in interactive sessions can go here

config/fish/exports.fish

+21-21
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ set -q XDG_RUNTIME_DIR; or set -x XDG_RUNTIME_DIR "$HOME/.local/run"
1212
set -q DOTFILES; or set -x DOTFILES "$HOME/.dotfiles"
1313

1414
# Editor settings
15-
set -q EDITOR; or set -x EDITOR "nvim"
16-
set -q VISUAL; or set -x VISUAL "code"
15+
set -q EDITOR; or set -x EDITOR nvim
16+
set -q VISUAL; or set -x VISUAL code
1717
set -q HOSTNAME; or set -x HOSTNAME (hostname -s)
1818

1919
# Add local bin to path
@@ -58,19 +58,19 @@ set -q AWS_CONFIG_FILE; or set -x AWS_CONFIG_FILE "$XDG_STATE_HOME/aws/config"
5858
set -q AWS_SHARED_CREDENTIALS_FILE; or set -x AWS_SHARED_CREDENTIALS_FILE "$XDG_STATE_HOME/aws/credentials"
5959
set -q AWS_SESSION_TOKEN; or set -x AWS_SESSION_TOKEN "$XDG_STATE_HOME/aws/session_token"
6060
set -q AWS_DATA_PATH; or set -x AWS_DATA_PATH "$XDG_DATA_HOME/aws"
61-
set -q AWS_DEFAULT_OUTPUT; or set -x AWS_DEFAULT_OUTPUT "table"
62-
set -q AWS_CONFIGURE_KEYS; or set -x AWS_CONFIGURE_KEYS "true"
63-
set -q AWS_CONFIGURE_SESSION; or set -x AWS_CONFIGURE_SESSION "true"
64-
set -q AWS_CONFIGURE_SESSION_DURATION; or set -x AWS_CONFIGURE_SESSION_DURATION "7200"
65-
set -q AWS_CONFIGURE_SESSION_MFA; or set -x AWS_CONFIGURE_SESSION_MFA "true"
66-
set -q AWS_CONFIGURE_PROFILE; or set -x AWS_CONFIGURE_PROFILE "true"
67-
set -q AWS_CONFIGURE_PROMPT; or set -x AWS_CONFIGURE_PROMPT "true"
68-
set -q AWS_CONFIGURE_PROMPT_DEFAULT; or set -x AWS_CONFIGURE_PROMPT_DEFAULT "true"
61+
set -q AWS_DEFAULT_OUTPUT; or set -x AWS_DEFAULT_OUTPUT table
62+
set -q AWS_CONFIGURE_KEYS; or set -x AWS_CONFIGURE_KEYS true
63+
set -q AWS_CONFIGURE_SESSION; or set -x AWS_CONFIGURE_SESSION true
64+
set -q AWS_CONFIGURE_SESSION_DURATION; or set -x AWS_CONFIGURE_SESSION_DURATION 7200
65+
set -q AWS_CONFIGURE_SESSION_MFA; or set -x AWS_CONFIGURE_SESSION_MFA true
66+
set -q AWS_CONFIGURE_PROFILE; or set -x AWS_CONFIGURE_PROFILE true
67+
set -q AWS_CONFIGURE_PROMPT; or set -x AWS_CONFIGURE_PROMPT true
68+
set -q AWS_CONFIGURE_PROMPT_DEFAULT; or set -x AWS_CONFIGURE_PROMPT_DEFAULT true
6969

7070
# Brew configuration
71-
set -q HOMEBREW_NO_ANALYTICS; or set -x HOMEBREW_NO_ANALYTICS "true"
72-
set -q HOMEBREW_NO_ENV_HINTS; or set -x HOMEBREW_NO_ENV_HINTS "true"
73-
set -q HOMEBREW_BUNDLE_MAS_SKIP; or set -x HOMEBREW_BUNDLE_MAS_SKIP "true"
71+
set -q HOMEBREW_NO_ANALYTICS; or set -x HOMEBREW_NO_ANALYTICS true
72+
set -q HOMEBREW_NO_ENV_HINTS; or set -x HOMEBREW_NO_ENV_HINTS true
73+
set -q HOMEBREW_BUNDLE_MAS_SKIP; or set -x HOMEBREW_BUNDLE_MAS_SKIP true
7474
set -q HOMEBREW_BUNDLE_FILE; or set -x HOMEBREW_BUNDLE_FILE "$XDG_CONFIG_HOME/homebrew/Brewfile"
7575

7676
# Composer configuration
@@ -84,8 +84,8 @@ set -q DIRENV_LOG_FORMAT; or set -x DIRENV_LOG_FORMAT ''
8484
# Docker configuration
8585
set -q DOCKER_CONFIG; or set -x DOCKER_CONFIG "$XDG_CONFIG_HOME/docker"
8686
x-dc "$DOCKER_CONFIG"
87-
set -q DOCKER_HIDE_LEGACY_COMMANDS; or set -x DOCKER_HIDE_LEGACY_COMMANDS "true"
88-
set -q DOCKER_SCAN_SUGGEST; or set -x DOCKER_SCAN_SUGGEST "false"
87+
set -q DOCKER_HIDE_LEGACY_COMMANDS; or set -x DOCKER_HIDE_LEGACY_COMMANDS true
88+
set -q DOCKER_SCAN_SUGGEST; or set -x DOCKER_SCAN_SUGGEST false
8989

9090
# fzf configuration
9191
set -q FZF_BASE; or set -x FZF_BASE "$XDG_CONFIG_HOME/fzf"
@@ -113,7 +113,7 @@ set -q WORKON_HOME; or set -x WORKON_HOME "$XDG_DATA_HOME/virtualenvs"
113113
set -q PYENV_ROOT; or set -x PYENV_ROOT "$XDG_DATA_HOME/pyenv"
114114
fish_add_path "$PYENV_ROOT/bin"
115115
if x-have pyenv; and not functions -q pyenv
116-
status --is-interactive; and source (pyenv init - | psub)
116+
status --is-interactive; and source (pyenv init - | psub)
117117
end
118118

119119
# Poetry configuration
@@ -151,7 +151,7 @@ set -q TMUX_PLUGIN_MANAGER_PATH; or set -x TMUX_PLUGIN_MANAGER_PATH "$TMUX_PLUGI
151151

152152
# Source tmux theme activation script for Fish shell
153153
if test -f "$DOTFILES/config/tmux/theme-activate.fish"
154-
source "$DOTFILES/config/tmux/theme-activate.fish"
154+
source "$DOTFILES/config/tmux/theme-activate.fish"
155155
end
156156

157157
# tms configuration
@@ -162,20 +162,20 @@ set -q WAKATIME_HOME; or set -x WAKATIME_HOME "$XDG_STATE_HOME/wakatime"
162162
x-dc "$WAKATIME_HOME"
163163

164164
# Miscellaneous configuration
165-
set -q CHEAT_USE_FZF; or set -x CHEAT_USE_FZF "true"
165+
set -q CHEAT_USE_FZF; or set -x CHEAT_USE_FZF true
166166
set -q SQLITE_HISTORY; or set -x SQLITE_HISTORY "$XDG_CACHE_HOME/sqlite/sqlite_history"
167167

168168
# Source additional configuration files if they exist
169169
if test -f "$DOTFILES/config/fish/exports-secret.fish"
170-
source "$DOTFILES/config/fish/exports-secret.fish"
170+
source "$DOTFILES/config/fish/exports-secret.fish"
171171
end
172172

173173
if test -f "$DOTFILES/hosts/$HOSTNAME/config/fish/exports.fish"
174-
source "$DOTFILES/hosts/$HOSTNAME/config/fish/exports.fish"
174+
source "$DOTFILES/hosts/$HOSTNAME/config/fish/exports.fish"
175175
end
176176

177177
if test -f "$DOTFILES/hosts/$HOSTNAME/config/fish/exports-secret.fish"
178-
source "$DOTFILES/hosts/$HOSTNAME/config/fish/exports-secret.fish"
178+
source "$DOTFILES/hosts/$HOSTNAME/config/fish/exports-secret.fish"
179179
end
180180

181181
# Configure tide prompt

0 commit comments

Comments
 (0)