fix tmux and other stuff

This commit is contained in:
Noah Masur 2020-08-01 20:06:16 -04:00
parent a3026b91ba
commit fa5850db16
11 changed files with 117 additions and 103 deletions

View File

@ -366,7 +366,7 @@ shell:
args: args:
- --login - --login
- --init-command - --init-command
- tmux a -t noah || eval (security find-generic-password -s 1Password -w | op signin enterprise_console) && tmux new -s noah - tmux a -t noah || tmux new -s noah
# Startup directory # Startup directory
# #

4
bin/reset_1p Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
security find-generic-password -s 1Password -w | op signin enterprise_console --output=raw > $HOME/.op_tmux_token_tmp

12
bin/weather_cached Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
CACHE_FILE="$HOME/.tmux/.weather_cache"
CACHE_TIME=$(stat -f %m $CACHE_FILE)
NOW_TIME=$(date +%s)
TIME_PASSED=$((NOW_TIME-CACHE_TIME))
if [[ "$TIME_PASSED" -gt "1200" ]]
then
curl -m 2 -s wttr.in/\?format\="%c%t" > $CACHE_FILE
fi
cat $CACHE_FILE

View File

@ -22,7 +22,7 @@ if status --is-interactive
set fish_greeting "" set fish_greeting ""
# Autojump # Autojump
[ -f /usr/local/share/autojump/autojump.fish ]; and source /usr/local/share/autojump/autojump.fish zoxide init fish | source
# Colors # Colors
theme_gruvbox theme_gruvbox
@ -33,6 +33,7 @@ if status --is-interactive
notes notes
aws aws
mactools mactools
projects
# Fuzzy finder # Fuzzy finder
fzf_key_bindings fzf_key_bindings

View File

@ -1,5 +1,6 @@
# This file contains fish universal variable definitions. # This file contains fish universal variable definitions.
# VERSION: 3.0 # VERSION: 3.0
SETUVAR OP_SESSION_enterprise_console:CoIqb03EMshttN\x2dvIfdyWOhc6IIckFS6mBfvRQ9r1a0
SETUVAR __fish_initialized:3100 SETUVAR __fish_initialized:3100
SETUVAR _fish_abbr__01_t:cat SETUVAR _fish_abbr__01_t:cat
SETUVAR _fish_abbr_boot:\x24DOTS/scripts/bootstrap SETUVAR _fish_abbr_boot:\x24DOTS/scripts/bootstrap
@ -25,7 +26,7 @@ SETUVAR _fish_abbr_gp:git\x20push
SETUVAR _fish_abbr_gs:git\x20status SETUVAR _fish_abbr_gs:git\x20status
SETUVAR _fish_abbr_gu:git\x20pull SETUVAR _fish_abbr_gu:git\x20pull
SETUVAR _fish_abbr_h:http\x20\x2dFh\x20\x2d\x2dall SETUVAR _fish_abbr_h:http\x20\x2dFh\x20\x2d\x2dall
SETUVAR _fish_abbr_hosts:sudo\x20vim\x20/etc/hosts SETUVAR _fish_abbr_hosts:sudo\x20nvim\x20/etc/hosts
SETUVAR _fish_abbr_k:kubectl SETUVAR _fish_abbr_k:kubectl
SETUVAR _fish_abbr_l:ls SETUVAR _fish_abbr_l:ls
SETUVAR _fish_abbr_la:ls\x20\x2dalhF SETUVAR _fish_abbr_la:ls\x20\x2dalhF
@ -44,6 +45,10 @@ SETUVAR _fish_abbr_ssl:openssl\x20req\x20\x2dnew\x20\x2dnewkey\x20rsa\x3a2048\x2
SETUVAR _fish_abbr_te:terraform SETUVAR _fish_abbr_te:terraform
SETUVAR _fish_abbr_v:vim SETUVAR _fish_abbr_v:vim
SETUVAR _fish_abbr_vimrc:vim\x20\x24HOME/\x2econfig/nvim/init\x2evim SETUVAR _fish_abbr_vimrc:vim\x20\x24HOME/\x2econfig/nvim/init\x2evim
SETUVAR _fish_abbr_za:zoxide\x20add
SETUVAR _fish_abbr_zq:zoxide\x20query
SETUVAR _fish_abbr_zqi:zoxide\x20query\x20\x2di
SETUVAR _fish_abbr_zr:zoxide\x20remove
SETUVAR fish_color_autosuggestion:686868 SETUVAR fish_color_autosuggestion:686868
SETUVAR fish_color_cancel:\x2dr SETUVAR fish_color_cancel:\x2dr
SETUVAR fish_color_command:a1b56c SETUVAR fish_color_command:a1b56c

View File

@ -36,17 +36,19 @@ function aliases --description 'All aliases'
alias moon='curl wttr.in/Moon' alias moon='curl wttr.in/Moon'
alias ipinfo='curl ipinfo.io' alias ipinfo='curl ipinfo.io'
alias worldmap='telnet mapscii.me' alias worldmap='telnet mapscii.me'
function qr
qrencode $argv[1] -o /tmp/qr.png | open /tmp/qr.png
end
# Dotfile and config shortcuts # Dotfile and config shortcuts
alias reload='source $DOTS/fish.configlink/config.fish' # Refresh fish shell alias reload='source $DOTS/fish.configlink/config.fish' # Refresh fish shell
abbr -a boot '$DOTS/scripts/bootstrap' abbr -a boot '$DOTS/scripts/bootstrap'
abbr -a sshc 'vim ~/.ssh/config' abbr -a sshc 'vim ~/.ssh/config'
abbr -a hosts 'sudo vim /etc/hosts' abbr -a hosts 'sudo nvim /etc/hosts'
abbr -a frc 'vim $HOME/.config/fish/config.fish' abbr -a frc 'vim $HOME/.config/fish/config.fish'
abbr -a falias 'vim $HOME/.config/fish/functions/aliases.fish' abbr -a falias 'vim $HOME/.config/fish/functions/aliases.fish'
# Cheat Sheets # Cheat Sheets
alias proj='cd $PROJ'
abbr -a ssl 'openssl req -new -newkey rsa:2048 -nodes' \ abbr -a ssl 'openssl req -new -newkey rsa:2048 -nodes' \
'-keyout server.key -out server.csr' '-keyout server.key -out server.csr'
abbr -a get-fingerprint 'ssh-keyscan myhost.com | ssh-keygen -lf -' abbr -a get-fingerprint 'ssh-keyscan myhost.com | ssh-keygen -lf -'

View File

@ -0,0 +1,16 @@
#!/usr/bin/local/fish
function projects --description "Projects tools"
alias proj='cd $PROJ'
function prj --description "cd to a project"
set projdir (ls $PROJ | fzf)
if [ $status -eq 0 ]
cd $projdir
else
return 1
end
end
end

View File

@ -1,76 +1,52 @@
tap "homebrew/cask" # Homebrew Installations
# Shells brew "fish" # My shell
brew "fish" brew "neovim" # My editor
brew "exa" # Better ls
# Shell Navigation brew "tmux" # Terminal panes and windows
brew "exa" brew "tealdeer" # Mini man page
brew "tmux" brew "starship" # Shell prompt
brew "autojump" brew "ripgrep" # Faster, better grep
brew "fzf" # Fuzzy finder
# Shell Completion brew "fd" # Faster, better find
brew "tealdeer" brew "sd" # Faster, better sed
brew "zsh-syntax-highlighting" brew "bat" # Better cat
brew "zsh-autosuggestions" brew "zoxide" # Better autojump
brew "jq" # JSON manipulation
# Shell Style brew "xsv" # CSV manipulation
brew "starship" brew "dos2unix" # File conversion
brew "trash" # Delete to trash
# Searching brew "wget" # Not quite curl
brew "the_silver_searcher" brew "telnet" # Check networking
brew "ripgrep" brew "prettyping" # Better ping
brew "fzf" brew "httpie" # Better curl
brew "fd" brew "shellcheck" # Lint for bash
brew "pyenv" # Python installations
# File Manipulation brew "pyenv-virtualenv" # Python virtualenvs
brew "sd" brew "ruby" # Newer than default ruby
brew "bat" brew "ansible" # Deploy to local server
brew "jq" brew "terraform" # Deploy cloud infra
brew "xsv" brew "packer" # Build deployment images
brew "dos2unix" brew "gpg" # Encryption
brew "trash" brew "qrencode" # Make a QR code
brew "youtube-dl" # Download YouTube videos
# Networking brew "googler" # Search Google
brew "wget" brew "hub" # GitHub commands
brew "telnet"
brew "prettyping"
brew "httpie"
# Languages
brew "shellcheck"
brew "pyenv"
brew "pyenv-virtualenv"
brew "ruby"
brew "ansible"
brew "terraform"
brew "packer"
# Miscellaneous
brew "gpg"
brew "emacs-plus"
# Fun
brew "qrencode"
brew "youtube-dl"
brew "googler"
# Personal # Personal
tap "nmasur/repo" tap "nmasur/repo" # My repo
brew "nmasur/repo/drips" brew "nmasur/repo/drips" # Retrieve AWS IPs
brew "nmasur/repo/update-ssh-config" brew "nmasur/repo/update-ssh-config" # Update .ssh/config
# Try them out # Experimental
tap "cjbassi/ytop" tap "cjbassi/ytop" # Fancy system performance
brew "cjbassi/ytop/ytop" brew "cjbassi/ytop/ytop"
# Not Installed # Not Installed
# git -- already installed # git -- already installed
# hub -- github commands
# pulumi # pulumi
# libmagic
# awscli # awscli
# saulpw/vd/visidata # saulpw/vd/visidata
# brew tap weaveworks/tap && brew install weaveworks/tap/eksctl (EKS on AWS) # brew tap weaveworks/tap && brew install weaveworks/tap/eksctl (EKS on AWS)
# fasd (cd)
# glances (top) # glances (top)

View File

@ -1,9 +1,8 @@
tap "homebrew/cask"
# Core Applications # Core Applications
cask "iterm2"
cask "alacritty" cask "alacritty"
cask "google-chrome" cask "google-chrome"
# Work Programs
cask "slack" cask "slack"
cask "zoomus" cask "zoomus"
cask "1password" cask "1password"
@ -14,17 +13,13 @@ cask "dropbox"
tap "homebrew/cask-fonts" tap "homebrew/cask-fonts"
cask "font-fira-mono-for-powerline" cask "font-fira-mono-for-powerline"
# Secondary Tools # Auxiliary Tools
cask "docker" cask "docker"
cask "github-desktop" cask "github-desktop"
cask "keybase" cask "keybase"
cask "scroll-reverser" cask "scroll-reverser"
cask "authy" cask "authy"
# Unnecessary
cask "dash"
cask "postman" cask "postman"
cask "cyberduck"
cask "drawio" cask "drawio"
# Personal # Personal
@ -32,4 +27,9 @@ cask "discord"
cask "steam" cask "steam"
cask "vlc" cask "vlc"
cask "calibre" cask "calibre"
cask "skype" cask "firefox"
# Don't bother
# cask "skype"
# cask "dash"
# cask "cyberduck"

View File

@ -8,8 +8,8 @@ Plug 'junegunn/fzf.vim' " Actual fuzzyfinder
Plug 'tpope/vim-surround' " Enables paren editing Plug 'tpope/vim-surround' " Enables paren editing
Plug 'Raimondi/delimitMate' " Auto-close parentheses Plug 'Raimondi/delimitMate' " Auto-close parentheses
Plug 'tpope/vim-commentary' " Use gc or gcc to comment Plug 'tpope/vim-commentary' " Use gc or gcc to comment
Plug 'hashivim/vim-terraform' " Terraform HCL syntax Plug 'sheerun/vim-polyglot' " Syntax for every language
Plug 'vimwiki/vimwiki' " Wiki System Plug 'vimwiki/vimwiki' " Wiki Markdown System
Plug 'jreybert/vimagit' " Git 'gui' buffer Plug 'jreybert/vimagit' " Git 'gui' buffer
Plug 'airblade/vim-gitgutter' " Git next to line numbers Plug 'airblade/vim-gitgutter' " Git next to line numbers
Plug 'tpope/vim-fugitive' " Other git commands Plug 'tpope/vim-fugitive' " Other git commands
@ -17,15 +17,17 @@ Plug 'machakann/vim-highlightedyank' " Highlight text when copied
Plug 'itchyny/lightline.vim' " Status bar Plug 'itchyny/lightline.vim' " Status bar
Plug 'shinchu/lightline-gruvbox.vim' " Colors for status bar Plug 'shinchu/lightline-gruvbox.vim' " Colors for status bar
Plug 'tpope/vim-vinegar' " Fixes netrw file explorer Plug 'tpope/vim-vinegar' " Fixes netrw file explorer
Plug 'christoomey/vim-tmux-navigator' " Hotkeys for tmux panes
call plug#end() call plug#end()
" Settings " Basic Settings
filetype plugin on " Load the plugin for current filetype (vimwiki) filetype plugin on " Load the plugin for current filetype (vimwiki)
syntax enable " Syntax highlighting syntax enable " Syntax highlighting
set termguicolors " Set to truecolor set termguicolors " Set to truecolor
colorscheme gruvbox " Installed in autoload/ and colors/ colorscheme gruvbox " Installed in autoload/ and colors/
" Options
set number " Show line numbers set number " Show line numbers
set relativenumber " Relative numbers instead of absolute set relativenumber " Relative numbers instead of absolute
set list " Reveal whitespace with --- set list " Reveal whitespace with ---
@ -38,20 +40,17 @@ set incsearch " Search while typing
set visualbell " No sounds set visualbell " No sounds
set scrolljump=1 " Scroll more than one line (or 1 line) set scrolljump=1 " Scroll more than one line (or 1 line)
set scrolloff=3 " Margin of lines when scrolling set scrolloff=3 " Margin of lines when scrolling
set pastetoggle=<F3> " Use F3 to enter paste mode
set clipboard+=unnamedplus " Uses system clipboard for yanking set clipboard+=unnamedplus " Uses system clipboard for yanking
" Neovim only
set inccommand=split " Live preview search and replace
" Remember last position " Remember last position
if has("autocmd") if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
endif endif
" Line type
let &t_ti.="\e[1 q"
let &t_SI.="\e[5 q"
let &t_EI.="\e[1 q"
let &t_te.="\e[0 q"
" Better backup, swap and undo storage " Better backup, swap and undo storage
set noswapfile " Instead of swaps, create backups (less annoying) set noswapfile " Instead of swaps, create backups (less annoying)
set backup " Easier to recover and more secure set backup " Easier to recover and more secure
@ -67,12 +66,18 @@ if !isdirectory(&undodir)
call mkdir(&undodir, "p") call mkdir(&undodir, "p")
endif endif
" Command to edit vimrc (this file) " Custom commands
command Vimrc edit ~/.config/nvim/init.vim command Vimrc edit ~/.config/nvim/init.vim " Edit .vimrc (this file)
" Custom Keybinds
"----------------
" Map the leader key " Map the leader key
map <Space> <Leader> map <Space> <Leader>
"This unsets the `last search pattern` register by hitting return
nnoremap <silent> <CR> :noh<CR><CR>
" Jump to text in this directory " Jump to text in this directory
nnoremap <Leader>/ :Rg<CR> nnoremap <Leader>/ :Rg<CR>
@ -103,14 +108,8 @@ nnoremap <Leader>t :Vexplore<cr>
" Mouse interaction / scrolling " Mouse interaction / scrolling
set mouse=nv set mouse=nv
" Change title " Plugin Settings
let &titlestring = @% "----------------
set title
" Make whitespace pretty
" if &listchars ==# 'eol:$'
" set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+
" endif
" Built-in explorer plugin " Built-in explorer plugin
let g:netrw_liststyle = 3 " Change style to 'tree' view let g:netrw_liststyle = 3 " Change style to 'tree' view
@ -129,11 +128,7 @@ let g:terraform_fmt_on_save=1
let g:vimwiki_list = [{'path': '~/Documents/notes/', let g:vimwiki_list = [{'path': '~/Documents/notes/',
\ 'syntax': 'markdown', 'ext': '.md'}] \ 'syntax': 'markdown', 'ext': '.md'}]
function! GitStatus() " Status Bar Plugin
let [a,m,r] = GitGutterGetHunkSummary()
return printf('+%d ~%d -%d', a, m, r)
endfunction
let g:lightline = { let g:lightline = {
\ 'colorscheme': 'jellybeans', \ 'colorscheme': 'jellybeans',
\ 'active': { \ 'active': {
@ -147,4 +142,3 @@ let g:lightline = {
\ } \ }
" let g:lightline.colorscheme = 'gruvbox' " let g:lightline.colorscheme = 'gruvbox'
" set statusline+=%{GitStatus()}

View File

@ -86,7 +86,7 @@ set-option -g status-right-style none
set-option -g status-right-length "80" set-option -g status-right-length "80"
set-window-option -g window-status-separator "" set-window-option -g window-status-separator ""
WEATHER='#(curl -s wttr.in/\?format\="%%c%%t")' WEATHER='#(weather_cached)'
set-option -g status-left "#[fg=colour248, bg=colour241] #S #[fg=colour241, bg=colour237, nobold, noitalics, nounderscore]" set-option -g status-left "#[fg=colour248, bg=colour241] #S #[fg=colour241, bg=colour237, nobold, noitalics, nounderscore]"
set-option -g status-right "#[fg=colour239, bg=colour237, nobold, nounderscore, noitalics]#[fg=colour246,bg=colour239] %Y-%m-%d  %H:%M #[fg=colour248, bg=colour239, nobold, noitalics, nounderscore]#[fg=colour237, bg=colour248]#(gitmux -cfg .gitmux.conf '#{pane_current_path}') #[fg=colour237, nobold, bg=colour248]$WEATHER #[fg=colour237] " set-option -g status-right "#[fg=colour239, bg=colour237, nobold, nounderscore, noitalics]#[fg=colour246,bg=colour239] %Y-%m-%d  %H:%M #[fg=colour248, bg=colour239, nobold, noitalics, nounderscore]#[fg=colour237, bg=colour248]#(gitmux -cfg .gitmux.conf '#{pane_current_path}') #[fg=colour237, nobold, bg=colour248]$WEATHER #[fg=colour237] "
@ -97,6 +97,10 @@ set-window-option -g window-status-format "#[fg=colour237,bg=colour239,noitalics
set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'yardnsm/tmux-1password' set -g @plugin 'yardnsm/tmux-1password'
# Customize 1pass
bind i run-shell "reset_1p"
set -g @1password-copy-to-clipboard 'on'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm' run '~/.tmux/plugins/tpm/tpm'