From fb31b7b917a8e8c7b9f666e0fd6dc315fac5964a Mon Sep 17 00:00:00 2001 From: Jacob Bohanon Date: Tue, 8 Nov 2022 13:10:59 -0500 Subject: [PATCH 1/2] mbp changes --- .gitconfig | 2 ++ nvim/init.vim | 10 +++++++++- zsh/.zshrc | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.gitconfig b/.gitconfig index 0e5dca2..4996e90 100644 --- a/.gitconfig +++ b/.gitconfig @@ -7,3 +7,5 @@ sort = version:refname [init] defaultBranch = master +[pull] + rebase = false diff --git a/nvim/init.vim b/nvim/init.vim index 76a8421..e4e5dd3 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -120,6 +120,7 @@ tnoremap nnoremap ee :NvimTreeFindFileToggle nnoremap h lua require("harpoon.mark").add_file() nnoremap / :Commentary +vnoremap / :Commentary vnoremap J :m '>+1gv=gv vnoremap K :m '<-2gv=gv @@ -205,6 +206,14 @@ require('lspconfig')['gopls'].setup{ on_attach = on_attach, capabilities = capabilities, } +require('lspconfig')['pyright'].setup{ + on_attach = on_attach, + capabilities = capabilities, +} +require('lspconfig')['tsserver'].setup{ + on_attach = on_attach, + capabilities = capabilities, +} EOF lua < Date: Mon, 14 Nov 2022 10:08:59 -0500 Subject: [PATCH 2/2] custom starship config --- zsh/.zshrc | 6 +- zsh/config.d/oh-my.zsh | 1 - zsh/config.d/starship.zsh | 38 +++++++++ zsh/starship.toml | 164 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 207 insertions(+), 2 deletions(-) create mode 100644 zsh/config.d/starship.zsh create mode 100644 zsh/starship.toml diff --git a/zsh/.zshrc b/zsh/.zshrc index d8010a7..0651a78 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -3,6 +3,7 @@ export EDITOR=nvim export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:/opt/local/bin:$PATH ulimit -n 65536 200000 +ulimit -f unlimited # eksctl fpath=($fpath ~/.zsh/completion) @@ -39,4 +40,7 @@ for conf in "$HOME/.config/zsh/config.d/"*.zsh; do source "${conf}" done unset conf -export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" + +export STARSHIP_CONFIG=~/.config/zsh/starship.toml + +eval "$(starship init zsh)" diff --git a/zsh/config.d/oh-my.zsh b/zsh/config.d/oh-my.zsh index 75202c0..3a504ad 100644 --- a/zsh/config.d/oh-my.zsh +++ b/zsh/config.d/oh-my.zsh @@ -78,5 +78,4 @@ export SSH_KEY_PATH="~/.ssh/rsa_id" # users are encouraged to define aliases within the ZSH_CUSTOM folder. # For a full list of active aliases, run `alias`. [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh -eval "$(starship init zsh)" diff --git a/zsh/config.d/starship.zsh b/zsh/config.d/starship.zsh new file mode 100644 index 0000000..126eba0 --- /dev/null +++ b/zsh/config.d/starship.zsh @@ -0,0 +1,38 @@ +# find out which distribution we are running on +LFILE="/etc/*-release" +MFILE="/System/Library/CoreServices/SystemVersion.plist" +if [[ -f $LFILE ]]; then + _distro=$(awk '/^ID=/' /etc/*-release | awk -F'=' '{ print tolower($2) }') +elif [[ -f $MFILE ]]; then + _distro="macos" +fi + +# set an icon based on the distro +# make sure your font is compatible with https://github.com/lukas-w/font-logos +case $_distro in + *kali*) ICON="ﴣ";; + *arch*) ICON="";; + *debian*) ICON="";; + *raspbian*) ICON="";; + *ubuntu*) ICON="";; + *elementary*) ICON="";; + *fedora*) ICON="";; + *coreos*) ICON="";; + *gentoo*) ICON="";; + *mageia*) ICON="";; + *centos*) ICON="";; + *opensuse*|*tumbleweed*) ICON="";; + *sabayon*) ICON="";; + *slackware*) ICON="";; + *linuxmint*) ICON="";; + *alpine*) ICON="";; + *aosc*) ICON="";; + *nixos*) ICON="";; + *devuan*) ICON="";; + *manjaro*) ICON="";; + *rhel*) ICON="";; + *macos*) ICON="";; + *) ICON="";; +esac + +export STARSHIP_DISTRO="$ICON" diff --git a/zsh/starship.toml b/zsh/starship.toml new file mode 100644 index 0000000..5b25f98 --- /dev/null +++ b/zsh/starship.toml @@ -0,0 +1,164 @@ +# ~/.config/starship.toml + +# Inserts a blank line between shell prompts +add_newline = true + +# Change command timeout from 500 to 1000 ms +command_timeout = 1000 + +# Change the default prompt format +format = """ +[╭╴](238)$env_var \ +$username\ +$hostname\ +$localip\ +$directory\ +$time\ +$line_break\ +[|](238)$shlvl\ +$singularity\ +$vcsh\ +$git_branch\ +$git_commit\ +$git_state\ +$git_metrics\ +$git_status\ +$kubernetes\ +$hg_branch\ +$docker_context\ +$package\ +$c\ +$cmake\ +$cobol\ +$daml\ +$dart\ +$deno\ +$dotnet\ +$elixir\ +$elm\ +$erlang\ +$golang\ +$haskell\ +$helm\ +$java\ +$julia\ +$kotlin\ +$lua\ +$nim\ +$nodejs\ +$ocaml\ +$perl\ +$php\ +$pulumi\ +$purescript\ +$python\ +$raku\ +$rlang\ +$red\ +$ruby\ +$rust\ +$scala\ +$swift\ +$terraform\ +$vlang\ +$vagrant\ +$zig\ +$buf\ +$nix_shell\ +$conda\ +$meson\ +$spack\ +$memory_usage\ +$aws\ +$gcloud\ +$openstack\ +$azure\ +$crystal\ +$custom\ +$sudo\ +$cmd_duration\ +$jobs\ +$battery\ +$status\ +$container\ +$shell\ +$line_break\ +[╰─](238)$character""" + +# Change the default prompt characters +[character] +error_symbol = "[✘](bold red)" +success_symbol = "" + +[time] +disabled = false + +# Shows an icon that should be included by zshrc script based on the distribution or os +[env_var.STARSHIP_DISTRO] +format = '[$env_value](white)' +variable = "STARSHIP_DISTRO" +disabled = false + +# Shows the username +[username] +style_user = "white" +style_root = "white" +format = "[$user]($style) " +disabled = false +show_always = true + +[hostname] +ssh_only = true +format = "on [$hostname](bold yellow) " +disabled = false + +[directory] +truncate_to_repo = true +home_symbol = " ~" +read_only_style = "197" +read_only = "  " +format = "at [$path]($style)[$read_only]($read_only_style) " + +[git_branch] +symbol = " " +format = "[$symbol$branch]($style) " +style = "bold green" + +[git_status] +format = '[\(( $all_status)($ahead_behind)\)]($style) ' +style = "bold green" +conflicted = "🏳" +up_to_date = " " +untracked = " " +ahead = "⇡${count}" +diverged = "⇕⇡${ahead_count}⇣${behind_count}" +behind = "⇣${count}" +stashed = " " +modified = " " +staged = '[++$count ](green)' +renamed = "襁 " +deleted = " " + +[kubernetes] +format = '[///](238) [ﴱ $context](bold purple) ' +disabled = false + +[python] +format = '[///](238) [${symbol}${pyenv_prefix}(${version} )(\($virtualenv\) )]($style)' +symbol = " " +python_binary = "python3" +disabled = false + +[nodejs] +format = "[///](238) [ $version](bold green) " +disabled = false + +[golang] +format = "[///](238) [$symbol($version )]($style)" +symbol = "ﳑ " + +[package] +disabled = true + +[gcloud] +format = '[///](238) [$symbol$account(@$domain)(\($region\))]($style) '