mirror of https://git.decapod.one/brethil/dotfiles
Compare commits
3 Commits
26e313e21e
...
9f566efa8e
Author | SHA1 | Date |
---|---|---|
bretello | 9f566efa8e | |
bretello | f3bf033fb8 | |
bretello | dff98b066f |
|
@ -263,16 +263,6 @@ make_backup() {
|
||||||
echo "done"
|
echo "done"
|
||||||
}
|
}
|
||||||
|
|
||||||
mkvenv(){
|
function find_by_mtime() {
|
||||||
# any arguments are passed on to the `venv` module as flags/arguments
|
find $@ -printf "%T+ %p\n" | sort
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
}
|
|
@ -150,10 +150,3 @@ endfunction
|
||||||
|
|
||||||
command! -nargs=1 -complete=shellcmd Cmd silent call Cmd(<q-args>)
|
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()
|
|
||||||
|
|
|
@ -159,6 +159,3 @@ autocmd FileType python nnoremap T :Pytest function --pdb<CR>
|
||||||
|
|
||||||
" Ultisnips
|
" Ultisnips
|
||||||
map <Leader>ue :UltiSnipsEdit<cr>
|
map <Leader>ue :UltiSnipsEdit<cr>
|
||||||
|
|
||||||
" Github actions linter
|
|
||||||
map <Leader>H :ActionLint<CR>
|
|
||||||
|
|
|
@ -75,6 +75,8 @@ au BufRead *.dvc let b:ale_fix_on_save=0
|
||||||
au BufRead *.dvc set filetype=yaml
|
au BufRead *.dvc set filetype=yaml
|
||||||
|
|
||||||
au BufRead,BufNewFile */playbooks/*.yml set filetype=yaml.ansible
|
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
|
au BufRead,BufNewFile rules.v[46] *.rules setlocal filetype=iptables
|
||||||
|
|
||||||
if has('persistent_undo')
|
if has('persistent_undo')
|
||||||
|
|
Loading…
Reference in New Issue