my dotz
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add tada to vim, fix prompt bugs

+24 -19
+2 -2
.config/git/config
··· 37 37 email = j3s@c3f.net 38 38 [pull] 39 39 ff = only 40 - [includeIf "gitdir:~/do/"] 41 - path = ~/.config/git/config-work 42 40 [pager] 43 41 status = true 44 42 [init] 45 43 defaultBranch = main 44 + [includeIf "gitdir:~/do/"] 45 + path = ~/.config/git/config-work
+3 -1
.config/git/config-work
··· 3 3 email = jolson@digitalocean.com 4 4 [changelog] 5 5 format = * %s [%an] 6 - [url "git@github.internal.digitalocean.com:"] 6 + [url "ssh://git@github.com/"] 7 + insteadOf = https://github.com/ 8 + [url "ssh://git@github.internal.digitalocean.com/"] 7 9 insteadOf = https://github.internal.digitalocean.com/
+1
.config/nvim/init.vim
··· 6 6 Plug 'hrsh7th/nvim-compe' 7 7 Plug 'ctrlpvim/ctrlp.vim' 8 8 Plug 'cormacrelf/vim-colors-github' 9 + Plug 'dewyze/vim-tada' 9 10 call plug#end() 10 11 11 12 colorscheme github
+18 -16
bin/prompt.go
··· 11 11 12 12 // getRepoRoot returns the full path to the root 13 13 // of the closest git dir 14 - func getRepoRoot() string { 15 - var rootPath string 16 - 14 + func gitTopLevel() string { 17 15 path, err := exec.Command("git", "rev-parse", "--show-toplevel").Output() 18 16 if err != nil { 19 - rootPath = "~" 20 - } else { 21 - rootPath = strings.TrimSpace(string(path)) 17 + // assume the error means there's no git 18 + // dir above us 19 + return "/" 22 20 } 23 - return rootPath 21 + return strings.TrimSpace(string(path)) 24 22 } 25 23 26 24 func resolveEmoji(hostname string) string { ··· 34 32 } 35 33 36 34 func main() { 37 - cwd, _ := os.Getwd() 35 + wd, _ := os.Getwd() 36 + cwd, _ := filepath.EvalSymlinks(wd) 38 37 host, _ := os.Hostname() 39 38 home := os.Getenv("HOME") 40 39 now := time.Now().Format("15:04:05") 41 40 emoji := resolveEmoji(host) 42 41 fmt.Printf("%s %s ", now, emoji) 43 42 44 - gitRoot := getRepoRoot() 45 - 46 - var prefix string 47 - if gitRoot == home { 48 - prefix = "~" 43 + var promptRoot string 44 + gitTop := gitTopLevel() 45 + if gitTop == home { 46 + promptRoot = "~" 49 47 } else { 50 - prefix = filepath.Base(gitRoot) 48 + promptRoot = filepath.Base(gitTop) 51 49 } 52 - suffix := cwd[len(gitRoot):] 53 - fmt.Printf("%s", prefix) 50 + // subtract the git toplevel "/home/j3s" 51 + // from the cwd "/home/j3s/code/nongitdir" 52 + // to get the suffix "/code/nongitdir" 53 + // os.cwd gets the symlink, git does not 54 + suffix := cwd[len(gitTop):] 55 + fmt.Printf("%s", promptRoot) 54 56 55 57 var parts []string 56 58 parts = strings.Split(suffix, "/")
bin/x86_64/prompt

This is a binary file and will not be displayed.