Commit graph

194 commits

Author SHA1 Message Date
Jonathan Hodgson
8e9073bd2d Merge branch 'master' of ssh://git.jonathanh.co.uk/jab2870/Dotfiles 2024-04-25 14:05:15 +01:00
Jonathan Hodgson
d2cf4c7f55 Adds uppercase versions of env variables to proxy-on command 2024-04-25 14:03:54 +01:00
Jonathan Hodgson
57125ea128 Merge branch 'master' of ssh://git.jonathanh.co.uk/jab2870/Dotfiles 2024-02-22 21:22:29 +00:00
Jonathan Hodgson
131d693fd8 zsh tweaks 2024-02-22 21:20:53 +00:00
Jonathan Hodgson
e113ed3992 adds noclobber and interactive comments 2024-02-19 07:03:44 +00:00
Jonathan Hodgson
89dbb2fccf Tweaks to zsh 2024-02-19 07:01:26 +00:00
Jonathan Hodgson
285165913d Adds / tweaks a bunch of scripts 2024-02-18 19:30:08 +00:00
Jonathan Hodgson
1da86fb3a5 Overide some clompletions 2023-12-24 12:07:48 +00:00
Jonathan Hodgson
be4fbe17c3 Current word completion - add regexes 2023-12-24 12:06:17 +00:00
Jonathan Hodgson
993f76534d makes https complete as http 2023-12-24 12:05:58 +00:00
Jonathan Hodgson
6fa3f737e2 Work on openapi completion
Currently still a work in progress.

the bin/.bin/openapi file will be a bash script for interfacing with an
openapi file. Currently it does things like listing requests, servers,
and viewing a request in json format.

The function added to fzf.zsh adds a zsh widget so that I can press a
keybinding (in my case ^o) to complete the command. It uses the above
script and fzf to make the selection. Currently supports http / https /
curl

The widget looks for an environment variable called OPENAPI which should
point to the openapi file. This is set in zshrc if a project is set.
2022-10-04 11:42:47 +01:00
Jonathan Hodgson
a4b749ded5 Completion: improves the completion of encrypt and decrypt functions 2022-07-28 11:25:09 +01:00
Jonathan Hodgson
27f641996d Check program exists before adding grc alias 2022-02-20 14:35:02 +00:00
Jonathan Hodgson
b964dfb23f Updates zsh-syntax highlighting 2022-02-20 14:34:31 +00:00
Jonathan Hodgson
063ffb3da2 Makes fzf list packages for paru on tab 2022-02-20 14:32:33 +00:00
Jonathan Hodgson
5809254253 Removes auto-expand 2022-02-07 12:33:20 +00:00
Jonathan Hodgson
58fe21a0c0 Updates gpg alias 2022-02-07 12:32:02 +00:00
Jonathan Hodgson
313198d18f Update zsh plugins 2022-02-07 12:26:21 +00:00
Jonathan Hodgson
2e38dbc611 Adds auto-expand to some of my aliases
Heavily inspired by this: https://dev.to/frost/fish-style-abbreviations-in-zsh-40aa

When space is pushed, zsh will try to expand any aliases that I have put
in the array in this file.

It is currently quite basic, only looking at the first word on the
command line.
2021-11-28 20:58:16 +00:00
Jonathan Hodgson
56395b71f1 Changes double shift action
Previously, pushing both shift keys would switch the layout between
colemak and qwerty. However, I never use qwerty now so have changed it
so that double shift now toggles capslock. The capslock key remains
bound to backspace as is default in colemak
2021-11-25 12:30:22 +00:00
Jonathan Hodgson
c9d1320b54 Adds sudo writes to nvim
If in nvim and the SUDO_ASKPASS environment variable is set then a WW
mapping will expand to

:w !sudo -A tee % >/dev/null

If in not-neo vim, the -A is omitted.

The environment variable is also set. Some unused environment variables
were also removed.

https://stackoverflow.com/questions/2600783/how-does-the-vim-write-with-sudo-trick-work
https://github.com/neovim/neovim/issues/12103
2021-11-16 14:29:20 +00:00
Jonathan Hodgson
52eb406676 FZF: adds git bindings and toggle preview
I have added a default binging of ctrl+/ to toggle the preview in fzf

I have added some git key bindings for git stuff. They are all in the
form with ctrl+g ctrl+<something>. Most are what they want, for example
branches are ctrl+g ctrl+b however commits are not. I assume this is
because I can't overwrite what ctrl+c does, even if prefixed. I will
look into this at some point but for now commits are ctrl+g ctrl+h.

Largely stolen the code from here:
https://gist.github.com/junegunn/8b572b8d4b5eddd8b85e5f4d40f17236
although with minor tweaks.

I might change the initial ctrl+g binding as it is awkward on colemak
although we'll see how often I use it.
2021-11-16 11:45:45 +00:00
Jonathan Hodgson
b5f91ddfde Sets repdef environment variable in projects 2021-11-16 11:21:21 +00:00
Jonathan Hodgson
8a56e49a74 list contents if I try and cat a directory 2021-11-16 11:20:15 +00:00
Jonathan Hodgson
766dcab3a7 Adds .local/bin to path for pip 2021-11-16 11:19:37 +00:00
Jonathan Hodgson
288d8c4ce1 Stops forcing colour for jq 2021-11-16 11:18:45 +00:00
Jonathan Hodgson
69206d46a4 Improvements to hashcat completion
The main args completion no longer uses a bash while loop for splitting
up the arguments making it much faster.

I have also removed the use of FZF for looking up modes. This has been
moved into the overidepartialcompletion file in includes.
2021-11-04 19:38:13 +00:00
Jonathan Hodgson
02b9b6e51e Functions: adds httpie helpers for xsrf
The functions are wrappers around http and https and set the
x-xsrf-token header based on the value of the Xsrf-token cookie in the
session file.

Currently, the cookie name and header name are hard coded. I may look to
specify those in an argument at some point although for now it's
probably fine.
2021-10-26 00:10:52 +01:00
Jonathan Hodgson
98a1d5177a ZSH: adds aws key regex to currenWordCompletions 2021-09-27 13:27:40 +01:00
Jonathan Hodgson
dbdec93713 Adds some more options to the change command function 2021-09-07 17:07:25 +01:00
Jonathan Hodgson
16b919dc3e Adds some telemetry env variables and composer to path 2021-09-07 17:06:25 +01:00
Jonathan Hodgson
5df1e386e6 SHELLS: adds a few aliases 2021-09-07 17:05:36 +01:00
Jonathan Hodgson
197ab225d4 Updates zsh plugins 2021-09-07 16:56:43 +01:00
Jonathan Hodgson
11405338f5 Adds regex to current word completion 2021-09-07 14:00:06 +01:00
Jonathan Hodgson
ad9a516eb8 ZSH: make find file only give 1 result 2021-08-31 11:04:46 +01:00
Jonathan Hodgson
fb3fb4365e ZSH: adds ^n keybinding to expand current word's filename
This is useful if I want to edit a script but I'm not in my scripts
directory. It will look for a file with the name I have typed and
replace it.

for example:
    vim yt<^n>
will be replaced with
    vim /home/jonathan/.bin/yt

The script will first try `which <filename>`, searching the path. If
that fails, it will do `locate "*/filename"` which will search for the
file elsewhere
2021-08-31 10:46:58 +01:00
Jonathan Hodgson
afb31a7589 ZSH: fixes issue for creaing directory with ~ in path
The alt-m key binding is used to create a directory for the current
"word". This change makes it work if it has something like ~ in the
name.

${~var} is used to turn on GLOB_SUBST. The string resulting from the
expansion will be interpreted as a pattern anywhere that is possible,
such as filenames expanding `~`

man zshexpn
2021-08-31 10:42:56 +01:00
Jonathan Hodgson
b086532297 ZSH: Completion: Hashcat: fix broken mode selection
Hashcat has changed the way it displays modes. Update the completion
script to reflect this.
2021-08-24 15:58:23 +01:00
Jonathan Hodgson
d92ac70946 ZSH: prompt: show branch on older versions of git 2021-08-23 15:24:34 +01:00
Jonathan Hodgson
5c159344fc ZSH: checks for project in prompt 2021-08-23 15:22:05 +01:00
Jonathan Hodgson
bda6ca95e4 ZSH: checks for project in prompt 2021-08-23 15:19:48 +01:00
Jonathan Hodgson
0fdbfe45b7 ZSH: checks for commands existance before running 2021-08-23 15:16:56 +01:00
Jonathan Hodgson
ec6bad4c1a Makes right alt my compose key
Compose key is used for inputting special characters more easily.

See the compose table for examples:

https://help.ubuntu.com/community/GtkComposeTable
2021-04-01 16:02:28 +01:00
Jonathan Hodgson
f555ccd352 Make colours work now focus has been disabled 2021-03-21 14:54:10 +00:00
Jonathan Hodgson
f6964bf3ba Only show explicitly installed when tab-completing pacman -R*
When tabcompleting for pacman -R*, I generally only want to show things
that I've explicitly installed, rather than things that have been
installed automatically as a dependency.
2021-03-21 12:59:17 +00:00
Jonathan Hodgson
dfa5f5e424 Deletes focus zsh file 2021-03-21 12:57:57 +00:00
Jonathan Hodgson
428a59cafd Adds cat to auto-notify ignore list 2021-03-21 12:56:40 +00:00
Jonathan Hodgson
983896f644 ZSH: Makes prompt shorter in narrow terminals
This is mainly achieved by no longer showing the full path.

If the terminal is less than 100 characters, it will show a preceding
icon, >> then the bottom most folder name.

The >> indicates that folders have been missed.

I have added an icon for my dotfiles folder
2021-02-18 21:38:50 +00:00
Jonathan Hodgson
3187c98e35 Adds check for fzf 2021-02-03 23:16:35 +00:00
Jonathan Hodgson
bc8e2e2f97 Adds checks to promptconfig 2021-02-03 23:12:28 +00:00