This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
command! -bang GFiles call fzf#vim#gitfiles('', fzf#vim#with_preview('right')) | |
command! -bang Files call fzf#vim#files('', fzf#vim#with_preview('right')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
command! -bang -nargs=* Ag call fzf#vim#ag(<q-args>, '--color-path "1;36"', fzf#vim#with_preview(), <bang>0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Navigate to branches using FZF | |
cof = "!checkout_fzf() { git branch | fzf | xargs git checkout; }; checkout_fzf" | |
# Add files using FZF | |
af = "!add_fzf() { git status -s | awk '{print $2}' | fzf -m | xargs git add; }; add_fzf" | |
# Add files using FZF and immediately commit them | |
afmend = "!add_fzf_amend() { git status -s | awk '{print $2}' | fzf -m | xargs git add && git amend; }; add_fzf_amend" | |
# Restore files (like removing multiple files from the staging area) | |
ref = "!restore_fzf() { git status -s | awk '{print $2}' | fzf -m | xargs git restore; }; restore_fzf" | |
# Delete untracked files using FZF | |
rmf = "!delete_untracked() { git ls-files --exclude-standard --other | fzf -m | xargs rm; }; delete_untracked" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" <ESC> is required to get back to normal mode | |
inoremap <Leader>s <ESC>:Snippets<CR>i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Delete multiple files with FZF | |
rmf() { | |
ls | fzf -m | xargs -I {} rm {} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kc() { kubectl -n ${NAMESPACE} --cluster ${CLUSTER_ID} $@ } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export CLUSTER_NAME=<my-cluster-name> | |
export PROJECT_ID=<my-project-id> | |
export ENV=<env> | |
export NAMESPACE=<my-namespace> | |
export ZONE=<zone> | |
export CLUSTER_ID=gke_${PROJECT_ID}_${ZONE}_${CLUSTER_NAME} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source relevant env files via fzf | |
# note that sf() can also be used without Kubectl | |
sf() { | |
find ~/.envs -type f | fzf | while read filename; do source $filename; done | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vf() { | |
# note that you need to extract the absolute path in order to get this to work | |
ls -d ~/.virtualenv/*/ | fzf | while read file; do source $file/bin/activate; done | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pydantic import BaseModel | |
class CamelCaseItem(BaseModel): | |
id: str | |
isAvailable: bool | |
def test_python_camel_case_names_are_weird_in_python(): | |
item = CamelCaseItem(id='test-item-id', isAvailable=True) |