Compare commits

...

23 Commits

Author SHA1 Message Date
6f207d438e Make sure go directories exists 2023-03-26 15:31:39 +02:00
9c4dd4a112 Remove pyright lsp server 2023-03-26 15:31:17 +02:00
84a0ed4d1d Require httpie package from brew 2023-03-26 15:31:00 +02:00
2c2abb0fc8 Configure lspconfig for each lsp server required 2023-03-26 15:00:39 +02:00
b881418b33 Add golang to brew pkgs & go env vars to .profile 2023-03-26 14:56:49 +02:00
9a27a5c4de Add node@18 to default brew packages 2023-03-25 15:02:41 +01:00
7de8868891 Make sure lua LSP is installed by brew 2023-03-25 15:01:12 +01:00
bc5ea010d7 Unsure default lsp servers are installed by mason 2023-03-25 14:53:10 +01:00
36a509e619 Disable sumneko_lua mason package 2023-03-25 14:30:19 +01:00
d0f7f10220 Move config before setting up fish 2023-03-25 14:25:45 +01:00
1ebbf5b43f Profile converted to fish syntax 2023-03-25 14:23:13 +01:00
23fa1fd8d6 Start alacritty with bash calling default shell 2023-03-25 14:04:00 +01:00
a53bfa8d12 Scripts/ for misc, start with tbind 2023-03-25 14:03:25 +01:00
262db2054f Configure fish func with omf 2023-03-25 14:03:05 +01:00
6c61ad5b21 Try disable explicit default SHELL declaration 2023-03-25 14:02:22 +01:00
c1bcd8bd4f Use fenv (from omf) to source profile 2023-03-25 14:01:53 +01:00
66cc4fc9e2 Only add arm homebrew dir when uname matches 2023-03-25 14:00:31 +01:00
a6fe9541dd New keymap to toggle nvim tree sidebar file explorer 2023-03-25 11:33:35 +01:00
3528151d0f Load git completions on fish init 2023-03-25 11:33:12 +01:00
45e1724280 Open fish shell in alacritty & tmux 2023-03-25 11:32:43 +01:00
d1fe6943de Add homebrew path to .profile 2023-03-25 11:32:06 +01:00
fff77cf5d2 Place files in .config folder 2023-02-06 10:36:58 +01:00
f133917b3e Prevent alt key from escaping. 2023-02-06 10:36:39 +01:00
8 changed files with 106 additions and 26 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,9 @@ 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
# Setting go environment
export GOPATH=$HOME/dev/go
export GOROOT="$(brew --prefix golang)/libexec"
export PATH="$PATH:$GOPATH/bin:$GOROOT/bin"

View File

@@ -4,4 +4,11 @@ font:
family: SFMono Nerd 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 () {
@@ -60,7 +63,7 @@ move_config_files () {
DIR=$( echo $file | cut -d/ -f 1 )
FILE=$( echo $file | cut -d/ -f 2 )
mkdir -p "$HOME/$DIR"
mkdir -p "$HOME/.config/$DIR"
cp $file "$HOME/.config/$file"
COUNT=$((COUNT + 1))
done <<< $CONFIG_FILES
@@ -68,6 +71,41 @@ 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" "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
# patched with devicons + more
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
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
configure_go

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)
@@ -440,18 +445,19 @@ end
-- 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.
local servers = {
-- clangd = {},
-- gopls = {},
-- pyright = {},
-- rust_analyzer = {},
-- tsserver = {},
sumneko_lua = {
Lua = {
workspace = { checkThirdParty = false },
telemetry = { enable = false },
},
},
clangd = {},
cssls = {},
eslint = {},
jsonls = {},
golangci_lint_ls = {},
gopls = {},
lua_ls = {},
pylsp = {},
rust_analyzer = {},
svelte = {},
tsserver = {},
vimls = {},
volar = {},
}
-- Setup neovim lua configuration
@@ -462,11 +468,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
-- Configure lspconfig for each server
local mason_lspconfig = require 'mason-lspconfig'
mason_lspconfig.setup {
ensure_installed = vim.tbl_keys(servers),
}

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