Skip to content
Russell Brown edited this page Nov 30, 2024 · 1 revision

Welcome to the 902LabsDotFiles wiki!

From 777580d45f9569075c7946beb86cd510dcc5ab33 Mon Sep 17 00:00:00 2001
From: Russell Brown <russ@902labs.com>
Date: Thu, 14 Nov 2024 21:54:55 -0500
Subject: [PATCH] updates

---
 NvChad2.5/init.lua                  | 71 ++++++++++++++++++++++++-----
 NvChad2.5/lazy-lock.json            | 48 +++++++++----------
 NvChad2.5/lua/configs/lspconfig.lua |  4 +-
 NvChad2.5/lua/plugins/init.lua      | 49 +++++++++++++++-----
 git/gitconfig                       |  5 ++
 tmux/tmux.conf                      |  2 +-
 zsh/exports.zsh                     |  3 ++
 zsh/functions.zsh                   | 22 +++++++++
 zsh/history.zsh                     | 26 +++++++++--
 zsh/zshrc                           |  4 +-
 10 files changed, 178 insertions(+), 56 deletions(-)

diff --git a/NvChad2.5/init.lua b/NvChad2.5/init.lua
index facdd08..a2b24fe 100644
--- a/NvChad2.5/init.lua
+++ b/NvChad2.5/init.lua
@@ -59,7 +59,9 @@ local options = {
   formatters_by_ft = {
     css = { "prettier" },
     html = { "prettier" },
-    javascript = { "prettier" },
+    javascript = {},
+    typescriptreact = {},
+    -- javascript = { "prettier" },
     lua = { "stylua" },
   },
 
@@ -72,14 +74,59 @@ local options = {
 
 require("conform").setup(options)
 
-require("tabnine").setup {
-  accept_keymap = "<S-RIGHT>",
-  codelens_color = { gui = "#808080", cterm = 244 },
-  codelens_enabled = true,
-  debounce_ms = 800,
-  disable_auto_comment = false,
-  dismiss_keymap = "<C-]>",
-  exclude_filetypes = { "TelescopePrompt", "NvimTree" },
-  log_file_path = nil,
-  suggestion_color = { gui = "#808080", cterm = 244 },
-}
+-- require("tabnine").setup {
+--   accept_keymap = "<S-RIGHT>",
+--   codelens_color = { gui = "#808080", cterm = 244 },
+--   codelens_enabled = true,
+--   debounce_ms = 800,
+--   disable_auto_comment = false,
+--   dismiss_keymap = "<C-]>",
+--   exclude_filetypes = { "TelescopePrompt", "NvimTree" },
+--   log_file_path = nil,
+--   suggestion_color = { gui = "#808080", cterm = 244 },
+-- }
+
+-- require('copilot').setup({
+--   panel = {
+--     enabled = true,
+--     auto_refresh = false,
+--     keymap = {
+--       jump_prev = "[[",
+--       jump_next = "]]",
+--       accept = "<CR>",
+--       refresh = "gr",
+--       open = "<M-CR>"
+--     },
+--     layout = {
+--       position = "bottom", -- | top | left | right
+--       ratio = 0.4
+--     },
+--   },
+--   suggestion = {
+--     enabled = true,
+--     auto_trigger = false,
+--     hide_during_completion = true,
+--     debounce = 75,
+--     keymap = {
+--       accept = "<M-l>",
+--       accept_word = false,
+--       accept_line = false,
+--       next = "<M-]>",
+--       prev = "<M-[>",
+--       dismiss = "<C-]>",
+--     },
+--   },
+--   filetypes = {
+--     yaml = false,
+--     markdown = false,
+--     help = false,
+--     gitcommit = false,
+--     gitrebase = false,
+--     hgcommit = false,
+--     svn = false,
+--     cvs = false,
+--     ["."] = false,
+--   },
+--   copilot_node_command = 'node', -- Node.js version must be > 18.x
+--   server_opts_overrides = {},
+-- })
diff --git a/NvChad2.5/lazy-lock.json b/NvChad2.5/lazy-lock.json
index 6cd07ae..fa09b19 100644
--- a/NvChad2.5/lazy-lock.json
+++ b/NvChad2.5/lazy-lock.json
@@ -1,31 +1,33 @@
 {
-  "LuaSnip": { "branch": "master", "commit": "2b6860d15aaab01d3fb90859c0ba97f20ad7bc5f" },
-  "NvChad": { "branch": "v2.5", "commit": "7bfc159f630c4e9535587e6d3fdd63daf70f4270" },
-  "base46": { "branch": "v2.5", "commit": "87e09eb9e959966397bd9d8aab18d88ef349c913" },
+  "LuaSnip": { "branch": "master", "commit": "8d7aa7a7b7c0875e4878d1d2590924bc1c229305" },
+  "NvChad": { "branch": "v2.5", "commit": "09dd13e9c6df98fe5609829a7a0fbccea2f515ae" },
+  "base46": { "branch": "v2.5", "commit": "0e1824f7e4a3df36180e607e1adb3bdbd96db07f" },
   "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
   "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
   "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
   "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
   "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
-  "conform.nvim": { "branch": "master", "commit": "7159a23d19fb982269dae2e8147ebbe34965095b" },
-  "friendly-snippets": { "branch": "main", "commit": "e11b09bf10706bb74e16e4c3d11b2274d62e687f" },
-  "gitsigns.nvim": { "branch": "main", "commit": "75dc649106827183547d3bedd4602442340d2f7f" },
-  "indent-blankline.nvim": { "branch": "master", "commit": "d98f537c3492e87b6dc6c2e3f66ac517528f406f" },
-  "lazy.nvim": { "branch": "main", "commit": "ebbf84eb23d796ffd92ad88b980d3cf89921add4" },
-  "mason.nvim": { "branch": "main", "commit": "0950b15060067f752fde13a779a994f59516ce3d" },
-  "nvim-autopairs": { "branch": "master", "commit": "c15de7e7981f1111642e7e53799e1211d4606cb9" },
-  "nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" },
-  "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" },
+  "conform.nvim": { "branch": "master", "commit": "6a28c90082a67f62a323ab90d988e000a718a8c7" },
+  "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" },
+  "gitsigns.nvim": { "branch": "main", "commit": "7c27a30450130cd59c4994a6755e3c5d74d83e76" },
+  "indent-blankline.nvim": { "branch": "master", "commit": "04e44b09ee3ff189c69ab082edac1ef7ae2e256c" },
+  "lazy.nvim": { "branch": "main", "commit": "cf8ecc2c5e4332760431a33534240b0cbc6680ab" },
+  "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
+  "menu": { "branch": "main", "commit": "ee85b2e394fde354bd24e35ff7a688d10c9212fa" },
+  "minty": { "branch": "main", "commit": "157e91c04cce2f01643519338d6b854275a77547" },
+  "nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" },
+  "nvim-cmp": { "branch": "main", "commit": "29fb4854573355792df9e156cb779f0d31308796" },
   "nvim-config-local": { "branch": "main", "commit": "83bb6d9881653a5cf8b489ba8a6fe5a06049a10a" },
-  "nvim-lint": { "branch": "master", "commit": "1a3a8d047bc01f1760ae4a0f5e80f111ea222e67" },
-  "nvim-lspconfig": { "branch": "master", "commit": "74e14808cdb15e625449027019406e1ff6dda020" },
-  "nvim-tree.lua": { "branch": "master", "commit": "26632f496e7e3c0450d8ecff88f49068cecc8bda" },
-  "nvim-treesitter": { "branch": "master", "commit": "a80fe081b4c5890980561e0de2458f64aaffbfc7" },
-  "nvim-web-devicons": { "branch": "master", "commit": "b77921fdc44833c994fdb389d658ccbce5490c16" },
-  "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
-  "tabnine-nvim": { "branch": "master", "commit": "ccca333171125f9ebef619d6530815931988b2df" },
-  "telescope.nvim": { "branch": "master", "commit": "dfa230be84a044e7f546a6c2b0a403c739732b86" },
-  "ui": { "branch": "v2.5", "commit": "0c283b6aed4eed585a497c9031b18b5009bfe4dd" },
+  "nvim-lint": { "branch": "master", "commit": "16b21a7d04d06661f92f273a0744fd81fb19e09e" },
+  "nvim-lspconfig": { "branch": "master", "commit": "59a6766cbf32c7e4cf3ed685ccad7ffe1dde8c40" },
+  "nvim-tree.lua": { "branch": "master", "commit": "120ba58254835d412bbc91cffe847e9be835fadd" },
+  "nvim-treesitter": { "branch": "master", "commit": "1c111e3e8f42c85b16cb4bf30e4254fcb5607817" },
+  "nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" },
+  "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
+  "telescope.nvim": { "branch": "master", "commit": "85922dde3767e01d42a08e750a773effbffaea3e" },
+  "typescript-tools.nvim": { "branch": "master", "commit": "f8c2e0b36b651c85f52ad5c5373ff8b07adc15a7" },
+  "ui": { "branch": "v2.5", "commit": "e0f06a9aa43112e94beca8283516e6804112fb8e" },
   "vim-pyenv": { "branch": "master", "commit": "ce9e88535e8625da85cc6b113d2920f3230996cc" },
-  "which-key.nvim": { "branch": "main", "commit": "4b7167f8fb2dba3d01980735e3509e172c024c29" }
-}
\ No newline at end of file
+  "volt": { "branch": "main", "commit": "4472da2e77ad240e7fc56af6357b2a8fdf6aa0ae" },
+  "which-key.nvim": { "branch": "main", "commit": "8badb359f7ab8711e2575ef75dfe6fbbd87e4821" }
+}
diff --git a/NvChad2.5/lua/configs/lspconfig.lua b/NvChad2.5/lua/configs/lspconfig.lua
index a794e94..0f1b953 100644
--- a/NvChad2.5/lua/configs/lspconfig.lua
+++ b/NvChad2.5/lua/configs/lspconfig.lua
@@ -9,7 +9,7 @@ local servers = {
   "html",
   "eslint",
   "cssls",
-  "tsserver",
+  "ts_ls",
   "yamlls",
   "jsonls",
   "pyright",
@@ -31,7 +31,7 @@ for _, lsp in ipairs(servers) do
 end
 
 -- typescript
-lspconfig.tsserver.setup {
+lspconfig.ts_ls.setup {
   on_attach = on_attach,
   on_init = on_init,
   capabilities = capabilities,
diff --git a/NvChad2.5/lua/plugins/init.lua b/NvChad2.5/lua/plugins/init.lua
index e0e17da..b9ac93b 100644
--- a/NvChad2.5/lua/plugins/init.lua
+++ b/NvChad2.5/lua/plugins/init.lua
@@ -58,23 +58,49 @@ return {
         hashfile = vim.fn.stdpath "data" .. "/config-local",
 
         autocommands_create = true, -- Create autocommands (VimEnter, DirectoryChanged)
-        commands_create = true, -- Create commands (ConfigLocalSource, ConfigLocalEdit, ConfigLocalTrust, ConfigLocalIgnore)
-        silent = false, -- Disable plugin messages (Config loaded/ignored)
-        lookup_parents = true, -- Lookup config files in parent directories
+        commands_create = true,     -- Create commands (ConfigLocalSource, ConfigLocalEdit, ConfigLocalTrust, ConfigLocalIgnore)
+        silent = false,             -- Disable plugin messages (Config loaded/ignored)
+        lookup_parents = true,      -- Lookup config files in parent directories
       }
     end,
   },
   { "nvim-lua/plenary.nvim" },
   event = "InsertEnter",
   -- { "puremourning/vimspector" },
+  -- {
+  --   "codota/tabnine-nvim",
+  --   -- event = edit_events,
+  --   -- lazy = false,
+  --   config = function()
+  --     -- require("configs.tabnine")
+  --   end,
+  --   build = "./dl_binaries.sh",
+  -- },
+  -- {
+  --   "github/copilot.vim",
+  --   lazy = false,
+  --   config = function() -- Mapping tab is already used by NvChad
+  --     vim.g.copilot_no_tab_map = true;
+  --     vim.g.copilot_assume_mapped = true;
+  --     vim.g.copilot_tab_fallback = "";
+  --     -- The mapping is set to other key, see custom/lua/mappings
+  --     -- or run <leader>ch to see copilot mapping section
+  --   end
+  -- },
+
+  -- {
+  --   "zbirenbaum/copilot.lua",
+  --   event = "InsertEnter",
+  --   cmd = "Copilot",
+  --   config = function()
+  --     require("copilot").setup({})
+  --   end,
+  -- },
+
   {
-    "codota/tabnine-nvim",
-    -- event = edit_events,
-    -- lazy = false,
-    config = function()
-      -- require("configs.tabnine")
-    end,
-    build = "./dl_binaries.sh",
+    "pmizio/typescript-tools.nvim",
+    dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
+    opts = {},
   },
 
   -- These are some examples, uncomment them if you want to see them work!
@@ -99,6 +125,7 @@ return {
       filters = {
         dotfiles = true,
         git_ignored = false,
+        git_clean = false
       },
       update_focused_file = {
         enable = true,
@@ -114,7 +141,7 @@ return {
         adaptive_size = true,
       },
       renderer = {
-        highlight_git = false,
+        highlight_git = true,
         icons = {
           show = {
             file = false,
diff --git a/git/gitconfig b/git/gitconfig
index 325d4ab..4906163 100644
--- a/git/gitconfig
+++ b/git/gitconfig
@@ -28,6 +28,7 @@
 	dum = diff upstream/master
 	dom = diff origin/master
 	dh = rev-parse HEAD
+	dmain = diff origin/main
 
 	# LOG RELATED
 	ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
@@ -68,6 +69,10 @@
 	pon = push origin next
 	ponf = push -f origin next
 
+  fmain = fetch origin main
+  unmain = reset --hard origin/main
+  funmain = !git fetch origin main; git reset --hard origin/main
+
 	un = reset --hard
 	unom = reset --hard origin/master
 	unod = reset --hard origin/develop
diff --git a/tmux/tmux.conf b/tmux/tmux.conf
index d54e0f7..a5bd344 100644
--- a/tmux/tmux.conf
+++ b/tmux/tmux.conf
@@ -68,7 +68,7 @@ bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
 set -g mouse on
 
 # don't rename windows automatically
-set-option -g allow-rename off
+set-option -g allow-rename on
 set -g history-limit 100000
 
 # copy to Mac OSX clipboard
diff --git a/zsh/exports.zsh b/zsh/exports.zsh
index aa32a00..ee7edc0 100644
--- a/zsh/exports.zsh
+++ b/zsh/exports.zsh
@@ -18,6 +18,9 @@ function chpwd {
 # Slack Dev Menu
 export SLACK_DEVELOPER_MENU=true
 
+# Disable Homebrew auto update
+export HOMEBREW_NO_AUTO_UPDATE=true
+
 # Setup terminal, and turn on colors
 export LANG=en_US.UTF-8
 export EDITOR=nvim
diff --git a/zsh/functions.zsh b/zsh/functions.zsh
index 20ecf2d..170aae7 100644
--- a/zsh/functions.zsh
+++ b/zsh/functions.zsh
@@ -15,6 +15,28 @@ function zsh_recompile {
   source ~/.zshrc
 }
 
+function rename_tmux_window {
+  if [[ -n "$TMUX" ]]; then
+    # Don't change the name automatically if it's the first window
+    if [ "$(tmux display-message -p '#I')" != "0" ]; then
+      # Determine if the current directory is under 'workspace'
+      if [[ "$PWD" == *"/workspace/"* ]]; then
+        local new_name=$(basename "$PWD")
+      else
+        # Optional: Define how to handle other directories
+        local new_name=$(basename "$PWD")  # or some other logic
+      fi
+
+      # Set the new name to the tmux window
+      echo -ne "\033k${new_name}\033\\"
+      tmux rename-window "$new_name"
+
+      # Update tmux environment variable (optional)
+      tmux setenv "$(tmux display -p 'TMUX_PWD_#D')" "$PWD"
+    fi
+  fi
+}
+
 function extract {
   echo Extracting $1 ...
   if [ -f $1 ] ; then
diff --git a/zsh/history.zsh b/zsh/history.zsh
index c95bc43..a8c2c52 100644
--- a/zsh/history.zsh
+++ b/zsh/history.zsh
@@ -1,8 +1,26 @@
-# HISTORY
+# History configuration
+bindkey '^R' zaw-history
+
+if [ -z "$HISTFILE" ]; then
+  HISTFILE=$HOME/.zsh_history
+fi
+
+# Size of history
 HISTSIZE=10000
 SAVEHIST=10000
-HISTFILE=~/.zsh_history
 
-setopt hist_ignore_all_dups
+# # Show history
+# case $HIST_STAMPS in
+#   "mm/dd/yyyy") alias history='fc -fl 1' ;;
+#   "dd.mm.yyyy") alias history='fc -El 1' ;;
+#   "yyyy-mm-dd") alias history='fc -il 1' ;;
+#   *) alias history='fc -l 1' ;;
+# esac
 
-bindkey '^R' zaw-history
+# Configuration
+setopt HIST_EXPIRE_DUPS_FIRST
+setopt HIST_IGNORE_DUPS
+setopt HIST_IGNORE_ALL_DUPS
+setopt HIST_IGNORE_SPACE
+setopt HIST_FIND_NO_DUPS
+setopt HIST_SAVE_NO_DUPS
diff --git a/zsh/zshrc b/zsh/zshrc
index eb030a2..ad1147b 100644
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -14,9 +14,7 @@ source ~/.zsh/nvm.zsh
 source ~/.zsh/zoxide.zsh
 
 precmd() {
-  if [[ -n "$TMUX" ]]; then
-    tmux setenv "$(tmux display -p 'TMUX_PWD_#D')" "$PWD"
-  fi
+  rename_tmux_window
 }
 
 # OPAM configuration
-- 
2.39.5 (Apple Git-154)


Clone this wiki locally