Compare commits

...

16 Commits

8 changed files with 87 additions and 32 deletions

View File

@@ -2,6 +2,11 @@
# over system-provided programs
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.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
@@ -9,3 +14,4 @@ export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
# The original version is saved in .zprofile.pysave
# PATH="/Library/Frameworks/Python.framework/Versions/3.11/bin:$PATH"
# export PATH

View File

@@ -5,3 +5,10 @@ font:
# Colors (Terminal.app)
alt_send_esc: false
# New shells should run fish
shell:
program: /bin/bash
args:
- -c
- $SHELL

View File

@@ -18,6 +18,7 @@ get_input_df_true () {
* ) echo "Please answer yes or no.";;
esac
done
echo ""
}
get_input_df_false () {
@@ -30,6 +31,7 @@ get_input_df_false () {
* ) echo "Please answer yes or no.";;
esac
done
echo ""
}
install_font () {
@@ -37,18 +39,19 @@ install_font () {
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 () {
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!"
macos_capslock_shortcut
tbind
}
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 () {
@@ -68,6 +71,33 @@ move_config_files () {
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" "jq" "ripgrep" "watch" "tmux" "fish" "lua-language-server" "node@18" "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
}
# Promps for installing custom SF Mono font
# patched with devicons + more
get_input_df_false "Install custom font? (y/N) " install_font
@@ -77,9 +107,19 @@ if [ $MACOS ]; then
get_input_df_false "Add custom caps-lock to F10 keymap? (y/N) " macos_capslock_keymap
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
# Prompt copy config files to $HOME
get_input_df_true "Move config files to $HOME/.config? (Y/n) " move_config_files
echo "Configurating fish shell"
configure_fish

View File

@@ -68,7 +68,6 @@ abbr -a -- ghh 'git help'
abbr -a -- gignore 'git update-index --assume-unchanged'
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 -- gke '\gitk --all $(git log --walk-reflogs --pretty=%h) &!'

View File

@@ -12,3 +12,4 @@ abbr -a -- l 'tree -L 1 -a'
abbr -a -- ll 'tree -L 2 -a'
# Git (loaded from completions/git.fish)
source $HOME/.config/fish/completions/git.fish

View File

@@ -377,6 +377,11 @@ require('nvim-treesitter.configs').setup {
-- Empty nvim-tree setup using defaults
require("nvim-tree").setup()
-- Keymaps leader (space) + f to toggle nvim-tree
vim.keymap.set('n', '<leader>f', ':NvimTreeToggle<CR>', {
noremap = true
})
-- Diagnostic keymaps
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
@@ -446,12 +451,12 @@ local servers = {
-- rust_analyzer = {},
-- tsserver = {},
sumneko_lua = {
Lua = {
workspace = { checkThirdParty = false },
telemetry = { enable = false },
},
},
-- sumneko_lua = {
-- Lua = {
-- workspace = { checkThirdParty = false },
-- telemetry = { enable = false },
-- },
-- },
}
-- Setup neovim lua configuration
@@ -462,23 +467,10 @@ local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
-- Setup mason so it can manage external tooling
require('mason').setup()
require("mason").setup()
-- Ensure the servers above are installed
local mason_lspconfig = require 'mason-lspconfig'
mason_lspconfig.setup {
ensure_installed = vim.tbl_keys(servers),
}
mason_lspconfig.setup_handlers {
function(server_name)
require('lspconfig')[server_name].setup {
capabilities = capabilities,
on_attach = on_attach,
settings = servers[server_name],
}
end,
require("mason-lspconfig").setup {
ensure_installed = { "cssls", "eslint", "jsonls", "lua_ls", "pylsp", "rust_analyzer", "svelte", "tsserver", "vimls", "volar" },
}
-- Turn on lsp status information

10
scripts/tbind.sh Normal file
View 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!"

View File

@@ -1,4 +1,3 @@
# remap previx from 'C-b' to 'F10' and should
# map caps-lock to F10
unbind-key C-b
@@ -12,3 +11,4 @@ set -s escape-time 1
set -g mouse on
set -g default-terminal "xterm-256color"
# set-option -g default-shell /opt/homebrew/bin/fish