Move plugins to plugin directory
This commit is contained in:
		
							
								
								
									
										22
									
								
								zsh/plugins/cf.zsh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								zsh/plugins/cf.zsh
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,22 @@ | ||||
| # Fuzzy cd from anywhere | ||||
| # Dependencies | ||||
| # * fzf | ||||
| # * mlocate | ||||
|  | ||||
| # ========== Shortcuts ========== | ||||
| cf() { | ||||
|     [[ -z "${*}" ]] && return 1 | ||||
|     [[ ! -x /usr/bin/fzf ]] && return 1 | ||||
|  | ||||
|     dir="$(locate --all --ignore-case --null -- "${@}" | fzf --read0 --select-1 --exit-0)" | ||||
|  | ||||
|     [[ -z "${dir}" ]] && return 1 | ||||
|   | ||||
|     if [[ -f "${dir}" ]]; then | ||||
|         cd "${dir%/*}" | ||||
|     else | ||||
|         cd "${dir}" | ||||
|     fi | ||||
| } | ||||
|  | ||||
| autoload -Uz cf | ||||
							
								
								
									
										17
									
								
								zsh/plugins/fedit.zsh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								zsh/plugins/fedit.zsh
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,17 @@ | ||||
| # Fuzzy find a file and then edit it | ||||
|  | ||||
| _fedit() { | ||||
|     /usr/bin/fedit | ||||
|     zle reset-prompt | ||||
| } | ||||
|  | ||||
| _etcedit() { | ||||
|     /usr/bin/fedit --etc | ||||
|     zle reset-prompt | ||||
| } | ||||
|  | ||||
| zle -N _fedit | ||||
| bindkey -M viins '^o' _fedit | ||||
|  | ||||
| zle -N _etcedit | ||||
| bindkey -M viins '^e' _etcedit | ||||
							
								
								
									
										8
									
								
								zsh/plugins/fless.zsh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								zsh/plugins/fless.zsh
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| # Fuzzy-find a file and open it in less | ||||
| fless() { | ||||
|     /usr/bin/fless | ||||
|     zle reset-prompt | ||||
| } | ||||
|  | ||||
| zle -N fless | ||||
| bindkey -M viins '^n' fless | ||||
							
								
								
									
										8
									
								
								zsh/plugins/mkcd.zsh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								zsh/plugins/mkcd.zsh
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| # Make a directory, then change into it | ||||
|  | ||||
| mkcd() { | ||||
|     [[ ! -d "${1}" ]] && mkdir --parents -- "${1}" | ||||
|     cd "${1}" || exit | ||||
| } | ||||
|  | ||||
| autoload -Uz mkcd | ||||
		Reference in New Issue
	
	Block a user