Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
Signed-off-by: Egor Kovetskiy <[email protected]>
  • Loading branch information
kovetskiy committed Mar 22, 2024
1 parent 2b96b97 commit 45d0884
Show file tree
Hide file tree
Showing 17 changed files with 285 additions and 174 deletions.
7 changes: 4 additions & 3 deletions .config/coc/extensions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
"coc-xml": ">=1.14.1",
"coc-yaml": ">=1.8.0",
"coc-zig": ">=0.6.1",
"coc-clangd": ">=0.28.0",
"coc-prettier": ">=9.3.1"
"coc-clangd": ">=0.29.3",
"coc-prettier": ">=9.3.1",
"coc-rust-analyzer": ">=0.75.0"
},
"disabled": [],
"locked": [],
"lastUpdate": 1683017894840
"lastUpdate": 1709112918684
}
4 changes: 0 additions & 4 deletions .config/i3/config.base
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,10 @@ mode "resize" {
bindsym Escape mode "default"
}

# dell poweroff button
bindcode 124 exec poweroff

bindcode 171 exec playerctl next
bindcode 172 exec playerctl play-pause
bindcode 173 exec playerctl previous


for_window [title="tudu"] floating enable
for_window [class="zoom"] floating enable
for_window [class="kuake"] floating enable
Expand Down
17 changes: 17 additions & 0 deletions .config/i3/config.laptop
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
set $left DVI-I-4-4
set $center eDP1
set $right DVI-I-1-1

workspace 1 output $center
workspace 2 output $center
workspace 3 output $center
workspace 4 output $center
workspace s output $center

workspace a output $left
workspace z output $left
workspace d output $left

workspace q output $right
workspace w output $right
workspace e output $right
26 changes: 21 additions & 5 deletions .tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,18 @@ set -g status-left ''
set -g status-left-length 100
set -g status-right ''
set -g status-position top
set -g window-status-current-format "window-status-current-format"
set -g window-status-format "window-status-format"
set -g window-status-current-format "#I:#W#F"
set -g window-status-format "#I:#W#F"
#set -g force-height 1
set -g escape-time 0
set -g history-limit 2000
set -g set-titles on

set-option -g automatic-rename on
set-option -g automatic-rename-format 'asd'
## Update pane title when command changes
#set -g pane-border-format '#[fg=green]#{pane_current_path}#[default]'
#set -g pane-border-status top
#set -g set-titles on
#set -g automatic-rename on

bind-key -Tcopy-mode-vi Escape send-keys -X cancel
bind-key -Tcopy-mode-vi Enter send-keys -X copy-pipe-and-cancel clipboard-copy
Expand Down Expand Up @@ -48,8 +51,21 @@ set -g mode-keys vi
bind-key -n M-/ copy-mode \; send-key ?
bind p paste-buffer

set -g default-terminal screen-256color
set -g default-terminal alacritty

bind-key -Tcopy-mode-vi q send-keys -X begin-selection

set -g destroy-unattached off


# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'

set -g @treemux-tree-width 50

set -g @treemux-tree-nvim-init-file '~/.tmux/plugins/treemux/configs/treemux_init.lua'
set -g @plugin 'kiyoon/treemux'

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
11 changes: 10 additions & 1 deletion .vim/coc-settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"workspace.ignoredFolders": ["$HOME", "$HOME/.cargo/**", "$HOME/.rustup/**"],
"suggest.noselect": true,
"suggest.enablePreselect": false,
"diagnostic.errorSign": "\\ E",
Expand Down Expand Up @@ -28,6 +29,13 @@
"tsserver.log": "verbose",
"tsserver.trace.server": "verbose",
"languageserver": {
"terraform": {
"command": "terraform-ls",
"args": ["serve"],
"filetypes": ["terraform", "tf"],
"initializationOptions": {},
"settings": {}
},
"golangci-lint-languageserver": {
"command": "golangci-lint-langserver",
"filetypes": ["go"],
Expand Down Expand Up @@ -71,6 +79,8 @@
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true,
"go.trace.server": "verbose",
"go.goplsOptions": {
"allowModfileModifications": true,
"allowImplicitNetworkAccess":true,
"gofumpt": false,
"codelenses": {
"generate": true,
Expand All @@ -86,7 +96,6 @@
"hoverKind": "FullDocumentation",
"verboseOutput": true
},
"go.goplsPath": "/home/operator/go/bin/gopls",
"java.jdt.ls.vmargs": "-noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication -javaagent:\"/home/operator/.config/coc/extensions/node_modules/coc-java-lombok/jar/lombok.jar\"",
"java.format.settings.url": "/home/operator/sources/github.com/neoclide/redhat.java/eclipse-formatter.xml",
"typescript.validate.enable": true,
Expand Down
133 changes: 37 additions & 96 deletions .zshrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
. ~/bin/environment-variables

export TERM=screen-256color
export TERM=alacritty

export KEYTIMEOUT=100
export WORDCHARS=-
Expand Down Expand Up @@ -117,7 +117,6 @@ docompinit() {
compdef github-browse=ls
compdef man-directive=man
compdef vim-which=which
compdef smash=ssh
compdef guess=which
compdef _git gdd=git-checkout
}
Expand Down Expand Up @@ -245,10 +244,35 @@ docompinit() {
setopt hist_ignore_space
setopt hist_verify
setopt inc_append_history
setopt inc_append_history_time
setopt share_history
setopt hist_save_by_copy


# If the internal history needs to be trimmed to add the current command line,
# setting this option will cause the oldest history event that has a duplicate
# to be lost before losing a unique event from the list. You should be sure to
# set the value of HISTSIZE to a larger number than SAVEHIST in order to give
# you some room for the duplicated events, otherwise this option will behave
# just like HIST_IGNORE_ALL_DUPS once the history fills up with unique events.
#
# ^disabled
unsetopt histexpiredupsfirst

# If a new command line being added to the history list duplicates an older
# one, the older command is removed from the list (even if it is not the
# previous event).
#
# ^disabled
unsetopt histignorealldups

# Do not enter command lines into the history list if they are duplicates of the
# previous event.
#
# ^ enabled
setopt hist_ignore_dups

unsetopt hist_save_no_dups

zstyle ':zle:smart-kill-word' precise always
zstyle ':zle:smart-kill-word' keep-slash true
}
Expand Down Expand Up @@ -335,15 +359,15 @@ docompinit() {
for file in "${files[@]}"; do
if $diff; then
after=$(mktemp -u)
sed -r "s/$from/$to/g" $file > $after
git diff --color $file $after | diff-so-fancy
sed -r "s/$from/$to/" $file > $after
git diff $file $after
else
sed -ri "s/$from/$to/g" $file
sed -ri "s/$from/$to/" $file
fi
done

else
sed -r "s/$from/$to/g"
sed -r "s/$from/$to/"
fi
}

Expand Down Expand Up @@ -445,80 +469,6 @@ docompinit() {
git remote add origin "$new_url"
}

go-get-enhanced() {
if [ $# -eq 0 ]; then
go get
return
fi

local url=""
local dir=""
local flags=("-v")
local update=false
if [ "$1" = "u" -o "$1" = "-u" -o "$1" = "-" ]; then
flags+=("-u")
update=true
shift
fi

if [ $# -eq 0 ]; then
go get ${flags[@]}
return
fi

import=$(sed 's/.*:\/\///' <<< "$1")
shift

flags+=("$@")
local slashes=$(grep -o '/' <<< "$import" | wc -l)
if [ $slashes = 1 ]; then
user=$(cut -d/ -f1 <<< "$import")
repo=$(cut -d/ -f2 <<< "$import")
case "$user" in
s)
import="seletskiy/$repo"
;;

r)
import="reconquest/$repo"
;;

d)
import="deadcrew/$repo"
;;
esac

import="github.com/$import"
fi

if $update && [ $slashes = 0 ]; then
dependency_import=$(
go list -f \
'{{ range $dep := .Deps }}{{ $dep }}{{ "\n" }}{{ end }}' . \
| awk "/\/$import\$/ { print }"
)
if [ "$dependency_import" ]; then
import=$dependency_import
fi
fi

if [ ! "$dependency_import" ] && [ $slashes = 0 ]; then
import="github.com/kovetskiy/$import"
fi

go get ${flags[@]} $import

dir=$GOPATH/src/$import
if [[ "$dir" == *.git ]]; then
dir=$(sed 's/\.git//' <<< "$dir")
fi

if [ -d $dir ]; then
cd $dir
git submodule update --init
fi
}

create-and-change-directory() {
mkdir -p "$@"
cd "$@"
Expand Down Expand Up @@ -737,13 +687,6 @@ docompinit() {
git clean -ffdx
}

ssh-enhanced() {
local hostname="$1"
tmux set status on
tmux set status-left "# $hostname"
smash -z "$@"
tmux set status off
}
makepkg-clean() {
local branch="$1"
rm -rf *.xz
Expand Down Expand Up @@ -1446,7 +1389,6 @@ alias f=':find'
alias si='ssh-copy-id'

alias cdp='cd-pkgbuild'
alias gog='go-get-enhanced'
alias gme='go-makepkg-enhanced'
alias gmev='FLAGS="-p version" go-makepkg-enhanced'
alias gmevs='FLAGS="-p version -s" go-makepkg-enhanced'
Expand Down Expand Up @@ -1674,9 +1616,8 @@ alias ask='ai-ask'
alias -g -- '\kya'='-o yaml'
alias -g -- '\kow'='-o wide'

# ssh settings
alias gmf='sed -i "/replace/d" go.mod; go mod tidy'

ssh-add ~/.ssh/id_rsa 2>/dev/null
stty -ixon

FZF_TMUX_HEIGHT=0
Expand All @@ -1700,16 +1641,16 @@ eval $(dircolors ~/.dircolors.$BACKGROUND)

unset -f colors

export HISTSIZE=100000
export SAVEHIST=1000000000000
export HISTSIZE=100000000
export SAVEHIST=100000000
# HIST_IGNORE_DUPS
#HIST_SAVE_BY_COPY
#HIST_IGNORE_ALL_DUPS

export HISTFILE=~/history/zsh_history
if [[ "$HISTFILE_OVERRIDE" ]]; then
export HISTFILE=$HISTFILE_OVERRIDE
fi

setopt share_history

source ~/.guts/zsh/*.zsh

#source /usr/share/nvm/init-nvm.sh
22 changes: 22 additions & 0 deletions bin/battery-info
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

:get-section-battery() {
battery=$(acpi -b 2>/dev/null \
| grep -v 'rate information unavailable' \
| sed -r \
-e 's/Battery [0-9]:\s*//' \
-e 's/ until charged//' \
-e 's/ remaining//' \
-e 's/Discharging,/↓/' \
-e 's/Full,/✓/' \
-e 's/Not charging/✓/' \
-e 's/discharging at zero rate - will never fully discharge./∞/' \
-e 's/,//')
if [[ "$battery" =~ "rate information unavailable" ]]; then
return
fi

echo "$battery"
}

:get-section-battery "$@"
Loading

0 comments on commit 45d0884

Please sign in to comment.