Browse Source

fish config

pull/1/head
parent
commit
61a6cf420f
5 changed files with 50 additions and 1 deletions
  1. +1
    -1
      tasks/apt.yaml
  2. +15
    -0
      tasks/fish.yaml
  3. +2
    -0
      templates/fish/fish_greeting.fish.j2
  4. +21
    -0
      templates/fish/fish_prompt.fish.j2
  5. +11
    -0
      templates/fish/fish_title.fish.j2

+ 1
- 1
tasks/apt.yaml View File

@@ -4,4 +4,4 @@
apt:
pkg:
- socat
- fish

+ 15
- 0
tasks/fish.yaml View File

@@ -0,0 +1,15 @@
---

- name: fish config directory
file:
path: ~/.config/fish
state: directory

- name: fish config files
template:
src: fish/{{ item }}.fish.j2
dest: ~/.config/fish/{{ item }}.fish
with_items:
- fish_title
- fish_prompt
- fish_greeting

+ 2
- 0
templates/fish/fish_greeting.fish.j2 View File

@@ -0,0 +1,2 @@
# disable greeting
set fish_greeting

+ 21
- 0
templates/fish/fish_prompt.fish.j2 View File

@@ -0,0 +1,21 @@
# target format: user@host:~$
function fish_prompt --description 'prompt'
set -l color_cwd
set -l suffix
switch $USER
case root toor
if set -q fish_color_cwd_root
set color_cwd $fish_color_cwd_root
else
set color_cwd $fish_color_cwd
end
set suffix '#'
case '*'
set color_cwd $fish_color_cwd
set suffix '>'
end

set -g fish_prompt_pwd_dir_length 0

echo -n -s "$USER" @ "$__fish_prompt_hostname" : (set_color $color_cwd) (prompt_pwd) (set_color normal) " $suffix "
end

+ 11
- 0
templates/fish/fish_title.fish.j2 View File

@@ -0,0 +1,11 @@
function fish_title
set -l suffix
switch $USER
case root toor
set suffix '#'
case '*'
set suffix '>'
end

echo -n -s "(prompt_pwd) " $suffix $_"
end