diff --git a/.gitconfig b/.gitconfig index 34118cc..108f25a 100644 --- a/.gitconfig +++ b/.gitconfig @@ -4,6 +4,12 @@ signingkey = /home/jacob/.ssh/id_ed25519.pub [url "ssh://git@github.com/"] insteadOf = https://github.com/ +[user] + name = Jacob Bohanon + email = jacobbohanon@gmail.com + signingkey = /home/jacob/.ssh/id_ed25519.pub +[url "ssh://git@192.168.10.50:30009/"] + insteadOf = https://git.nonahob.net/ [tag] sort = version:refname [init] @@ -28,9 +34,9 @@ prompt = true [mergetool "nvimdiff"] cmd = "nvim -d \"$LOCAL\" \"$REMOTE\" \"$MERGED\" -c 'wincmd w' -c 'wincmd J'" -[credential "https://github.com"] - helper = - helper = !/usr/bin/gh auth git-credential -[credential "https://gist.github.com"] - helper = - helper = !/usr/bin/gh auth git-credential +#[credential "https://github.com"] +# helper = +# helper = !/usr/bin/gh auth git-credential +#[credential "https://gist.github.com"] +# helper = +# helper = !/usr/bin/gh auth git-credential diff --git a/ghostty/config.ghostty b/ghostty/config.ghostty new file mode 100644 index 0000000..c59095b --- /dev/null +++ b/ghostty/config.ghostty @@ -0,0 +1 @@ +font-family = "FiraCode Nerd Font Mono" diff --git a/nvim/lua/lsp.lua b/nvim/lua/lsp.lua index efe8b8a..e87eb3a 100644 --- a/nvim/lua/lsp.lua +++ b/nvim/lua/lsp.lua @@ -1,5 +1,3 @@ --- Mappings. --- See `:help vim.diagnostic.*` for documentation on any of the below functions local opts = { noremap = true, silent = true } vim.keymap.set('n', 'd', vim.diagnostic.open_float, opts) vim.keymap.set('n', 'dd', require 'telescope.builtin'.diagnostics, opts) @@ -7,14 +5,9 @@ vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts) vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts) vim.keymap.set('n', 'dl', vim.diagnostic.setloclist, opts) --- Use an on_attach function to only map the following keys --- after the language server attaches to the current buffer local on_attach = function(client, bufnr) - -- Enable completion triggered by - vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') + vim.bo[bufnr].omnifunc = 'v:lua.vim.lsp.omnifunc' - -- Mappings. - -- See `:help vim.lsp.*` for documentation on any of the below functions local bufopts = { noremap = true, silent = true, buffer = bufnr } vim.keymap.set('n', 'gD', require 'telescope.builtin'.lsp_type_definitions, bufopts) vim.keymap.set('n', 'gd', require 'telescope.builtin'.lsp_definitions, bufopts) @@ -27,51 +20,30 @@ local on_attach = function(client, bufnr) vim.keymap.set('n', 'gr', require 'telescope.builtin'.lsp_references, bufopts) vim.keymap.set('n', 'f', vim.lsp.buf.format, bufopts) end + local capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities()) -require('lspconfig')['gopls'].setup { + +vim.lsp.config('*', { + on_attach = on_attach, + capabilities = capabilities, +}) + +vim.lsp.config('gopls', { settings = { gopls = { templateExtensions = { 'gotmpl', 'gohtml' }, } }, filetypes = { "go", "gomod", "gowork", "gotmpl", "gohtml", "gohtmltmpl" }, - 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, -} -require('lspconfig')['clangd'].setup { - on_attach = on_attach, - capabilities = capabilities, - -- This is the default list of filetypes excluding proto +}) + +vim.lsp.config('clangd', { + -- default filetypes excluding proto -- https://github.com/neovim/nvim-lspconfig/blob/0ef64599b8aa0187ee5f6d92cb39c951f348f041/lua/lspconfig/server_configurations/clangd.lua#L70C5-L70C66 filetypes = { 'c', 'cpp', 'objc', 'objcpp', 'cuda' } -} -require('lspconfig')['rust_analyzer'].setup { - on_attach = on_attach, - capabilities = capabilities, -} -require('lspconfig')['bashls'].setup { - on_attach = on_attach, - capabilities = capabilities, -} -require('lspconfig')['bzl'].setup { - on_attach = on_attach, - capabilities = capabilities, -} -require('lspconfig')['cmake'].setup { - on_attach = on_attach, - capabilities = capabilities, -} -require('lspconfig')['lua_ls'].setup { - on_attach = on_attach, - capabilities = capabilities, +}) + +vim.lsp.config('lua_ls', { on_init = function(client) local path = client.workspace_folders[1].name if (vim.uv or vim.loop).fs_stat(path .. '/.luarc.json') or (vim.uv or vim.loop).fs_stat(path .. '/.luarc.jsonc') then @@ -80,39 +52,40 @@ require('lspconfig')['lua_ls'].setup { client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { runtime = { - -- Tell the language server which version of Lua you're using - -- (most likely LuaJIT in the case of Neovim) version = 'LuaJIT' }, - -- Make the server aware of Neovim runtime files workspace = { checkThirdParty = false, library = { vim.env.VIMRUNTIME - -- Depending on the usage, you might want to add additional paths here. - -- "${3rd}/luv/library" - -- "${3rd}/busted/library", } - -- or pull in all of 'runtimepath'. NOTE: this is a lot slower - -- library = vim.api.nvim_get_runtime_file("", true) } }) end, settings = { Lua = {} } -} -require('lspconfig')['zls'].setup { - on_attach = on_attach, - capabilities = capabilities, +}) + +vim.lsp.config('zls', { cmd = { '/home/jacob/src/github.com/zigtools/zls/zig-out/bin/zls' }, - settings = { - zls = { - zig_exe_path = '/home/jacob/.zig/zig/zig', + settings = { + zls = { + zig_exe_path = '/home/jacob/.zig/zig/zig', + } } - } -} -require('lspconfig')['protols'].setup{ - on_attach = on_attach, - capabilities = capabilities, -} +}) + +vim.lsp.enable({ + 'gopls', + 'pyright', + 'ts_ls', + 'clangd', + 'rust_analyzer', + 'bashls', + 'bzl', + 'cmake', + 'lua_ls', + 'zls', + 'protols', +}) diff --git a/zsh/.zshrc b/zsh/.zshrc index 54ab659..98ddd3c 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -70,4 +70,8 @@ function gclone () { eval $(gitclone.sh $1) } +alias sz='source $HOME/.zshrc' + eval "$(starship init zsh)" + +. "$HOME/.local/share/../bin/env" diff --git a/zsh/config.d/solo.zsh b/zsh/config.d/solo.zsh new file mode 100644 index 0000000..1e83e3d --- /dev/null +++ b/zsh/config.d/solo.zsh @@ -0,0 +1,113 @@ +SOLO_DIR="$HOME/src/github.com/solo-io" +SOLO_GITHUB="https://github.com/solo-io" + +SOLO_REPOS=( +"gloo" +"gloo-gateway" +"gloo-fed" +"solo-projects" +"solo-apis" +"solo-kit" +"dev-portal" +"gloo-mesh" +"gloo-mesh-ui" +"gloo-mesh-enterprise" +"ext-auth-service" +"rate-limiter" +"caching-service" +"envoy-gloo-ee" +"agentgateway-enterprise" +) + +AGW_DIR="$HOME/src/github.com/agentgateway" +AGW_GITHUB="https://github.com/agentgateway" + +AGW_REPOS=( + "agentgateway" +) + +KGW_DIR="$HOME/src/github.com/kgateway-dev" +KGW_GITHUB="https://github.com/kgateway-dev" + +KGW_REPOS=( + "kgateway" +) + + +mkdir -p $SOLO_DIR $AGW_DIR $KGW_DIR + +# Used to generalize the git clone loop for different orgs +# Don't mind the fuckery that claude found for passing the +# repos arrays as namerefs +# +# Pass the following arguments +# 1: github as should be defined in above +# 2: dir as should be defined in above +# 3: repos arr as should be defined above +function clone_repos() { + local gh="${1}" + local dir="${2}" + local -a repos=("${(@P)3}") + + for repo in "${repos[@]}" + do + local repo_addr="${gh}/${repo}" + local repo_dir="${dir}/${repo}" + + if [[ ! -d $repo_dir ]]; then + pushd $dir + git clone $repo_addr + popd + fi + done +} + +clone_repos "${SOLO_GITHUB}" "${SOLO_DIR}" SOLO_REPOS +clone_repos "${KGW_GITHUB}" "${KGW_DIR}" KGW_REPOS +clone_repos "${AGW_GITHUB}" "${AGW_DIR}" AGW_REPOS + +function nvim_readme() { + nvim ./README.md +} + +# Aliases to reach different repos +alias cdsi='cd $SOLO_DIR' +alias cdg='cd $SOLO_DIR/gloo' +alias nvg='cdg && nvim_readme' +alias cdgf='cd $SOLO_DIR/gloo-fed' +alias nvgf='cdgf && nvim_readme' +alias cdsp='cd $SOLO_DIR/solo-projects' +alias nvsp='cdsp && nvim_readme' +alias cdsa='cd $SOLO_DIR/solo-apis' +alias nvsa='cdsa && nvim_readme' +alias cdsk='cd $SOLO_DIR/solo-kit' +alias nvsk='cdsk && nvim_readme' +alias cddp='cd $SOLO_DIR/dev-portal' +alias nvdp='cddp && nvim_readme' +alias cdgm='cd $SOLO_DIR/gloo-mesh' +alias nvgm='cdgm && nvim_readme' +alias cdgmui='cd $SOLO_DIR/gloo-mesh-ui' +alias nvgmui='cdgmui && nvim_readme' +alias cdgme='cd $SOLO_DIR/gloo-mesh-enterprise' +alias nvgme='cdgme && nvim_readme' +alias cdea='cd $SOLO_DIR/ext-auth-service' +alias nvea='cdea && nvim_readme' +alias cdrl='cd $SOLO_DIR/rate-limiter' +alias nvrl='cdrl && nvim_readme' +alias cdcs='cd $SOLO_DIR/caching-service' +alias nvcs='cdcs && nvim_readme' +alias cdeg='cd $SOLO_DIR/envoy-gloo' +alias nveg='cdeg && nvim_readme' +alias cdee='cd $SOLO_DIR/envoy-gloo-ee' +alias nvee='cdee && nvim_readme' +alias cde='cd $SOLO_DIR/../envoyproxy/envoy' +alias nve='cde && nvim_readme' +alias cdgg='cd $SOLO_DIR/gloo-gateway' +alias nvgg='cdgg && nvim_readme' +alias cdagw='cd $AGW_DIR/agentgateway' +alias nvagw='cdagw && nvim_readme' +alias cdagwe='cd $SOLO_DIR/agentgateway-enterprise' +alias nvagwe='cdagwe && nvim_readme' +alias cdkgw='cd $KGW_DIR/kgateway' +alias nvkgw='cdkgw && nvim_readme' + diff --git a/zsh/gitclone.sh b/zsh/gitclone.sh old mode 100644 new mode 100755 index 42ffb06..ce01215 --- a/zsh/gitclone.sh +++ b/zsh/gitclone.sh @@ -5,7 +5,7 @@ url=$1 # make sure we have a valid git url. only works with http/s regex='^https?://[^/]+/[^/]+/[^/]+(\.git)?$' -if [[ ! $"url" =~ $regex ]]; then +if [[ ! "$url" =~ $regex ]]; then echo "echo \"$url does not match regex\"" exit 1 fi