From 9258e0e213d446423a84aff4c00c51c68a969fec Mon Sep 17 00:00:00 2001 From: nold Date: Sun, 9 Jun 2024 21:21:03 +0200 Subject: [PATCH] more cool stuff --- .gitignore | 2 ++ bashrc | 3 +++ dotfiles/functions | 10 ++++++++-- dotfiles/gitconfig | 1 + npm-packages.txt | 2 ++ requirements.txt | 1 + setup.sh | 9 +++++++++ 7 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 npm-packages.txt diff --git a/.gitignore b/.gitignore index 85010f3..9502620 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ *.swp *.pyc /hosts/lb* +package.json +package-lock.json diff --git a/bashrc b/bashrc index 9993ef9..0200aff 100644 --- a/bashrc +++ b/bashrc @@ -79,6 +79,9 @@ function json2yaml { # Aliases alias ls="ls --color=always --time-style=long-iso -F" +type lsd &>/dev/null && alias ls=lsd +alias ll="ls -ltrh" +alias lt="lsd -ltrh --tree --depth 3" alias dfh="df -hT -t ext4 -t zfs -t xfs" alias lsof='lsof 2>/dev/null | grep' alias winekiller="ps -ef | grep 'fusion|wine|\.exe' -E -i | awk '{ print \$2}' | xargs kill -9" diff --git a/dotfiles/functions b/dotfiles/functions index d66d914..85e9d83 100644 --- a/dotfiles/functions +++ b/dotfiles/functions @@ -14,11 +14,17 @@ function create_venv { } function venv { + if [ -z "$1" ] ; then + ls -1 "${VENV_BASE}" | sed 's/^/\ \-\ /g' + return + fi + case "$1" in l) ls -1 "${VENV_BASE}" | sed 's/^/\ \-\ /g' ;; c) create_venv $2 ; shift ;; - s) create_venv $2 ; shift ; source "${VENV_BASE}/$1/bin/activate" ;; - *) source "${VENV_BASE}/$1/bin/activate" ;; + d) rm -rf "${VENV_BASE}/$2" ;; + s) create_venv "$1" ; shift ; source "${VENV_BASE}/$1/bin/activate" ;; + *) create_venv "$1" ; source "${VENV_BASE}/$1/bin/activate" ;; esac if [ -n "$1" ] ; then diff --git a/dotfiles/gitconfig b/dotfiles/gitconfig index aba0b78..1ddf7eb 100644 --- a/dotfiles/gitconfig +++ b/dotfiles/gitconfig @@ -46,6 +46,7 @@ prompt = false [safe] directory = /home/nold/git/armbian-build + directory = /home/nold/git/dotfiles [filter "lfs"] clean = git-lfs clean -- %f smudge = git-lfs smudge -- %f diff --git a/npm-packages.txt b/npm-packages.txt new file mode 100644 index 0000000..1d829a8 --- /dev/null +++ b/npm-packages.txt @@ -0,0 +1,2 @@ +yaml-language-server +bash-language-server diff --git a/requirements.txt b/requirements.txt index f343b6b..db81417 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ powerline-status powerline-gitstatus +python-lsp-server diff --git a/setup.sh b/setup.sh index f9c76e0..b429296 100755 --- a/setup.sh +++ b/setup.sh @@ -99,6 +99,15 @@ git-sync https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm mkdir -p ~/.fonts/ cp fonts/* ~/.fonts/ +# LSP Server +if type go &>/dev/null ; then + go install golang.org/x/tools/gopls@latest +fi + +if type npm &>/dev/null ; then + xargs -a npm-packages.txt npm install +fi + # Inject bashrc sourcing grep -qE "^source.*$(pwd)/bashrc" ~/.bashrc || echo "source $(pwd)/bashrc" >> ~/.bashrc