Skip to content

Commit 5401bce

Browse files
committed
Changes for apple silicon, updates
1 parent f92b9e1 commit 5401bce

File tree

10 files changed

+69
-102
lines changed

10 files changed

+69
-102
lines changed

fish/config.fish

+16-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,15 @@ set -x fish_color_autosuggestion blue
1818
set -x fish_color_error red
1919
# set gpg tty
2020
set -x GPG_TTY (eval tty)
21+
2122
# PATH
23+
# for apple intel
2224
test -d /usr/local/bin ;and set PATH /usr/local/bin $PATH
2325
test -d /usr/local/sbin ;and set PATH /usr/local/sbin $PATH
26+
# for apple silicon
27+
test -d /opt/homebrew/bin ;and set PATH /opt/homebrew/bin $PATH
28+
test -d /opt/homebrew/sbin ;and set PATH /opt/homebrew/sbin $PATH
29+
2430
# Set GO lang path
2531
test -d $HOME/go ;and set -x GOPATH $HOME/go ;and set PATH $GOPATH/bin $PATH
2632
test -d /usr/local/opt/go/libexec ;and set -x GOROOT /usr/local/opt/go/libexec ;and set PATH $GOROOT/bin $PATH
@@ -316,13 +322,21 @@ function dcr ; docker-compose run $argv ; end
316322
# Tree always with color
317323
function tc ; tree -C ; end
318324

325+
function tunnel_webhook_api ; ssh -L6550:webhook-api-staging-v1.c3owtriowgpi.us-west-2.rds.amazonaws.com:5432 ssm-user@bzero-i-0135c06b28990deca ; end
326+
function tunnel_webhook_api_prod ; ssh -L6551:webhook-api-prod-db-v1.c3owtriowgpi.us-west-2.rds.amazonaws.com:5432 ssm-user@bzero-i-01772b4038ba99673 ; end
327+
319328
# add asdf to $PATH
320-
# status --is-interactive; and source /usr/local/opt/asdf/asdf.fish
321-
# test -d /usr/local/opt/asdf/ ;and source /usr/local/opt/asdf/asdf.fish
329+
# for apple intel
322330
test -d /usr/local/opt/asdf/ ;and source /usr/local/opt/asdf/libexec/asdf.fish
331+
# for apple silicon
332+
test -d /opt/homebrew/opt/asdf/ ;and source /opt/homebrew/opt/asdf/libexec/asdf.fish
323333

324334
# direnv config
325335
test -x /usr/local/bin/direnv ;and eval (direnv hook fish)
326336

327337
# bat config
328338
test -x /usr/local/bin/bat ;and set -x BAT_THEME ansi-dark
339+
340+
# custom
341+
342+
set -x AWS_REGION us-west-2

fish/functions/fish_prompt.fish

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
function _git_branch_name
2-
echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
2+
echo (command git symbolic-ref HEAD 2>/dev/null | sed -e 's|^refs/heads/||')
33
end
44

55
function _git_status_symbol
6-
set -l git_status (git status --porcelain ^/dev/null)
6+
set -l git_status (git status --porcelain 2>/dev/null)
77
if test -n "$git_status"
8-
if git status --porcelain ^/dev/null | grep '^.[^ ]' >/dev/null
8+
if git status --porcelain 2>/dev/null | grep '^.[^ ]' >/dev/null
99
echo '*' # dirty
1010
else
1111
echo '#' # all staged

gitconfig

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
[user]
22
name = Pedro G. Galaviz
33
4-
signingkey = 8A2AD35B2A837574
5-
6-
[commit]
7-
gpgsign = true
84

95
[core]
106
pager = delta
@@ -30,4 +26,4 @@
3026
diffFilter = delta --color-only
3127

3228
[init]
33-
defaultBranch = main
29+
defaultBranch = main

nvim/init.lua

Whitespace-only changes.

nvim/init.vim

+25-5
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,44 @@
66
" /_/ \___/\___/\_,_/_/\_,_/|___/_//__/
77

88

9-
scriptencoding utf-8
10-
set encoding=utf-8
9+
lua <<EOF
10+
print('hello from lua')
11+
12+
vim.g.scriptencoding = 'utf-8'
13+
vim.g.encoding = 'utf-8'
14+
15+
vim.g.config_path = '~/.config/nvim/'
16+
17+
-- Python 3 is needed for some plugins to work
18+
vim.g.python3_host_prog = '/opt/homebrew/bin/python3'
19+
20+
-- I like block & always blinking cursor
21+
vim.opt.guicursor = 'a:block-blinkwait100-blinkoff150-blinkon175'
22+
23+
require('settings')
24+
25+
EOF
26+
27+
" scriptencoding utf-8
28+
" set encoding=utf-8
1129

1230
" Use full Vim features
1331
set nocompatible
1432

1533
" Config file path
16-
let g:config_path = "~/.config/nvim/"
34+
" let g:config_path = "~/.config/nvim/"
1735

1836
" Function for sourcing config modules
1937
function! ConfigInc(module)
2038
execute 'source ' . fnameescape(g:config_path) . fnameescape(a:module)
2139
endfunction
2240

2341
" Python 3 is needed for some plugins to work
24-
let g:python3_host_prog = '/usr/local/bin/python3'
42+
" let g:python3_host_prog = '/opt/homebrew/bin/python3'
2543

2644
set termguicolors
2745
" I like block & always blinking cursor
28-
set guicursor=a:block-blinkwait100-blinkoff150-blinkon175
46+
" set guicursor=a:block-blinkwait100-blinkoff150-blinkon175
2947

3048
" -------------------------------------------------------------------------------------------
3149
" SETTINGS
@@ -151,6 +169,7 @@ vmap <leader>C <Plug>(sad-change-backward)
151169
" Move line down
152170
nmap <Plug>MoveLineDown
153171
nmap <Plug>MoveLineDown
172+
nmap <silent> <M-j> <Plug>MoveLineDown
154173
155174
" Move block down
156175
vmap <Plug>MoveBlockDown
@@ -159,6 +178,7 @@ vmap ∆ <Plug>MoveBlockDown
159178
" Move line up
160179
nmap § <Plug>MoveLineUp
161180
nmap ˚ <Plug>MoveLineUp
181+
nmap <silent> <M-k> <Plug>MoveLineDown
162182
163183
" Move block up
164184
vmap § <Plug>MoveBlockUp

nvim/lua/settings.lua

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
-- -------------------------------------------------------------------------------------------
3+
-- SETTINGS
4+
-- -------------------------------------------------------------------------------------------
5+
6+
-- Remap leader (Use space as leader)
7+
vim.g.mapleader = ' '
8+
9+
-- Map local leader
10+
vim.g.maplocalleader = ','

nvim/plugin/denite.vim

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ autocmd FileType denite-filter call s:denite_filter_settings()
2323

2424
function! s:denite_filter_settings() abort
2525
imap <silent><buffer> kj
26-
\ <Plug>(denite_filter_quit)
26+
\ <Plug>(denite_filter_update)
2727
imap <silent><buffer> jk
28-
\ <Plug>(denite_filter_quit)
28+
\ <Plug>(denite_filter_update)
2929
inoremap <silent><buffer><expr> <Esc>
3030
\ denite#do_map('quit')
3131
nnoremap <silent><buffer><expr> <Esc>

nvim/plugins.vim

+2-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ Plug 'Shougo/neco-syntax' " Syntax source
134134
Plug 'github/copilot.vim'
135135

136136
" Language Server Protocol (LSP)
137-
Plug 'autozimu/LanguageClient-neovim', { 'branch': 'next', 'do': 'bash install.sh' }
137+
" Plug 'autozimu/LanguageClient-neovim', { 'branch': 'next', 'do': 'bash install.sh' }
138+
Plug 'neovim/nvim-lspconfig' " Neovim LSP
138139

139140
" Snippets
140141
Plug 'Shougo/neosnippet.vim' " Snippets support

nvim/settings.vim

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
" -------------------------------------------------------------------------------------------
55

66
" Remap leader (Use space as leader)
7-
let g:mapleader = ' '
7+
" let g:mapleader = ' '
88
" Map local leader
9-
let g:maplocalleader = ','
9+
" let g:maplocalleader = ','
1010

1111
" Release keymappings prefixes, evict entirely for use of plug-ins.
1212
nnoremap <Space> <Nop>

scripts/osx.sh

+8-82
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ else
1313
echo_item "Homebrew is not installed and is required for configuration!" yellow
1414
if get_boolean_response "Do you want to install Homebrew?"; then
1515
echo_item "Installing Homebrew, this can take some time..." yellow
16+
1617
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
18+
1719
echo_item "Done!" green
1820
else
1921
echo_item "Skipping Homebrew installation..." red
@@ -47,28 +49,6 @@ echo "--------------------------------------------------------------------------
4749

4850

4951

50-
# Install Node -----------------------------------------------------------------
51-
# ------------------------------------------------------------------------------
52-
if exists "node"; then
53-
echo_item "Node.js is correctly installed." green
54-
else
55-
echo_item "Node.js is not installed and is required for some tools to work." yellow
56-
if get_boolean_response "Do you want to install Node?"; then
57-
echo_item "Installing Node..." yellow
58-
brew install node
59-
brew install yarn
60-
# Centralize global npm packages for different node versions
61-
echo "prefix = /usr/local" > ~/.npmrc
62-
echo_item "Done!" green
63-
else
64-
echo_item "Skipping Node.js installation..." red
65-
echo_item "Node is a very useful tool, you'll probably need it."
66-
fi
67-
fi
68-
echo "--------------------------------------------------------------------------"
69-
70-
71-
7252
# Install Utilities ------------------------------------------------------------
7353
# ------------------------------------------------------------------------------
7454
packages=(
@@ -77,10 +57,6 @@ packages=(
7757
"gpg"
7858
"python3"
7959
"tree"
80-
"reattach-to-user-namespace"
81-
"minikube"
82-
"kubernetes-cli"
83-
"redis"
8460
"direnv"
8561
"bat"
8662
"git-delta"
@@ -90,7 +66,6 @@ do
9066
brew install $i
9167
echo "--------"
9268
done
93-
brew services start redis
9469
echo_item "Done!" green
9570
echo "--------------------------------------------------------------------------"
9671

@@ -119,15 +94,11 @@ echo "Includes: flux, divvy, keka, macdown and others..."
11994
if get_boolean_response "Do you want to install this apps?"; then
12095
echo_item "Installing apps..." yellow
12196
apps=(
122-
"phoenix"
12397
"flux"
12498
"keka"
12599
"macdown"
126100
"the-unarchiver"
127101
"appcleaner"
128-
"postgres"
129-
"kitematic"
130-
"alacritty"
131102
)
132103
for i in "${apps[@]}"
133104
do
@@ -152,7 +123,7 @@ if get_boolean_response "Do you want to install and use Fish shell?"; then
152123
echo_item "Installing Fish shell..." yellow
153124
brew install fish
154125
echo_item "Changing to Fish shell... Might require password:" yellow
155-
echo /usr/local/bin/fish | sudo tee -a /etc/shells
126+
echo $(which fish) | sudo tee -a /etc/shells
156127
chsh -s $(which fish)
157128
echo_item "Fish shell successfully installed!" green
158129
echo "--------------------------------------------------------------------------"
@@ -179,25 +150,6 @@ echo "--------------------------------------------------------------------------
179150

180151

181152

182-
# Install Hyper.js -------------------------------------------------------------
183-
# ------------------------------------------------------------------------------
184-
echo_item "Hyper.js terminal:" blue
185-
if get_boolean_response "Do you want to install Hyper.js Terminal?"; then
186-
echo_item "Installing Hyper.js..." yellow
187-
brew install hyper
188-
echo_item "Hyper.js successfully installed!" green
189-
echo "--------------------------------------------------------------------------"
190-
echo_item "Symlinking Hyper.js configuration..." yellow
191-
ln -sf `pwd`/hyper/hyper.js ~/.hyper.js
192-
echo_item "Done!" green
193-
else
194-
echo_item "Skipping Hyper.js installation..." red
195-
echo_item "You'll need a true color terminal emulator like iTerm2 or Hyper.js"
196-
fi
197-
echo "--------------------------------------------------------------------------"
198-
199-
200-
201153
# Install asdf ----------------------------------------------------------------
202154
# ------------------------------------------------------------------------------
203155
echo_item "asdf version manager (manage many languages versions):" blue
@@ -208,6 +160,7 @@ if get_boolean_response "Do you want to install asdf?"; then
208160
asdf plugin-add erlang
209161
asdf plugin-add elixir
210162
asdf plugin-add nodejs
163+
asdf install nodejs 20.11.1
211164
echo_item "asdf successfully installed!" green
212165
else
213166
echo_item "Skipping asdf installation..."
@@ -259,13 +212,15 @@ if get_boolean_response "Do you want to install Neovim?"; then
259212
mkdir -p ~/.config/nvim
260213
mkdir -p ~/.config/nvim/plugin
261214
ln -sf `pwd`/nvim/init.vim ~/.config/nvim/
215+
ln -sf `pwd`/nvim/init.lua ~/.config/nvim/
262216
ln -sf `pwd`/nvim/plugins.vim ~/.config/nvim/
263217
ln -sf `pwd`/nvim/functions.vim ~/.config/nvim/
264218
ln -sf `pwd`/nvim/autocmds.vim ~/.config/nvim/
265219
ln -sf `pwd`/nvim/keybindings.vim ~/.config/nvim/
266220
ln -sf `pwd`/nvim/settings.vim ~/.config/nvim/
267221
ln -sf `pwd`/nvim/editorconfig ~/.editorconfig
268222
ln -sf `pwd`/nvim/plugin/*.vim ~/.config/nvim/plugin/
223+
ln -sf `pwd`/nvim/lua/*.lua ~/.config/nvim/lua/
269224
echo_item "Done!" green
270225
echo "--------------------------------------------------------------------------"
271226
echo_item "Downloading Neovim python 3 client..." yellow
@@ -309,15 +264,13 @@ modules=(
309264
"standard"
310265
"prettier"
311266
"javascript-typescript-langserver"
312-
"vue-language-server"
313267
)
314268
echo_item "Node Global Packages:" blue
315269
echo_item "Packages:"
316270
echo "- standard (JS style, linting & formater)"
317271
echo "- prettier (Style formater for css, json and scss)"
318272
echo "- tern (required for Neovim JS linting)"
319273
echo "- javascript-typescript-langserver (Language Server for Javascript)\n"
320-
echo "- vue-language-server (Language Server for Vue.js)\n"
321274
if get_boolean_response "Do you want to install these global packages?"; then
322275
if get_boolean_response "Do you want to use yarn?"; then
323276
echo_item "Installing packages with yarn..." yellow
@@ -375,7 +328,7 @@ echo "--------------------------------------------------------------------------
375328
echo_item "Elixir:" blue
376329
if get_boolean_response "Do you want to install the Elixir programming language?"; then
377330
echo_item "Installing Elixir..." yellow
378-
brew install elixir
331+
asdf install elixir 1.16.1-otp-26
379332
echo_item "Elixir successfully installed!" green
380333
else
381334
echo_item "Skipping Elixir installation..."
@@ -384,20 +337,6 @@ echo "--------------------------------------------------------------------------
384337

385338

386339

387-
# Install Crystal --------------------------------------------------------------
388-
# ------------------------------------------------------------------------------
389-
echo_item "Crystal:" blue
390-
if get_boolean_response "Do you want to install the Crystal programming language?"; then
391-
echo_item "Installing Crystal..." yellow
392-
brew install crystal-lang
393-
echo_item "Crystal successfully installed!" green
394-
else
395-
echo_item "Skipping Crystal installation..."
396-
fi
397-
echo "--------------------------------------------------------------------------"
398-
399-
400-
401340
# Install Rust -----------------------------------------------------------------
402341
# ------------------------------------------------------------------------------
403342
echo_item "Rust:" blue
@@ -423,10 +362,8 @@ echo "--------------------------------------------------------------------------
423362
# ------------------------------------------------------------------------------
424363
echo_item "Ctags:" blue
425364
if get_boolean_response "Do you want to install Ctags?"; then
426-
echo_item "Brew tapping Universal Ctags..." yellow
427-
brew tap universal-ctags/universal-ctags
428365
echo_item "Installing Universal Ctags..." yellow
429-
brew install --HEAD universal-ctags
366+
brew install universal-ctags
430367
echo_item "Done!" green
431368
echo "--------------------------------------------------------------------------"
432369
echo_item "Symlinking custom Ctags..." yellow
@@ -480,17 +417,6 @@ ln -sf `pwd`/default-gems ~/.default-gems
480417
ln -sf `pwd`/gitconfig ~/.gitconfig
481418
ln -sf `pwd`/gitignore_global ~/.gitignore_global
482419

483-
echo_item "Creating phoenix symlinks..." yellow
484-
mkdir -p ~/.config/phoenix
485-
mkdir -p ~/.config/phoenix/config
486-
mkdir -p ~/.config/phoenix/helpers
487-
mkdir -p ~/.config/phoenix/shortcuts
488-
mkdir -p ~/.config/phoenix/spaces
489-
ln -sf `pwd`/phoenix/phoenix.js ~/.config/phoenix/
490-
ln -sf `pwd`/phoenix/config/*.js ~/.config/phoenix/config/
491-
ln -sf `pwd`/phoenix/helpers/*.js ~/.config/phoenix/helpers/
492-
ln -sf `pwd`/phoenix/shortcuts/*.js ~/.config/phoenix/shortcuts/
493-
ln -sf `pwd`/phoenix/spaces/*.js ~/.config/phoenix/spaces/
494420

495421

496422
echo_item "All done here!" blue

0 commit comments

Comments
 (0)