Comments (3)
So I have a nice setup like this:
Note: Setting the XDG variables in config.fish basically doesn't really work because it is too late.
If you want to really use them for anything, you'll have to set them outside of fish. Of course here you set them to their defaults, so it doesn't really matter.
In this case I suspect that nvim starts fish with them set to something else, the config snippets are read according to that directory, then your config.fish is read but at that point the snippets are already done.
The snippets are $__fish_config_dir/conf.d/*.fish $__fish_sysconf_dir/conf.d/*.fish $__fish_vendor_confdirs/*.fish
, you can see what you get there with e.g.
set -l snippets $__fish_config_dir/conf.d/*.fish $__fish_sysconf_dir/conf.d/*.fish $__fish_vendor_confdirs/*.fish
echo $snippets
from fish-shell.
In normal terminal I can see both configs being loaded:
In nvim terminal only one is being loaded:
(notice how it loads twice, apparently it's a feature in toggleterm.nvim
. In the default nvim terminal it prints from main cfg
once, but still no aliases)
from fish-shell.
Thank you for your assistance!
Note: Setting the XDG variables in config.fish basically doesn't really work because it is too late.
I only set them there for nvim since fish was using the desired location already. I now set them on the system level so it's consistent (just in case).
the config snippets are read according to that directory, then your config.fish is read
Which surprised me since if snippets are read from another directory, why config is read from the one I want?
The snippets are
$__fish_config_dir/conf.d/*.fish $__fish_sysconf_dir/conf.d/*.fish $__fish_vendor_confdirs/*.fish
, you can see what you get there with
That helped debugging the issue:
- fish can't use windows/mixed paths (probably a msys2 and cygwin issue). For example
set -l snippet $__fish_config_dir/conf.d/*.fish
fails with code 124. So doesls C:/Users/User/.config/fish/conf.d/*.fish
with messagefish: No matches for wildcard
. If I use a unix path, it works. Perhaps fish uses similar code to get and execute the snippets and thus can't find any. - So I tried to use unix paths. However the variables would get overwritten to mixed paths once I'm in nvim terminal. It's probably some extra scripts from nvim which I'm not aware of.
I added the following code to config.fish
:
for var in XDG_DATA_HOME XDG_CONFIG_HOME XDG_CACHE_HOME
set -gx $var $(cygpath -u $$var)
end
and it worked because fish is being executed multiple times from nvim before it opens the terminal. Somewhat hacky, I will research for a proper fix later (maybe run a startup script for fish from nvim).
from fish-shell.
Related Issues (20)
- Almost expansion globbing HOT 4
- can translate the bashrc content to the config.fish HOT 6
- `test -n $nonexistent_variable` succeeds HOT 3
- Feature request: history-word-search-*? HOT 4
- fish refuses to tab autocomplete files for wg-quick command
- Store generated_completions in ~/.cache/fish not ~/.local/share/fish HOT 2
- Unexpected behavior with fish's `-c` option HOT 2
- terminated by signal SIGABRT when completing an environment variable in a string HOT 1
- rustc shell completions broken with recent nightly Rust
- `disown` and `function --on-process-exit` HOT 1
- [information/clarification] Does `block` affect `--on-process-exit`, `--on-job-exit`, `--on-variable` and/or `--on-signal` functions? HOT 5
- Fish-shell command is broken at window line wraps when copied from Windows Terminal or vscode. HOT 1
- Issues with Upgrading and Stabilizing Reverse Shell in Fish Shell HOT 5
- check-completions.fish fails when completion command exists but errors HOT 7
- [vi-mode] bug: incorrect `b` behavior
- [vi-mode] bug: cursor gets misplaced after delete
- Autosuggestions sometimes get accepted without input HOT 11
- Fish doesn't use character classes with Globbing?fish HOT 1
- Cannot set universal variables in `fish --no-config` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fish-shell.