6 6 let-env NURC = (build-string (pwd) /nurc)
7 7 let-env DOTFILES = ((build-string (pwd) /..) | path expand)
8 +let-env TODO = (build-string $nu.env.DOTFILES /TODO.md)
15 +alias ll = exa --group-directories-first --classify --long --icons --git
16 +alias la = exa --group-directories-first --classify --all --long --icons --git
17 +alias tr = exa --tree
15 -alias todo = glow (build-string $nu.env.DOTFILES / TODO.md)
16 -alias nurc = nvim $nu.env.NURC
18 21 # CUSTOM LITTLE JAVA COMMANDS
19 22 alias sha = java (build-string $nu.env.DOTFILES /tools/ sha.java)
22 25 alias download = java (build-string $nu.env.DOTFILES /tools/ download.java)
23 26 alias download_jar = java (build-string $nu.env.DOTFILES /tools/ download_jar.java)
28 +# MY STDLIB UTIL MISC HELPER FUNCTIONS
30 +# Check whether table in pipeline has a column with given name
32 + name: string # Name of the column to check for
34 + pivot | any? Column0 == $name
37 +# Prints out a list of stuff.
38 +# Appends a newline at the end.
40 + ...rest: any # list of stuff to echo out
42 + echo (build-string ($rest | flatten | into string | str collect) )
46 +# Flattens a table into a string separated by a single space character.
47 +def to-string [] { flatten | into string | str collect ' ' }
51 +# Render my To-Do file in the terminal
52 +def todo [] { mdcat $nu.env.TODO }
53 +# Open my To-Do file for editing
54 +def "todo edit" [] { nvim $nu.env.TODO }
55 +# Open the Nushell configuration file for editing
56 +def "config edit" [] { nvim (config path) }
57 +# Open my Nushell startup script for editing
58 +def nurc [] { nvim $nu.env.NURC }
27 60 # Uploads a PUBLIC ssh key to GitHub.
28 61 # Will prompt for the AES encryption password of my dotfiles.
29 62 def github-upload-key [
78 111 git log --pretty=%h»¦«%s»¦«%aN»¦«%aE»¦«%aD -n 25 $rest | lines | split column "»¦«" commit subject name email date | update date { get date | str to-datetime} | sort-by date
116 +# On Windows, a man web page is opened.
118 + ...rest: string # Arguments to man
84 120 if (sys).host.name == "Windows" {
85 - start (build-string https://man.cx/ $program)
121 + start (build-string https://man.cx/ ($rest | to-string))
91 127 # Search the given query on the web with the default browser in DuckDuckGo.
93 - query:string # The search query
129 + ...rest:string # The search query
95 131 # There seems to be an issue with the nu start command on windows: It does not handle URLs
96 132 # Using windows command for now:
97 - start (build-string "https://duckduckgo.com/?q=" $query)
133 + start (build-string "https://duckduckgo.com/?q=" ($rest | to-string))
100 -# Check whether table in pipeline has a column with given name
102 - name: string # Name of the column to check for
104 - pivot | any? Column0 == $name
107 -# Prints out a list of stuff.
108 -# Appends a newline at the end.
110 - ...rest: any # list of stuff to echo out
112 - echo (build-string ($rest | flatten | into string | str collect) )
113 - echo (char newline)