Compare commits

...

3 Commits

Author SHA1 Message Date
bretello 9f566efa8e
vim: add actionlint support (through ALE) 2022-05-03 10:17:42 +02:00
bretello f3bf033fb8
zsh functions: add -s flag to mkvenv 2022-05-03 10:16:05 +02:00
bretello dff98b066f
zsh functions: add python module 2022-04-29 11:16:39 +02:00
5 changed files with 28 additions and 22 deletions

View File

@ -263,16 +263,6 @@ make_backup() {
echo "done"
}
mkvenv(){
# any arguments are passed on to the `venv` module as flags/arguments
if [[ -e .venv ]]; then
echo "$(color $RED Error:) $(color $BOLD .venv) already exists." >&2
return 1
fi
echo -n "Creating venv..." && python -m venv $@ .venv && echo -n " done. Enable? [Y/n]"
read source_venv
if [[ $source_venv != "n" ]]; then
source .venv/bin/activate && echo -e "$(color $BOLD Enabled!) 🐍 $(color $BOLD$PURPLE $(python --version | cut -d " " -f2 )) ($(color $BOLD$GREEN $(pip --version | cut -d " " -f -2)))"
fi
function find_by_mtime() {
find $@ -printf "%T+ %p\n" | sort
}

View File

@ -0,0 +1,24 @@
mkvenv(){
local source_venv
if [[ $1 == "-s" ]]; then
source_venv=y
shift
fi
# any arguments are passed on to the `venv` module as flags/arguments
if [[ -e .venv ]]; then
echo "$(color $RED Error:) $(color $BOLD .venv) already exists." >&2
return 1
fi
echo -n "Creating venv..." && python -m venv $@ .venv
if [[ -z ${source_venv} ]]; then
echo -n " done. Enable? [Y/n]"
read source_venv
else
echo ""
fi
if [[ $source_venv != "n" ]]; then
source .venv/bin/activate && echo -e "$(color $BOLD Enabled!) 🐍 $(color $BOLD$PURPLE $(python --version | cut -d " " -f2 )) ($(color $BOLD$GREEN $(pip --version | cut -d " " -f -2)))"
fi
}

View File

@ -150,10 +150,3 @@ endfunction
command! -nargs=1 -complete=shellcmd Cmd silent call Cmd(<q-args>)
" Call actionlint (github actions linter) on current file
function ActionLint()
call setqflist([])
cexpr system('actionlint --oneline ' . expand('%'))
copen
endfunction
command! ActionLint call ActionLint()

View File

@ -159,6 +159,3 @@ autocmd FileType python nnoremap T :Pytest function --pdb<CR>
" Ultisnips
map <Leader>ue :UltiSnipsEdit<cr>
" Github actions linter
map <Leader>H :ActionLint<CR>

View File

@ -75,6 +75,8 @@ au BufRead *.dvc let b:ale_fix_on_save=0
au BufRead *.dvc set filetype=yaml
au BufRead,BufNewFile */playbooks/*.yml set filetype=yaml.ansible
au BufRead,BufNewFile */.github/*/*.y{,a}ml
\ let b:ale_linters = {'yaml': ['actionlint'] }
au BufRead,BufNewFile rules.v[46] *.rules setlocal filetype=iptables
if has('persistent_undo')