Commit Graph

3822 Commits

Author SHA1 Message Date
Fabian Homborg
4fa17bd512 git prompt: Don't compute bits we don't need 2021-04-13 16:44:46 +02:00
Fabian Homborg
573fed7798 git prompt: Show stagedstate without dirtystate
I have *no idea* why this was coupled, especially since dirtystate can
be expensive, staged state should not be.
2021-04-13 16:44:46 +02:00
Fabian Homborg
71166274a2 git prompt: Respect status_order even without informative status
Fixes #7926.

Also switches the default status order for non-informative to the informative one:

stagedstate invalidstate dirtystate untrackedfiles stashstate

instead of

dirty staged stash untracked
2021-04-13 16:44:46 +02:00
Fabian Homborg
a65933551d git prompt: Allow setting __fish_git_prompt_status_order
See #7926
2021-04-13 16:44:46 +02:00
Fabian Homborg
db7278bac6 git prompt: Remove that massive documentation block 2021-04-13 16:44:46 +02:00
Jason
80b2eb94f1 alias: print error msgs to stderr 2021-04-13 15:50:00 +02:00
Fabian Homborg
053acf5c6b bind ctrl-space only as a *preset* binding
Fixes #7922
2021-04-11 20:39:54 +02:00
Fabian Homborg
16d4424f6c webconfig: Only include path in error if we have one
This makes for a super misleading error message.

See #7917.
2021-04-10 11:53:36 +02:00
Fabian Homborg
4239ba133d Sample prompts: Add a "simple" prompt
This should be a simple prompt that doesn't place a huge strain on the
system but communicates the most important information simply and
effectively.

It should be a good jumping off point for making your own prompt.
2021-04-08 11:14:16 +02:00
Fabian Homborg
d4ce5507af Sample prompts: Rename classic+vcs to default
That's what it is, and without the "classic" prompt to compare it
doesn't make any sense anymore.
2021-04-08 11:14:16 +02:00
Fabian Homborg
34d4afac99 Sample prompts: Remove stray space after pipestatus
This would, with the default color, have an ugly red background.

So just remove the space.
2021-04-08 11:14:16 +02:00
Fabian Homborg
db9ac527af Sample prompts: Rename prompts named after a single person
Unless that person directly contributed the prompt.

We name them after a feature - the Scales prompt feature a ">>>" which
kinda looks like fish scales, the "Arrow" prompt starts with a
prominent "➜".

Naming them after people looks like an endorsement of that particular
person, and like they are someone to look up to, especially when they
aren't involved with the project.

The "terlar" and "acidhub" prompts stay for now because they
contributed the prompt themselves, they are also much less prominent.
2021-04-08 11:14:16 +02:00
Fabian Homborg
635a2c13f1 Sample prompts: Use fish_is_root_user
So we don't just check for "root"
2021-04-08 11:14:16 +02:00
Fabian Homborg
2bc2a92c9a Sample prompts: Stop using "git status" just to see if it is dirty
`git status` will descend the entire repo, which is *slooooow*
2021-04-08 11:14:16 +02:00
Fabian Homborg
31f86ed2cf Sample prompts: Use fish_git_prompt format string 2021-04-08 11:14:16 +02:00
Fabian Homborg
0a395b9568 Sample prompts: Remove default settings from informative vcs prompt
Some of these are just the git prompt defaults anyway, so remove them here.
2021-04-08 11:14:16 +02:00
Fabian Homborg
0586715696 Sample prompts: Remove duplicated or less useful prompts
The "classic" prompts are all just variations on a theme, let's just
keep the default classic+vcs.

"Justadollar" is very unlikely to be what you want and also trivial to
write yourself.

I have no idea what screen_savvy even is for - it reacts to "$WINDOW",
but I don't know anything that even uses that variable.

Lonetwin is just unremarkable, and the debian chroot prompt has one special feature that should be integrated into the other prompts.
2021-04-08 11:14:16 +02:00
exploide
89eeafe393 added completions for firewall-cmd (firewalld)
based on --help and man page of firewall-cmd 0.9.x
2021-04-05 18:59:58 -07:00
Phil Corbett
13439b399e Shortens RPM completions 2021-04-02 12:37:59 -07:00
Fabian Homborg
19004642ba __fish_apropos: Define again on non-macOS
This had a weirdly broken if condition.
2021-04-02 16:58:34 +02:00
Aaron Gyes
b9b2010342 rebuild whatis database weekly, not daily
I still don't think we even address rebuilding
manpage completions yet. Maybe they could share a
solution.
2021-04-02 02:12:00 -07:00
Aaron Gyes
0e03e49eb9 __fish_apropos: prepend $argv with ^
Because macOS' `apropos` is just using grep, and we only need
a prefix match for __fish_describe_command, we can shave off
some ok total execution time here.
2021-04-02 01:58:38 -07:00
Aaron Gyes
85e3381480 __fish_apropos: refactor, limit to 10.15+, change default cache dir.
No longer uses the __fish_apropos hack on every version of macOS.
Juat Catalina+.

The whatis database generated and replaced daily is 2 megabytes on
my computer, and in ~/.cache on a home dir might wind up on a net
mount or something annoying. or, definitely it's backed up by default.

It's wiser to throw that junk in with other cache files on the system
aka DARWIN_USER_CACHE_DIR, and only use the XDG directory if
someone specifically configured that.

Mainly, this just means at least it won't automatically get backed
up by Time Machine and stuff every day, which is no big deal but
y'know...

Rearranged stuff a little to not shell out every time.
2021-04-02 01:58:38 -07:00
Fabian Homborg
419675b9e5 mode_prompt: Use foreground instead of background colors
The default vi mode prompt is kind of ugly, mostly because we include
this `[I]` with a super bright green background and white text,
which is particularly grating because most prompts don't actually have
a background.

So we get a ton of people asking "How do I remove this [I]" when they
could really benefit from having the mode shown.

There's a few ways to make this look nicer, the simplest is to just
keep the same colors but use them as foreground instead of background
colors, which looks much more understated.

The mode prompt is important, but not more than the actual contents of
the commandline, so it shouldn't have ALARMING colors.
2021-03-31 18:04:53 +02:00
Fabian Homborg
f75cf5c16b git prompt: Use status --porcelain for informative status
This allows us to stop descending into untracked directories, which
can be faster.

It's still not *good* - git can still be quite slow here, but if
there's an untracked directory you probably don't care about the
number of files in that.

Fixes #7871.
2021-03-30 17:51:34 +02:00
Fabian Homborg
93ce805f32 help: Update completions
This is all of the sections in interactive, language and for_bash_users.

The faq names are so long that we're not adding them, also not all of
these have descriptions yet.
2021-03-30 17:40:38 +02:00
Fabian Homborg
d5cba5fe12 Teach help to pick the correct page
Given that we no longer have that massive "index" page with
everything, it's become harder to open the correct section
immediately.

So this hardcodes the section titles for each page in help itself.

This was half-automated with

grep -o 'a class="headerlink" href="#[^"]*"' /usr/share/doc/fish/faq.html | sort -u | string replace -r '.*#' '' | string trim -c '"'

The completions still need to be adjusted.
2021-03-30 17:14:14 +02:00
Fabian Homborg
18e332772d functions: Add "--no-details" flag and use it in funced
This inhibits the function path comment which is annoying in `funced`.

Fixes #7879.
2021-03-30 16:54:26 +02:00
lapingenieur
a68791fa89 [vi-mode] corrected normal/default mode pasting
In vim p means paste *after* current character, so go forward a char before pasting.
Also in vim, P means paste *at* current position (like at '|' with cursor = line),
so there's no need to go back a char, just paste it without moving.
2021-03-28 13:28:40 -07:00
Fabian Homborg
1705bd1440 __fish_man_page: Try man before
This is really just `less` being precious and `man` being unspecified.

Fixes #7863.
2021-03-27 09:15:31 +01:00
Kid
61b94fe093
Fix typo in read completion (#7867) 2021-03-26 20:31:03 +01:00
Fabian Homborg
fb7c8c4064 __fish_prepend_sudo: First insert history and then *toggle*
Previously this would only ever insert sudo if it took a commandline
from history, not remove it.

So you would end up with

    sudo sudo apt install
2021-03-26 19:32:14 +01:00
Fabian Homborg
75a4e28e4f Manpage generator: Give better error when we can't understand manpath
This would just say "No paths specified", which is *true*, but then we
typically don't give paths, because we figure out the man path.
2021-03-26 19:32:14 +01:00
Johannes Altmanninger
dc417f58ae completions/aura: remove outdated flag
Commit a0b46e620 ("Update Aura completions") removed "abs", but forgot
it here.

Fixes #7865
2021-03-26 07:49:05 +01:00
Ilan Cosman
bcbfd70d41
Create empty directories and files on interactive startup (#7796)
Closes #7402
2021-03-23 21:01:00 +01:00
Karolina Gontarek
a0f05b376e
Shorten completions for vbc and pydf (#7859) 2021-03-23 20:46:42 +01:00
Jannik Vieten
0f3274d5eb
Fix completion errors for tshark when running as root (#7858) 2021-03-23 20:40:44 +01:00
Johannes Altmanninger
516a70d9cb Misc cleanups
Some as suggested by lgtm.com
2021-03-21 19:41:36 +01:00
Fabian Homborg
95dc821a44 Disable pacman command-not-found handler
Apparently it's too slow on some systems

Fixes #7841.
2021-03-21 10:03:53 +01:00
Olivier FAURE
211f8bc894
Write new completion file for cargo (#7839) 2021-03-20 21:44:38 +01:00
exploide
5eadee61c5 improved SSH completions
- use __fish_complete_ssh also for sftp
- removed old options -1 and -2
- added several newer options
- cleaned up and sorted completion code
2021-03-20 21:17:53 +01:00
Johannes Altmanninger
f9e131aa93 Show an error when "builtin -h" fails to find a man page
Prior to this commit "builtin -h" would silently fail when no
documentation is installed. This happens when running fish without
installing it, or when the docs are not installed.

See #7824
2021-03-15 23:07:08 +01:00
Johannes Altmanninger
582675c96a completions/git: restore forward-compatibility by using "complete -c"
After a fish installation is upgraded to 3.2.0, active shells could
throw an error attempting to load Git completions. It's just a
transient error but also easily avoidable by using the old style.

See #7822
2021-03-15 22:34:30 +01:00
lapingenieur
f95f12f5e7 changed 'rm' to 'command rm'
if rm is aliased to 'rm -i' then rm will ask to delete the cache file after funced edited the file which is anoying
2021-03-15 21:07:39 +01:00
exploide
38cd373ca3 added completions for mkpasswd 2021-03-14 16:46:38 -07:00
Fabian Homborg
3c3bf7ffd7 completions/git: Show recent commits *on all branches* for rebase
Doesn't make a ton of sense for the current branch
2021-03-12 18:12:03 +01:00
Fabian Homborg
873d7f6bb3 completions/git: Add recent commits for rebase
Fixes #7817
2021-03-12 18:10:11 +01:00
Ilya Grigoriev
1a03c23b58 Improve error when help fails to find a browser
Previously, this message told the user to "set $BROWSER and try again". However,
when I first saw this error, I didn't know how I can set `BROWSER` in fish. Moreover,
I often see this error in situations when no browser will work. For instance, I might be
using fish over ssh, and I might either not know whether that system has a text-mode
browser installed or not want to use it.

A further improvement would be to report this message if a browser fails to start.
2021-03-11 18:32:24 +01:00
Fabian Homborg
c23f311956 pythonista prompt: Remove single-argument test 2021-03-11 16:55:17 +01:00
ridiculousfish
7e8b8345e7 Fix some graphical glitches in fish_config
fish_config has some shadows and other elements which don't align
propertly. Fix these, and apply some other miscellaneous polish.

Fixes #7811
2021-03-10 18:46:06 -08:00