mirror of
				https://github.com/mitchell/dotfiles.git
				synced 2025-10-31 04:25:26 +00:00 
			
		
		
		
	Set umask, update aliases, and convert some to binds
This commit is contained in:
		
							parent
							
								
									517bc5f587
								
							
						
					
					
						commit
						662cf1bcdc
					
				|  | @ -2,6 +2,9 @@ function configure_fish | ||||||
|     # Determine OS |     # Determine OS | ||||||
|     set uname (uname) |     set uname (uname) | ||||||
| 
 | 
 | ||||||
|  |     # Set umask | ||||||
|  |     umask 077 | ||||||
|  | 
 | ||||||
|     # Begin profile init |     # Begin profile init | ||||||
|     # (These functions are defined in the functions/ directory.) |     # (These functions are defined in the functions/ directory.) | ||||||
|     define_global_variables |     define_global_variables | ||||||
|  |  | ||||||
|  | @ -1,14 +1,10 @@ | ||||||
| function define_aliases -a uname -d 'Defines aliases for commonly used commands' | function define_aliases -a uname -d 'Defines aliases for commonly used commands' | ||||||
|     alias rcp 'rsync -aP' |     alias rcp 'rsync -aP' | ||||||
|     alias dm 'docker-machine' |  | ||||||
|     alias v 'nvim +FZF' |  | ||||||
|     alias j 'joplin' |  | ||||||
|     alias vg 'vagrant' |     alias vg 'vagrant' | ||||||
|     alias tf 'terraform' |     alias tf 'terraform' | ||||||
|     alias tocb 'xclip -in -selection clipboard' |     alias tocb 'xclip -in -selection clipboard' | ||||||
|     alias fromcb 'xclip -out -selection clipboard' |     alias fromcb 'xclip -out -selection clipboard' | ||||||
|     alias ssh-rm 'ssh-keygen -f ~/.ssh/known_hosts -R' |     alias ssh-rm 'ssh-keygen -f ~/.ssh/known_hosts -R' | ||||||
|     alias wiki 'nvim +VimwikiIndex' |  | ||||||
|     alias age-p 'age --armor --passphrase' |     alias age-p 'age --armor --passphrase' | ||||||
|     alias age-d 'age --decrypt --identity ~/.secrets/id_ed25519' |     alias age-d 'age --decrypt --identity ~/.secrets/id_ed25519' | ||||||
|     alias age-e 'age --armor --recipient (cat ~/.secrets/id_ed25519.pub)' |     alias age-e 'age --armor --recipient (cat ~/.secrets/id_ed25519.pub)' | ||||||
|  | @ -27,10 +23,11 @@ function define_aliases -a uname -d 'Defines aliases for commonly used commands' | ||||||
|             alias rider 'open -a Rider' |             alias rider 'open -a Rider' | ||||||
|             alias webstorm 'open -a Webstorm' |             alias webstorm 'open -a Webstorm' | ||||||
| 
 | 
 | ||||||
|             alias get 'brew install' |             alias pkm 'brew search' | ||||||
|             alias getu 'brew upgrade' |             alias pkmi 'brew install' | ||||||
|             alias gets 'brew search' |             alias pkmf 'brew update' | ||||||
|             alias getr 'brew uninstall' |             alias pkmu 'brew upgrade' | ||||||
|  |             alias pkmr 'brew uninstall' | ||||||
|     end |     end | ||||||
| 
 | 
 | ||||||
|     # Linux distro specific aliases below |     # Linux distro specific aliases below | ||||||
|  | @ -47,16 +44,18 @@ function define_aliases -a uname -d 'Defines aliases for commonly used commands' | ||||||
| 
 | 
 | ||||||
|     switch "$distro" |     switch "$distro" | ||||||
|         case 'arch' |         case 'arch' | ||||||
|             alias get 'pikaur -S' |             alias pkm 'pikaur' | ||||||
|             alias getu 'pikaur -Syu' |             alias pkmi 'pikaur --sync' | ||||||
|             alias gets 'pikaur' |             alias pkmf 'pikaur --sync --refresh' | ||||||
|             alias getr 'pikaur -Rsu' |             alias pkmu 'pikaur --sync --sysupgrade' | ||||||
|  |             alias pkmr 'pikaur -Rsu' | ||||||
|         case 'debian' |         case 'debian' | ||||||
|             alias get 'sudo apt update; and sudo apt install' |             alias pkm 'apt search' | ||||||
|             alias getu 'sudo apt update; and sudo apt upgrade; and sudo apt autoremove; and sudo apt autoclean' |             alias pkmi 'sudo apt install' | ||||||
|             alias gets 'sudo apt update; and apt search' |             alias pkmf 'sudo apt update' | ||||||
|  |             alias pkmu 'sudo apt upgrade; and sudo apt autoremove; and sudo apt autoclean' | ||||||
| 
 | 
 | ||||||
|             function getr -d 'Alias for apt uninstall and autoremove' |             function pkmr -d 'Alias for apt uninstall and autoremove' | ||||||
|                 sudo apt purge $argv; and sudo apt autoremove |                 sudo apt purge $argv; and sudo apt autoremove | ||||||
|             end |             end | ||||||
|     end |     end | ||||||
|  |  | ||||||
							
								
								
									
										9
									
								
								.config/fish/functions/do.fish
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								.config/fish/functions/do.fish
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,9 @@ | ||||||
|  | function do -d 'Repeat the command for each given argument' | ||||||
|  |     set command (string split ' ' $argv[1]) | ||||||
|  |     and set args $argv[2..] | ||||||
|  |     or return 1 | ||||||
|  |      | ||||||
|  |     for arg in $args | ||||||
|  |         $command $arg | ||||||
|  |     end | ||||||
|  | end | ||||||
|  | @ -1,3 +1,8 @@ | ||||||
| function fish_user_key_bindings | function fish_user_key_bindings | ||||||
|     bind -s --preset -M insert jj "if commandline -P; commandline -f cancel; else; set fish_bind_mode default; commandline -f backward-char repaint-mode; end" |     bind --mode insert jj "if commandline -P; commandline -f cancel; else; set fish_bind_mode default; commandline -f backward-char repaint-mode; end" | ||||||
|  |     bind --mode insert ,a 'ssh_add; commandline -f repaint' | ||||||
|  |     bind --mode insert ,j 'joplin; commandline -f repaint' | ||||||
|  |     bind --mode insert ,p 'nvim +FZF; commandline -f repaint' | ||||||
|  |     bind --mode insert ,w 'nvim +VimwikiIndex; commandline -f repaint' | ||||||
|  |     bind --mode insert ,n 'n; commandline -f repaint' | ||||||
| end | end | ||||||
|  |  | ||||||
							
								
								
									
										8
									
								
								.config/fish/functions/redisco.fish
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								.config/fish/functions/redisco.fish
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,8 @@ | ||||||
|  | function redisco | ||||||
|  |     while pgrep Discord >/dev/null 2>&1 | ||||||
|  |         pkill Discord | ||||||
|  |         sleep 1 | ||||||
|  |     end | ||||||
|  | 
 | ||||||
|  |     discord >/dev/null 2>&1 & disown | ||||||
|  | end | ||||||
|  | @ -1,11 +0,0 @@ | ||||||
| function ssh_a -d 'Shortcut for adding keys to ssh agent' |  | ||||||
|     argparse --max-args 1 's/seedly' 'r/rsa' -- $argv |  | ||||||
| 
 |  | ||||||
|     if test -n "$_flag_s" |  | ||||||
|         ssh-add ~/.secrets/seedly_ed25519 |  | ||||||
|     else if test -n "$_flag_r" |  | ||||||
|         ssh-add ~/.secrets/id_rsa |  | ||||||
|     else |  | ||||||
|         ssh-add ~/.secrets/id_ed25519 |  | ||||||
|     end |  | ||||||
| end |  | ||||||
							
								
								
									
										14
									
								
								.config/fish/functions/ssh_add.fish
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								.config/fish/functions/ssh_add.fish
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,14 @@ | ||||||
|  | function ssh_add -d 'Shortcut for adding keys to ssh agent' | ||||||
|  |     read --prompt-str='e/r/s? ' args | ||||||
|  | 
 | ||||||
|  |     argparse --max-args 1 's/seedly' 'r/rsa' -- $args | ||||||
|  | 
 | ||||||
|  |     switch $args | ||||||
|  |         case s seedly | ||||||
|  |             ssh-add ~/.secrets/seedly_ed25519 | ||||||
|  |         case r rsa | ||||||
|  |             ssh-add ~/.secrets/id_rsa | ||||||
|  |         case '*' | ||||||
|  |             ssh-add ~/.secrets/id_ed25519 | ||||||
|  |     end | ||||||
|  | end | ||||||
		Loading…
	
		Reference in a new issue