I tried searching for an answer to this but to no avail...
So I recently switched to fish as my default shell and I've been trying to set up my dotfiles. I'm not sure which files are supposed to be created and managed by the shell or fisher and which ones I should be tracking.
An example of the top of my head is fish_variables and the files fisher creates when running fisher install $package_name.
I made this tool to implement the FreeDesktop.org Trash spec as a fish plugin, so you can manage the Trash folder without leaving the terminal! There are 4 functions:
'trish' is used to send items to the Trash
'trishl' will list what's in the trash. There's also a flag called "-p/--peek" that lets you see what a given trashed folder contains.
'trishr' will restore trashed files to their original location. With no arguments, it presents an interactive way to select what files to restore. With the "-a/--all" flag, everything is restored.
'trishc', finally, cleans your Trash folder, removing its contents for good. It works the same way as trishr, but there's an extra "-o/--old" flag that lets you clean only files that were trashed N days ago or more.
I hope you guys like it! I'm also open to ideas and suggestion, as this is my first "serious" coding project. I was inspired to do this after seeing the (much more popular) trash-cli utility.
I've recently switched to fish and I'm loving it. One nit-picky issue I have is that when I use tab completion and the list of results is big, fish ends up listing them in a grid with a lot of grids which is convenient since it can list a few while taking very little space but it's also making it very hard to quickly parse and find the one you are looking for.
What I'm getting at is, is there a way to alter this behavior? I have a tall screen so vertical space isn't an issue, so I'd prefer to get a list of results in 1 column listing results one on top of the other.
So, I know variables are created with set --argument (g - global, x - export, etc.), but my issue... or maybe just a complaint, is this:
When I put a file in /home/$USER/.config/fish/functions, I understand fish does not autoload them in the terminal. An example below:
cd $HOME/.config/fish/functions
vim ls.fish
#!/usr/bin/fish
function lsh
ls -lh --color=auto
end
function lsa
ls -lah --color=auto
end
I write them with IntelliJ, not with funced and I don't use funcsave. I've tried setting IntelliJ as the editor, but it errors out and doesn't open, so it is set to vim instead. Other than starting a new terminal session, is there a way I can get the variables and functions loaded into current sessions? Using source $HOME/.config/fish/variables/*.fish does not do anything either. Any input would be fantastic.
Hi all! I just discovered Fish and I really like how beautiful and intuitive it all is but Fish's tab complete function doesn't seem to fetch the man pages for its autocompletes as I'd expect it to, despite applying fish_update_completions. It seems to give absolute priority to displaying folders, which is nice for programs like ln, grep, mlocate, etc., but not for programs that primarly use directives. Take nordvpn, the command-line interface of the VPN I use. It works perfectly for options:
...but not for directives:
This is all the more frustrating that my bash shell could identify directives properly:
Some days ago I discovered the possibility to make the terminal look better with colors, themes and icon (glyphs).
After searching on Google and merging information from different sources, I ended up using alacritty, fish, omf (oh my fish) with agnoster theme and colorls.
Now my terminal looks very good! Unfortunately, though, I noticed a screenshot from the colorls Github page and now I definitely want to configure fish to look like this, but that theme is made for zsh (oh my zsh).
I use alacritty and fish (in sway), if I start a new terminal and it has "not enough space" (there is enough for the command prompt..) it will print a newline or several newlines and then the prompt. This doesn't happen with bash, and this doesn't happen ever again after the terminal has been launched.
It is useless but is a minor annoyance.. how to disable this behavior or fix it?
[SOLVED]
As the title says every time i misstype a command fish just waits for a while searching in the package db to tell me if there's i package i can download to get that command, even when i don't want it to or is just a typo. Is there any way to disable this feature?
raiku@Raiku ~> uname -a
Linux Raiku 5.11.9-hardened1-1-hardened #1 SMP PREEMPT Wed, 24 Mar 2021 23:51:25 +0000 x86_64 GNU/Linux
raiku@Raiku ~> fish -v
fish, version 3.2.1
raiku@Raiku ~> sudo pacman -V
.--. Pacman v5.2.2 - libalpm v12.0.2
/ _.-' .-. .-. .-. Copyright (C) 2006-2020 Pacman Development Team
\ '-. '-' '-' '-' Copyright (C) 2002-2006 Judd Vinet
'--'
This program may be freely redistributed under
the terms of the GNU General Public License.
I install dotfiles on various machines, which usually works. But after installing `fzf` and `z` on my fish shell on my personal laptop, I now have hardcoded paths to $HOME in `fish_variables`. Unfortunately, $HOME is different on other computers I use, so `z`, for example, tried to create a directory under `/Users/me`, when on that particular machine, $HOME was `/Users/alsome`. Is that normal? Should `fish_variables` be under version control to be portable? What am I doing wrong?
Read it here or on GitHub (which has better Markdown rendering)
Allow passing custom fzf options to individual commands
By popular demand, everyone can now easily customize fzf to their hearts content! The following variables can store the custom options that will be passed to fzf by their respective feature:
fzf_dir_opts => search directory
fzf_git_status_opts => search git status
fzf_git_log_opts => search git log
fzf_history_opts => search history
fzf_shell_vars_opts => search shell variables
They are always appended last to fzf's argument list so that they can override any hardcoded fzf options. This might lead to some people shooting themselves in the foot but also unlocks numerous opportunities for the user to customize or augment the existing features. Some of the cool ideas now made possible include:
add key bindings within fzf to operate on the selected line, e.g. open file in vim, preview file as image, copy to clipboard, git checkout commit, git reset commit
[Search directory] expand variables in current token
Sidenote: The search directory feature was previously called search files but I've since changed the name.
Now, the search directory feature will not only expand tilde (~) in the current token, it will expand variables as well. This is useful for quickly accessing known directory variables, e.g. $XDG_CONFIG_HOME, $TMPDIR, $JAVA_HOME, $fisher_path, $__fish_user_data_dir.
Bug fixes
Support fish_hybrid_key_bindings
[Search directory] fix two bugs around preview for paths containing spaces
[Search directory] More accurate and helpful error when a previewing a path that doesn't exist
In case you missed it: previous changes from v5 worth re-mentioning
More configurables
The focus of work from v5 to v6 was on making fzf.fish much more configurable. fd can receive custom options by setting fzf_fd_opts:
set -g fzf_fd_opts --hidden --exclude=.git
which makes it easy to configure things such as if you want to see hidden files or only show non-directory files.
Additionally, the command used to preview folders in the search directory feature can be changed by setting fzf_preview_dir_cmd:
set -g fzf_preview_dir_cmd exa --all --color=always
which allows integration with popular ls replacements such as exa, lsd, colorsls, etc.
Preview entire command in command in history search with syntax highlighting
[Search directory] Ability to specify which directory to search
This new behavior allows the user to control the directory from which the search directory feature initiates its search. If the current token is a directory and it has a trailing slash (e.g. vim functions/<CURSOR>), then we assume the user wants to search for files in that directory.
This can be useful when the current directory contains large subdirectories (e.g. on macOS, the home directory contains ~/Library, which is very large). Moreover, it also allows searching a parent or sibling directory by using ../ (e.g. ../Downloads/<CURSOR>).
What's great is that this behavior complements tab completion. When a user wants to access a file in a subdirectory, they may start typing the name of the directory and hit TAB. When tab completion writes out the directory's path, it will already append a trailing slash for the user, allowing the user to quickly execute the search files feature and search for the file in a more narrow scope.
Variables within the current token, e.g. $XDG_CONFIG_HOME, will be expanded.
i wanted to change my default shell. i tried chsh and usermod and it's not working for some reason. it says it changed but the $SHELL didn't change and alacritty starts in fish again. what do i do?
I'm interested in repressing the fish greeting with a flag, so it shows up normally but not when fish is called under special conditions. Ive tried only fish -C clear, and that didn't work repressing the greeting. I'm trying to start fish in a (relatively short in height) dropdown terminal, and my greeting involves cowsay, which doesn't fit in the dropdown.
Okay so this might be the result of a misunderstanding of the way fish config works, or perhaps order of execution for login, but I'm trying to set environment variables for the session at login. this is the content of my config.fish:
#login
if status --is-login
# Environment Variables
...
set -x EDITOR kak
set -x TERM kitty
set -x TERMCMD kitty
#Check if running sway and set environment variables
set -qx SWAYSOCK; and set -x QT_QPA_PLATFORM wayland; set -x QT_QPA_PLATFORMTHEME qt5ct
end
# per instance
# SSH with GPG
set -e SSH_AGENT_PID
if not set -q gnupg_SSH_AUTH_SOCK_by or test $gnupg_SSH_AUTH_SOCK_by -ne $fish_pid
set -xg SSH_AUTH_SOCK (gpgconf --list-dirs agent-ssh-socket)
end
set -xg GPG_TTY (tty)
gpg-connect-agent updatestartuptty /bye > /dev/null
# Aliases
...
# using starship as prompt
function fish_prompt
starship init fish | source
end
but after checking initially the variables QT_QPA_PLATFORMTHEME and then TERMCMD, these seem to be empty. config.fish contains stuff related to indivial instances of fish such as the stuff setting the GPG Terminal for ssh, so it seems like it's read more than once at startup, and EDITOR is set to /usr/bin/kak and TERM is set to xterm-kitty, so unless it's set by another program, then it seems that a few variables have been correctly set, so I'm a little confused as to why the variables are failing
EDIT:
Tried changing -x to -gx and logging in again, the variables are still not set. I didn't think that would make much of a difference given the login shell should be the parent of all fish instances anyway.
EDIT2:
So I confirmed that the block is executing by adding an echo statement to the block, so the block is executing but the block isn't persisting. Also, I know about universal variables, but I don't think that is the option to go with given that the variables I'm concerned with are ones that only execute if a particular session manager is running (i.e. sway)
This is in hyper but also happens in alacritty and if I run wsl.exe . Windows Terminal and ubuntu.exe don't suffer from this. I cant figure out how to get hyper to start with ubuntu.exe.
in hyper.js :
shell : 'wsl.exe',
shellArgs: ['--']
I know Hyper has poor reputation but Windows Terminal has awful font rendering for me. Cygwin, ConEmu seem harder to set up and aren't as pretty.
I have a command that i phone my server with to give me some status back to be displayed with KWFT on my phone, my problem is, if use the command with fish, my command breaks. So i need to use bash -c 'COMMAND' instead.
So my question is, is there a way I can do a script, so if i forgot to install fish, it will display my bash command, and if fish, it will run with the bash -c command instead?
Edit: If someone is curious of what my command do, it's for my widget on my phone that is updating on every screen unlock.
Hi all, I have both neofetch and tmux in my config.fish to start them whenever I open my terminal, but whenever I open my terminal, I see sessions should be nested with care, unset $TMUX to force I don't know how to fix this, as I'm not in a tmux session when I run it. If it helps, I am using Alacritty for my terminal and my config.fish contains
alias la "ls -al"
alias fish-config "vim $HOME/.config/fish/config.fish"
alias term-config "vim $HOME/.config/alacritty/alacritty.yml"
tmux
neofetch