mirror of
				https://github.com/KevinMidboe/chsh.git
				synced 2025-10-29 12:30:13 +00:00 
			
		
		
		
	Compare commits
	
		
			23 Commits
		
	
	
		
			e248c9e09c
			...
			main
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 6f207d438e | |||
| 9c4dd4a112 | |||
| 84a0ed4d1d | |||
| 2c2abb0fc8 | |||
| b881418b33 | |||
| 9a27a5c4de | |||
| 7de8868891 | |||
| bc5ea010d7 | |||
| 36a509e619 | |||
| d0f7f10220 | |||
| 1ebbf5b43f | |||
| 23fa1fd8d6 | |||
| a53bfa8d12 | |||
| 262db2054f | |||
| 6c61ad5b21 | |||
| c1bcd8bd4f | |||
| 66cc4fc9e2 | |||
| a6fe9541dd | |||
| 3528151d0f | |||
| 45e1724280 | |||
| d1fe6943de | |||
| fff77cf5d2 | |||
| f133917b3e | 
							
								
								
									
										11
									
								
								.profile
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								.profile
									
									
									
									
									
								
							@@ -2,6 +2,11 @@
 | 
				
			|||||||
# over system-provided programs
 | 
					# over system-provided programs
 | 
				
			||||||
export PATH="/usr/local/bin:$PATH"
 | 
					export PATH="/usr/local/bin:$PATH"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Add homebrew arm64 install path if applicable
 | 
				
			||||||
 | 
					if test $(uname -m) = "arm64"
 | 
				
			||||||
 | 
					  export PATH="/opt/homebrew/bin:$PATH"
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# MacPorts Installer rddition on 2022-10-31_at_23:07:29: adding an appropriate PATH variable for use with MacPorts.
 | 
					# MacPorts Installer rddition on 2022-10-31_at_23:07:29: adding an appropriate PATH variable for use with MacPorts.
 | 
				
			||||||
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
 | 
					export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -9,3 +14,9 @@ export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
 | 
				
			|||||||
# The original version is saved in .zprofile.pysave
 | 
					# The original version is saved in .zprofile.pysave
 | 
				
			||||||
# PATH="/Library/Frameworks/Python.framework/Versions/3.11/bin:$PATH"
 | 
					# PATH="/Library/Frameworks/Python.framework/Versions/3.11/bin:$PATH"
 | 
				
			||||||
# export PATH
 | 
					# export PATH
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Setting go environment
 | 
				
			||||||
 | 
					export GOPATH=$HOME/dev/go
 | 
				
			||||||
 | 
					export GOROOT="$(brew --prefix golang)/libexec"
 | 
				
			||||||
 | 
					export PATH="$PATH:$GOPATH/bin:$GOROOT/bin"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,4 +4,11 @@ font:
 | 
				
			|||||||
    family: SFMono Nerd Font
 | 
					    family: SFMono Nerd Font
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Colors (Terminal.app)
 | 
					# Colors (Terminal.app)
 | 
				
			||||||
 | 
					alt_send_esc: false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# New shells should run fish
 | 
				
			||||||
 | 
					shell:
 | 
				
			||||||
 | 
					  program: /bin/bash
 | 
				
			||||||
 | 
					  args:
 | 
				
			||||||
 | 
					    - -c
 | 
				
			||||||
 | 
					    - $SHELL
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										65
									
								
								deploy.sh
									
									
									
									
									
								
							
							
						
						
									
										65
									
								
								deploy.sh
									
									
									
									
									
								
							@@ -18,6 +18,7 @@ get_input_df_true () {
 | 
				
			|||||||
            * ) echo "Please answer yes or no.";;
 | 
					            * ) echo "Please answer yes or no.";;
 | 
				
			||||||
        esac
 | 
					        esac
 | 
				
			||||||
     done
 | 
					     done
 | 
				
			||||||
 | 
					     echo ""
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
get_input_df_false () {
 | 
					get_input_df_false () {
 | 
				
			||||||
@@ -30,6 +31,7 @@ get_input_df_false () {
 | 
				
			|||||||
            * ) echo "Please answer yes or no.";;
 | 
					            * ) echo "Please answer yes or no.";;
 | 
				
			||||||
        esac
 | 
					        esac
 | 
				
			||||||
     done
 | 
					     done
 | 
				
			||||||
 | 
					     echo ""
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
install_font () {
 | 
					install_font () {
 | 
				
			||||||
@@ -37,18 +39,19 @@ install_font () {
 | 
				
			|||||||
    open $PWD/fonts/*
 | 
					    open $PWD/fonts/*
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					macos_capslock_shortcut() {
 | 
				
			||||||
 | 
					    cp scripts/tbind.sh /usr/local/bin/tbind
 | 
				
			||||||
 | 
					    chmod +x /usr/local/bin/tbind
 | 
				
			||||||
 | 
					    echo "Created tmux capslock keymap command as tbind"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
macos_capslock_keymap () {
 | 
					macos_capslock_keymap () {
 | 
				
			||||||
    CAPS_KEY=0x700000039
 | 
					    macos_capslock_shortcut
 | 
				
			||||||
    F10_KEY=0x700000043
 | 
					    tbind
 | 
				
			||||||
 | 
					 | 
				
			||||||
    DATA=$(printf '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":%s,"HIDKeyboardModifierMappingDst":%s}]}' $CAPS_KEY $F10_KEY)
 | 
					 | 
				
			||||||
    hidutil property --set $DATA
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    echo "Successfully overwrote CAPS KEY to F10!"
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
get_config_files() {
 | 
					get_config_files() {
 | 
				
			||||||
  CONFIG_FILES=$(find * -type f -path "**/*" ! -path ".*" ! -path "fonts/*")
 | 
					  CONFIG_FILES=$(find * -type f -path "**/*" ! -path ".*" ! -path "fonts/*" ! -path "scripts/*")
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
move_config_files () {
 | 
					move_config_files () {
 | 
				
			||||||
@@ -60,7 +63,7 @@ move_config_files () {
 | 
				
			|||||||
    DIR=$( echo $file | cut -d/ -f 1 )
 | 
					    DIR=$( echo $file | cut -d/ -f 1 )
 | 
				
			||||||
    FILE=$( echo $file | cut -d/ -f 2 )
 | 
					    FILE=$( echo $file | cut -d/ -f 2 )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    mkdir -p "$HOME/$DIR"
 | 
					    mkdir -p "$HOME/.config/$DIR"
 | 
				
			||||||
    cp $file "$HOME/.config/$file"
 | 
					    cp $file "$HOME/.config/$file"
 | 
				
			||||||
    COUNT=$((COUNT + 1))
 | 
					    COUNT=$((COUNT + 1))
 | 
				
			||||||
  done <<< $CONFIG_FILES
 | 
					  done <<< $CONFIG_FILES
 | 
				
			||||||
@@ -68,6 +71,41 @@ move_config_files () {
 | 
				
			|||||||
  printf "Moved %s config files!\n" $COUNT
 | 
					  printf "Moved %s config files!\n" $COUNT
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					move_profile_file () {
 | 
				
			||||||
 | 
					  cp .profile $HOME
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  echo "Moved .profile file!"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					install_packages_brew () {
 | 
				
			||||||
 | 
					    declare -a packages=("cmake" "tree" "wget" "httpie" "jq" "ripgrep" "watch" "tmux" "fish" "lua-language-server" "node@18" "golang" "gh")
 | 
				
			||||||
 | 
					    echo "Installing ${#packages[@]} packages from brew"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    brew install --quiet "${packages[@]}"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					configure_fish () {
 | 
				
			||||||
 | 
					    brew install --quiet fish
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # oh-my-fish does not exist
 | 
				
			||||||
 | 
					    if [ ! -d "$HOME/.local/share/omf" ]; then
 | 
				
			||||||
 | 
					        curl -s "https://raw.githubusercontent.com/oh-my-fish/oh-my-fish/master/bin/install" > install
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        fish install --noninteractive
 | 
				
			||||||
 | 
					        rm install
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        printf "oh-my-fish already configured!\n\n"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					configure_go () {
 | 
				
			||||||
 | 
					    fish -c source $HOME/.profile
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if ( grep -q GOPATH "$HOME/.profile" ) && [ ! -d $GOPATH ]; then
 | 
				
			||||||
 | 
					        mkdir -p $GOPATH $GOPATH/{bin,pkg}
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Promps for installing custom SF Mono font
 | 
					# Promps for installing custom SF Mono font
 | 
				
			||||||
# patched with devicons + more
 | 
					# patched with devicons + more
 | 
				
			||||||
get_input_df_false "Install custom font? (y/N) " install_font
 | 
					get_input_df_false "Install custom font? (y/N) " install_font
 | 
				
			||||||
@@ -77,9 +115,18 @@ if [ $MACOS ]; then
 | 
				
			|||||||
   get_input_df_false "Add custom caps-lock to F10 keymap? (y/N) " macos_capslock_keymap
 | 
					   get_input_df_false "Add custom caps-lock to F10 keymap? (y/N) " macos_capslock_keymap
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					get_input_df_true "Add .profile file? (Y/n) " move_profile_file
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Installed common packages from brew
 | 
				
			||||||
 | 
					get_input_df_true "Install brew packages? (Y/n) " install_packages_brew
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Get config files to copy info $HOME/.config
 | 
					# Get config files to copy info $HOME/.config
 | 
				
			||||||
get_config_files
 | 
					get_config_files
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Prompt copy config files to $HOME
 | 
					# Prompt copy config files to $HOME
 | 
				
			||||||
get_input_df_true "Move config files to $HOME/.config? (Y/n) " move_config_files
 | 
					get_input_df_true "Move config files to $HOME/.config? (Y/n) " move_config_files
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo "Configurating fish shell"
 | 
				
			||||||
 | 
					configure_fish
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					configure_go
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -68,7 +68,6 @@ abbr -a -- ghh 'git help'
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
abbr -a -- gignore 'git update-index --assume-unchanged'
 | 
					abbr -a -- gignore 'git update-index --assume-unchanged'
 | 
				
			||||||
abbr -a -- gignored 'git ls-files -v | grep "^[[:lower:]]"'
 | 
					abbr -a -- gignored 'git ls-files -v | grep "^[[:lower:]]"'
 | 
				
			||||||
abbr -a -- git svn-dcommit-push='git svn dcommit && git push github $(git_main_branch):svntrunk'
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
abbr -a -- gk '\gitk --all --branches &!'
 | 
					abbr -a -- gk '\gitk --all --branches &!'
 | 
				
			||||||
abbr -a -- gke '\gitk --all $(git log --walk-reflogs --pretty=%h) &!'
 | 
					abbr -a -- gke '\gitk --all $(git log --walk-reflogs --pretty=%h) &!'
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,3 +12,4 @@ abbr -a -- l 'tree -L 1 -a'
 | 
				
			|||||||
abbr -a -- ll 'tree -L 2 -a'
 | 
					abbr -a -- ll 'tree -L 2 -a'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Git (loaded from completions/git.fish)
 | 
					# Git (loaded from completions/git.fish)
 | 
				
			||||||
 | 
					source $HOME/.config/fish/completions/git.fish
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -377,6 +377,11 @@ require('nvim-treesitter.configs').setup {
 | 
				
			|||||||
-- Empty nvim-tree setup using defaults
 | 
					-- Empty nvim-tree setup using defaults
 | 
				
			||||||
require("nvim-tree").setup()
 | 
					require("nvim-tree").setup()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Keymaps leader (space) + f to toggle nvim-tree
 | 
				
			||||||
 | 
					vim.keymap.set('n', '<leader>f', ':NvimTreeToggle<CR>', {
 | 
				
			||||||
 | 
					  noremap = true
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- Diagnostic keymaps
 | 
					-- Diagnostic keymaps
 | 
				
			||||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
 | 
					vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
 | 
				
			||||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
 | 
					vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
 | 
				
			||||||
@@ -440,18 +445,19 @@ end
 | 
				
			|||||||
--  Add any additional override configuration in the following tables. They will be passed to
 | 
					--  Add any additional override configuration in the following tables. They will be passed to
 | 
				
			||||||
--  the `settings` field of the server config. You must look up that documentation yourself.
 | 
					--  the `settings` field of the server config. You must look up that documentation yourself.
 | 
				
			||||||
local servers = {
 | 
					local servers = {
 | 
				
			||||||
  -- clangd = {},
 | 
					  clangd = {},
 | 
				
			||||||
  -- gopls = {},
 | 
					  cssls = {},
 | 
				
			||||||
  -- pyright = {},
 | 
					  eslint = {},
 | 
				
			||||||
  -- rust_analyzer = {},
 | 
					  jsonls = {},
 | 
				
			||||||
  -- tsserver = {},
 | 
					  golangci_lint_ls = {},
 | 
				
			||||||
 | 
					  gopls = {},
 | 
				
			||||||
  sumneko_lua = {
 | 
					  lua_ls = {},
 | 
				
			||||||
    Lua = {
 | 
					  pylsp = {},
 | 
				
			||||||
      workspace = { checkThirdParty = false },
 | 
					  rust_analyzer = {},
 | 
				
			||||||
      telemetry = { enable = false },
 | 
					  svelte = {},
 | 
				
			||||||
    },
 | 
					  tsserver = {},
 | 
				
			||||||
  },
 | 
					  vimls = {},
 | 
				
			||||||
 | 
					  volar = {},
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- Setup neovim lua configuration
 | 
					-- Setup neovim lua configuration
 | 
				
			||||||
@@ -462,11 +468,10 @@ local capabilities = vim.lsp.protocol.make_client_capabilities()
 | 
				
			|||||||
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
 | 
					capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- Setup mason so it can manage external tooling
 | 
					-- Setup mason so it can manage external tooling
 | 
				
			||||||
require('mason').setup()
 | 
					require("mason").setup()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- Ensure the servers above are installed
 | 
					-- Configure lspconfig for each server
 | 
				
			||||||
local mason_lspconfig = require 'mason-lspconfig'
 | 
					local mason_lspconfig = require 'mason-lspconfig'
 | 
				
			||||||
 | 
					 | 
				
			||||||
mason_lspconfig.setup {
 | 
					mason_lspconfig.setup {
 | 
				
			||||||
  ensure_installed = vim.tbl_keys(servers),
 | 
					  ensure_installed = vim.tbl_keys(servers),
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										10
									
								
								scripts/tbind.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								scripts/tbind.sh
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
				
			|||||||
 | 
					#!/bin/sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					CAPS_KEY=0x700000039
 | 
				
			||||||
 | 
					F10_KEY=0x700000043
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					DATA=$(printf '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":%s,"HIDKeyboardModifierMappingDst":%s}]}' $CAPS_KEY $F10_KEY)
 | 
				
			||||||
 | 
					hidutil property --set $DATA
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo "Successfully overwrote CAPS KEY to F10!"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1,4 +1,3 @@
 | 
				
			|||||||
 | 
					 | 
				
			||||||
# remap previx from 'C-b' to 'F10' and should
 | 
					# remap previx from 'C-b' to 'F10' and should
 | 
				
			||||||
# map caps-lock to F10
 | 
					# map caps-lock to F10
 | 
				
			||||||
unbind-key C-b
 | 
					unbind-key C-b
 | 
				
			||||||
@@ -12,3 +11,4 @@ set -s escape-time 1
 | 
				
			|||||||
set -g mouse on
 | 
					set -g mouse on
 | 
				
			||||||
 | 
					
 | 
				
			||||||
set -g default-terminal "xterm-256color"
 | 
					set -g default-terminal "xterm-256color"
 | 
				
			||||||
 | 
					# set-option -g default-shell /opt/homebrew/bin/fish
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user