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:
- --login
- --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
#

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

View File

@ -1,5 +1,6 @@
# This file contains fish universal variable definitions.
# VERSION: 3.0
SETUVAR OP_SESSION_enterprise_console:CoIqb03EMshttN\x2dvIfdyWOhc6IIckFS6mBfvRQ9r1a0
SETUVAR __fish_initialized:3100
SETUVAR _fish_abbr__01_t:cat
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_gu:git\x20pull
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_l:ls
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_v:vim
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_cancel:\x2dr
SETUVAR fish_color_command:a1b56c

View File

@ -36,17 +36,19 @@ function aliases --description 'All aliases'
alias moon='curl wttr.in/Moon'
alias ipinfo='curl ipinfo.io'
alias worldmap='telnet mapscii.me'
function qr
qrencode $argv[1] -o /tmp/qr.png | open /tmp/qr.png
end
# Dotfile and config shortcuts
alias reload='source $DOTS/fish.configlink/config.fish' # Refresh fish shell
abbr -a boot '$DOTS/scripts/bootstrap'
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 falias 'vim $HOME/.config/fish/functions/aliases.fish'
# Cheat Sheets
alias proj='cd $PROJ'
abbr -a ssl 'openssl req -new -newkey rsa:2048 -nodes' \
'-keyout server.key -out server.csr'
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"
# Shell Navigation
brew "exa"
brew "tmux"
brew "autojump"
# Shell Completion
brew "tealdeer"
brew "zsh-syntax-highlighting"
brew "zsh-autosuggestions"
# Shell Style
brew "starship"
# Searching
brew "the_silver_searcher"
brew "ripgrep"
brew "fzf"
brew "fd"
# File Manipulation
brew "sd"
brew "bat"
brew "jq"
brew "xsv"
brew "dos2unix"
brew "trash"
# Networking
brew "wget"
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"
brew "fish" # My shell
brew "neovim" # My editor
brew "exa" # Better ls
brew "tmux" # Terminal panes and windows
brew "tealdeer" # Mini man page
brew "starship" # Shell prompt
brew "ripgrep" # Faster, better grep
brew "fzf" # Fuzzy finder
brew "fd" # Faster, better find
brew "sd" # Faster, better sed
brew "bat" # Better cat
brew "zoxide" # Better autojump
brew "jq" # JSON manipulation
brew "xsv" # CSV manipulation
brew "dos2unix" # File conversion
brew "trash" # Delete to trash
brew "wget" # Not quite curl
brew "telnet" # Check networking
brew "prettyping" # Better ping
brew "httpie" # Better curl
brew "shellcheck" # Lint for bash
brew "pyenv" # Python installations
brew "pyenv-virtualenv" # Python virtualenvs
brew "ruby" # Newer than default ruby
brew "ansible" # Deploy to local server
brew "terraform" # Deploy cloud infra
brew "packer" # Build deployment images
brew "gpg" # Encryption
brew "qrencode" # Make a QR code
brew "youtube-dl" # Download YouTube videos
brew "googler" # Search Google
brew "hub" # GitHub commands
# Personal
tap "nmasur/repo"
brew "nmasur/repo/drips"
brew "nmasur/repo/update-ssh-config"
tap "nmasur/repo" # My repo
brew "nmasur/repo/drips" # Retrieve AWS IPs
brew "nmasur/repo/update-ssh-config" # Update .ssh/config
# Try them out
tap "cjbassi/ytop"
# Experimental
tap "cjbassi/ytop" # Fancy system performance
brew "cjbassi/ytop/ytop"
# Not Installed
# git -- already installed
# hub -- github commands
# pulumi
# libmagic
# awscli
# saulpw/vd/visidata
# brew tap weaveworks/tap && brew install weaveworks/tap/eksctl (EKS on AWS)
# fasd (cd)
# glances (top)

View File

@ -1,9 +1,8 @@
tap "homebrew/cask"
# Core Applications
cask "iterm2"
cask "alacritty"
cask "google-chrome"
# Work Programs
cask "slack"
cask "zoomus"
cask "1password"
@ -14,17 +13,13 @@ cask "dropbox"
tap "homebrew/cask-fonts"
cask "font-fira-mono-for-powerline"
# Secondary Tools
# Auxiliary Tools
cask "docker"
cask "github-desktop"
cask "keybase"
cask "scroll-reverser"
cask "authy"
# Unnecessary
cask "dash"
cask "postman"
cask "cyberduck"
cask "drawio"
# Personal
@ -32,4 +27,9 @@ cask "discord"
cask "steam"
cask "vlc"
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 'Raimondi/delimitMate' " Auto-close parentheses
Plug 'tpope/vim-commentary' " Use gc or gcc to comment
Plug 'hashivim/vim-terraform' " Terraform HCL syntax
Plug 'vimwiki/vimwiki' " Wiki System
Plug 'sheerun/vim-polyglot' " Syntax for every language
Plug 'vimwiki/vimwiki' " Wiki Markdown System
Plug 'jreybert/vimagit' " Git 'gui' buffer
Plug 'airblade/vim-gitgutter' " Git next to line numbers
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 'shinchu/lightline-gruvbox.vim' " Colors for status bar
Plug 'tpope/vim-vinegar' " Fixes netrw file explorer
Plug 'christoomey/vim-tmux-navigator' " Hotkeys for tmux panes
call plug#end()
" Settings
" Basic Settings
filetype plugin on " Load the plugin for current filetype (vimwiki)
syntax enable " Syntax highlighting
set termguicolors " Set to truecolor
colorscheme gruvbox " Installed in autoload/ and colors/
" Options
set number " Show line numbers
set relativenumber " Relative numbers instead of absolute
set list " Reveal whitespace with ---
@ -38,20 +40,17 @@ set incsearch " Search while typing
set visualbell " No sounds
set scrolljump=1 " Scroll more than one line (or 1 line)
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
" Neovim only
set inccommand=split " Live preview search and replace
" Remember last position
if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | 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
set noswapfile " Instead of swaps, create backups (less annoying)
set backup " Easier to recover and more secure
@ -67,12 +66,18 @@ if !isdirectory(&undodir)
call mkdir(&undodir, "p")
endif
" Command to edit vimrc (this file)
command Vimrc edit ~/.config/nvim/init.vim
" Custom commands
command Vimrc edit ~/.config/nvim/init.vim " Edit .vimrc (this file)
" Custom Keybinds
"----------------
" Map the leader key
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
nnoremap <Leader>/ :Rg<CR>
@ -103,14 +108,8 @@ nnoremap <Leader>t :Vexplore<cr>
" Mouse interaction / scrolling
set mouse=nv
" Change title
let &titlestring = @%
set title
" Make whitespace pretty
" if &listchars ==# 'eol:$'
" set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+
" endif
" Plugin Settings
"----------------
" Built-in explorer plugin
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/',
\ 'syntax': 'markdown', 'ext': '.md'}]
function! GitStatus()
let [a,m,r] = GitGutterGetHunkSummary()
return printf('+%d ~%d -%d', a, m, r)
endfunction
" Status Bar Plugin
let g:lightline = {
\ 'colorscheme': 'jellybeans',
\ 'active': {
@ -147,4 +142,3 @@ let g:lightline = {
\ }
" 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-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-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 '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)
run '~/.tmux/plugins/tpm/tpm'