From 8f90a000329d94936a598d8d31da5bab99efa14f Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Wed, 3 Nov 2021 20:35:39 +0300 Subject: zsh: use /home/yigit --- .zshrc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.zshrc b/.zshrc index 6c9bd5d..0261f35 100644 --- a/.zshrc +++ b/.zshrc @@ -1,12 +1,10 @@ cowsay $(fortune) | lolcat hostname=$(uname -n) -# If you come from bash you might have to change your $PATH. -export PATH=/usr/local/bin:$PATH -export PATH="$PATH:/home/yigit/.local/bin:$HOME/.cargo/bin" +export PATH="$PATH:$HOME/.local/bin:$HOME/.cargo/bin" # Path to your oh-my-zsh installation. -export ZSH=/home/yigit/.oh-my-zsh +export ZSH=$HOME/.oh-my-zsh ZSH_THEME="spaceship" SPACESHIP_CHAR_SYMBOL="δ" -- cgit v1.2.3-70-g09d2 From 7ccce2fff0a9ecbee90c8d9b87258b499c9ed235 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Wed, 3 Nov 2021 20:37:44 +0300 Subject: polybar, lowe: use ipc --- .config/polybar/config##h.lowe | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/polybar/config##h.lowe b/.config/polybar/config##h.lowe index 8dd08f7..0dfb1b5 100644 --- a/.config/polybar/config##h.lowe +++ b/.config/polybar/config##h.lowe @@ -30,6 +30,7 @@ offset-x = 0 offset-y = 0 radius = 0 fixed-center = true +enable-ipc = true background = ${colors.background} foreground = ${colors.foreground} -- cgit v1.2.3-70-g09d2 From 93cdb13eada4e803fb4db71fb581d9e4a03d2119 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Wed, 3 Nov 2021 20:38:08 +0300 Subject: git, lowe: migrate from diff-so-fancy to delta --- .gitconfig##h.lowe | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/.gitconfig##h.lowe b/.gitconfig##h.lowe index d0026b7..4e44bee 100644 --- a/.gitconfig##h.lowe +++ b/.gitconfig##h.lowe @@ -5,7 +5,6 @@ [core] autocrlf = input safecrlf = true - pager = diff-so-fancy | less --tabs=4 -RFX excludesfile = ~/.cvsignore [alias] co = checkout @@ -23,18 +22,6 @@ helper = cache --timeout=3600 [color] ui = true -[color "diff-highlight"] - oldNormal = red bold - oldHighlight = red bold 52 - newNormal = green bold - newHighlight = green bold 22 -[color "diff"] - meta = yellow - frag = magenta bold - commit = yellow bold - old = red bold - new = green bold - whitespace = red reverse [commit] gpgsign = true [sendemail] @@ -45,3 +32,24 @@ ff = only [init] defaultBranch = main +[pager] + diff = delta + log = delta + reflog = delta + show = delta +[interactive] + diffFilter = delta --color-only +[delta] + features = line-numbers decorations side-by-side + plus-style = syntax "#003800" + minus-style = syntax "#3f0001" +[delta "decorations"] + commit-decoration-style = bold yellow box ul + file-style = bold yellow ul + file-decoration-style = none + hunk-header-decoration-style = cyan box ul +[delta "line-numbers"] + line-numbers-left-style = cyan + line-numbers-right-style = cyan + line-numbers-minus-style = 124 + line-numbers-plus-style = 28 -- cgit v1.2.3-70-g09d2 From a0bb023d782dd2d8703670d560b5ccd8d25d640e Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Thu, 4 Nov 2021 12:25:04 +0300 Subject: bins: shfmt, weasel suite, spark --- .local/bin/bukuadd_c | 4 +- .local/bin/done | 4 +- .local/bin/dups | 54 ++++++++++++++++++++ .local/bin/epub_lander | 1 - .local/bin/i3-get-window-criteria | 8 +-- .local/bin/letsread | 2 +- .local/bin/mailsync | 32 +++++++----- .local/bin/mailto_handler | 2 +- .local/bin/openfile | 4 +- .local/bin/passive | 65 ++++++++++++++++++++++++ .local/bin/power.sh | 8 +-- .local/bin/rfv | 12 ++--- .local/bin/spark | 103 ++++++++++++++++++++++++++++++++++++++ .local/bin/texclear | 6 +-- .local/bin/type.sh | 12 ++--- .local/bin/weasel | 38 ++++++++++++++ 16 files changed, 310 insertions(+), 45 deletions(-) create mode 100755 .local/bin/dups create mode 100755 .local/bin/passive create mode 100755 .local/bin/spark create mode 100755 .local/bin/weasel diff --git a/.local/bin/bukuadd_c b/.local/bin/bukuadd_c index 925022a..86f705d 100755 --- a/.local/bin/bukuadd_c +++ b/.local/bin/bukuadd_c @@ -10,7 +10,7 @@ fi FOO=$(buku --nostdin --np --nc -p -1) OUT="$(buku --nostdin --np --nc -a "$url" "$tags" 2>&1)" -if [[ $OUT =~ "ERROR" ]] ; then +if [[ $OUT =~ "ERROR" ]]; then notify-send "Bookmarking Failed" "$OUT" --app-name="buku" --icon="dialog-error" exit 1 fi @@ -20,7 +20,7 @@ BAR=$FOO while [[ $BAR == "$FOO" ]]; do sleep 1 BAR=$(buku --nostdin --np --nc -p -1) -done; +done notify-send "Success" "$BAR" --app-name="buku" --icon="checkmark" diff --git a/.local/bin/done b/.local/bin/done index 8bb0a3d..ae76287 100755 --- a/.local/bin/done +++ b/.local/bin/done @@ -27,9 +27,9 @@ if ACTIVE_TASK=$(task active); then timew "@1" annotate "${annot:0:1}" else if maybe_delete=$(printf "no no\nyea" | rofi -dmenu -p "should we delete the tracking?" -lines 2 -no-custom); then - if [[ "${maybe_delete}" == "no no" ]]; then + if [[ ${maybe_delete} == "no no" ]]; then notify-send "tracking unannotated, not deleted" "nobody will know how that went" --app-name="done" --icon="itmages-question" - elif [[ "${maybe_delete}" == "yea" ]]; then + elif [[ ${maybe_delete} == "yea" ]]; then timew delete "@1" notify-send "tracking deleted" "like you never worked on that" --app-name="done" --icon="pack-more" fi diff --git a/.local/bin/dups b/.local/bin/dups new file mode 100755 index 0000000..eb450f5 --- /dev/null +++ b/.local/bin/dups @@ -0,0 +1,54 @@ +#!/usr/bin/env perl + +# Finds duplicate adjacent words. + +use strict ; + +my $DupCount = 0 ; + +if (!@ARGV) { + print "usage: dups ...\n" ; + exit ; +} + +while (1) { + my $FileName = shift @ARGV ; + + # Exit code = number of duplicates found. + exit $DupCount if (!$FileName) ; + + open FILE, $FileName or die $!; + + my $LastWord = "" ; + my $LineNum = 0 ; + + while () { + chomp ; + + $LineNum ++ ; + + my @words = split (/(\W+)/) ; + + foreach my $word (@words) { + # Skip spaces: + next if $word =~ /^\s*$/ ; + + # Skip punctuation: + if ($word =~ /^\W+$/) { + $LastWord = "" ; + next ; + } + + # Found a dup? + if (lc($word) eq lc($LastWord)) { + print "$FileName:$LineNum $word\n" ; + $DupCount ++ ; + } # Thanks to Sean Cronin for tip on case. + + # Mark this as the last word: + $LastWord = $word ; + } + } + + close FILE ; +} diff --git a/.local/bin/epub_lander b/.local/bin/epub_lander index 801381a..19e0a1c 100755 --- a/.local/bin/epub_lander +++ b/.local/bin/epub_lander @@ -15,4 +15,3 @@ mv $HOME/down/*.pdf $HOME/docs/pdf_landing/ if [[ $? -ne 1 ]]; then notify-send "Moved some pdfs" "" --app-name="epub_lander" --icon="emblem_success" fi - diff --git a/.local/bin/i3-get-window-criteria b/.local/bin/i3-get-window-criteria index f46f65e..6d6ea1b 100755 --- a/.local/bin/i3-get-window-criteria +++ b/.local/bin/i3-get-window-criteria @@ -9,7 +9,7 @@ # quotes in "" are not escaped properly. This is a problem with the output of `xprop`, # reported upstream: https://bugs.freedesktop.org/show_bug.cgi?id=66807 -PROGNAME=`basename "$0"` +PROGNAME=$(basename "$0") # Check for xwininfo and xprop for cmd in xwininfo xprop; do @@ -25,13 +25,13 @@ match_qstring='"[^"\\]*(\\.[^"\\]*)*"' # NOTE: Adds 1 backreference { # Run xwininfo, get window id - window_id=`xwininfo -int | sed -nre "s/^xwininfo: Window id: ($match_int) .*$/\1/p"` + window_id=$(xwininfo -int | sed -nre "s/^xwininfo: Window id: ($match_int) .*$/\1/p") echo "id=$window_id" # Run xprop, transform its output into i3 criteria. Handle fallback to # WM_NAME when _NET_WM_NAME isn't set - xprop -id $window_id | - sed -nr \ + xprop -id $window_id \ + | sed -nr \ -e "s/^WM_CLASS\(STRING\) = ($match_qstring), ($match_qstring)$/instance=\1\nclass=\3/p" \ -e "s/^WM_WINDOW_ROLE\(STRING\) = ($match_qstring)$/window_role=\1/p" \ -e "/^WM_NAME\(STRING\) = ($match_string)$/{s//title=\1/; h}" \ diff --git a/.local/bin/letsread b/.local/bin/letsread index 5e3cf5a..d5f1e0c 100755 --- a/.local/bin/letsread +++ b/.local/bin/letsread @@ -1,4 +1,4 @@ #!/usr/bin/env bash -firefox $(buku --stag toread -f 10 | shuf -n 1) +firefox "$(buku --stag toread -f 10 | shuf -n 1)" dunstify "Time to read" "Don't forget to remove 'toread' from that when you're done" diff --git a/.local/bin/mailsync b/.local/bin/mailsync index ae0801c..cc7010b 100755 --- a/.local/bin/mailsync +++ b/.local/bin/mailsync @@ -3,9 +3,15 @@ # Sync mail and give notification if there is new mail. # Run only if user logged in (prevent cron errors) -pgrep -u "${USER:=$LOGNAME}" >/dev/null || { echo "$USER not logged in; sync will not run."; exit ;} +pgrep -u "${USER:=$LOGNAME}" > /dev/null || { + echo "$USER not logged in; sync will not run." + exit +} # Run only if not already running in other instance -pgrep -x mbsync >/dev/null && { notify-send --app-name="mailsync" "mbsync is already running" "you should fix this" ; exit ;} +pgrep -x mbsync > /dev/null && { + notify-send --app-name="mailsync" "mbsync is already running" "you should fix this" + exit +} if [[ -f "$HOME/.local/share/.dnd" ]]; then echo "do not disturb is on" @@ -13,8 +19,11 @@ if [[ -f "$HOME/.local/share/.dnd" ]]; then fi # Checks for internet connection and set notification script. -ping -q -c 1 1.1.1.1 > /dev/null || ping -q -c 1 1.0.0.1 > /dev/null || ping -q -c 1 example.org || { echo "No internet connection detected."; exit ;} -command -v notify-send >/dev/null || echo "Note that \`libnotify\` or \`libnotify-send\` should be installed for pop-up mail notifications with this script." +ping -q -c 1 1.1.1.1 > /dev/null || ping -q -c 1 1.0.0.1 > /dev/null || ping -q -c 1 example.org || { + echo "No internet connection detected." + exit +} +command -v notify-send > /dev/null || echo 'Note that `libnotify` or `libnotify-send` should be installed for pop-up mail notifications with this script.' # Required to display notifications if run as a cronjob: export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus @@ -25,11 +34,11 @@ export DISPLAY=:0.0 # Settings are different for MacOS (Darwin) systems. if [ "$(uname)" = "Darwin" ]; then - notify() { osascript -e "display notification \"$2 in $1\" with title \"You've got Mail\" subtitle \"Account: $account\"" && sleep 2 ;} - messageinfo() { osascript -e "display notification with title \"📧 $from\" subtitle \"$subject\"" ;} + notify() { osascript -e "display notification \"$2 in $1\" with title \"You've got Mail\" subtitle \"Account: $account\"" && sleep 2; } + messageinfo() { osascript -e "display notification with title \"📧 $from\" subtitle \"$subject\""; } else - notify() { notify-send --icon="mail_new" --app-name="excerpt" "\`$1\`" "📬 $2 new mail(s)" ;} - messageinfo() { notify-send --icon="mail-mark-unread" --app-name="mutt" "📧 $from" "$subject" ;} + notify() { notify-send --icon="mail_new" --app-name="excerpt" "\`$1\`" "📬 $2 new mail(s)"; } + messageinfo() { notify-send --icon="mail-mark-unread" --app-name="mutt" "📧 $from" "$subject"; } fi # Check account for new mail. Notify if there is new content. @@ -44,7 +53,7 @@ syncandnotify() { # Extract subject and sender from mail. from=$(awk '/^From: / && ++n ==1,/^\<.*\>:/' "$file" | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | awk '{ $1=""; if (NF>=3)$NF=""; print $0 }' | sed 's/^[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//') subject=$(awk '/^Subject: / && ++n == 1,/^\<.*\>: / && ++i == 2' "$file" | head -n 1 | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | sed 's/^Subject: //' | sed 's/^{[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//' | tr -d '\n') - messageinfo & + messageinfo & done fi } @@ -62,15 +71,14 @@ fi # ( kill -46 "$(pidof "${STATUSBAR:-dwmblocks}")" >/dev/null 2>&1 ) 2>/dev/null # Parallelize multiple accounts -for account in $accounts -do +for account in $accounts; do syncandnotify & done wait # ( kill -46 "$(pidof "${STATUSBAR:-dwmblocks}")" >/dev/null 2>&1 ) 2>/dev/null -notmuch new 2>/dev/null +notmuch new 2> /dev/null #Create a touch file that indicates the time of the last run of mailsync touch "$HOME/.config/mutt/.mailsynclastrun" diff --git a/.local/bin/mailto_handler b/.local/bin/mailto_handler index 9493558..36c38bd 100755 --- a/.local/bin/mailto_handler +++ b/.local/bin/mailto_handler @@ -21,6 +21,6 @@ for account in "${ACCOUNTSDIR}"/*.muttrc; do done -picked=$(printf "${choices}" | rofi -dmenu) +picked=$(printf '%s' "${choices}" | rofi -dmenu) exec kitty -e neomutt -F "$HOME/.config/mutt/muttrc" -e "source /home/yigit/.config/mutt/accounts/${picked}.muttrc" -- "$@" diff --git a/.local/bin/openfile b/.local/bin/openfile index cf3c6c3..742b9c0 100755 --- a/.local/bin/openfile +++ b/.local/bin/openfile @@ -1,10 +1,10 @@ #!/bin/sh # Helps open a file with xdg-open from mutt in a external program without weird side effects. -tempdir="${XDG_CACHE_HOME:-$HOME/.cache}/mutt-wizard/files" +tempdir="${XDG_CACHE_HOME:-$HOME/.cache}/mutt/files" file="$tempdir/$(basename "$1")" [ "$(uname)" = "Darwin" ] && opener="open" || opener="setsid -f xdg-open" mkdir -p "$tempdir" cp -f "$1" "$file" -$opener "$file" >/dev/null 2>&1 +$opener "$file" > /dev/null 2>&1 find "${tempdir:?}" -mtime +1 -type f -delete diff --git a/.local/bin/passive b/.local/bin/passive new file mode 100755 index 0000000..276d61b --- /dev/null +++ b/.local/bin/passive @@ -0,0 +1,65 @@ +#!/usr/bin/env bash + +irregulars="awoken|\ + been|born|beat|\ + become|begun|bent|\ + beset|bet|bid|\ + bidden|bound|bitten|\ + bled|blown|broken|\ + bred|brought|broadcast|\ + built|burnt|burst|\ + bought|cast|caught|\ + chosen|clung|come|\ + cost|crept|cut|\ + dealt|dug|dived|\ +done|drawn|dreamt|\ +driven|drunk|eaten|fallen|\ +fed|felt|fought|found|\ +fit|fled|flung|flown|\ +forbidden|forgotten|\ +foregone|forgiven|\ +forsaken|frozen|\ +gotten|given|gone|\ +ground|grown|hung|\ +heard|hidden|hit|\ +held|hurt|kept|knelt|\ +knit|known|laid|led|\ +leapt|learnt|left|\ +lent|let|lain|lighted|\ +lost|made|meant|met|\ +misspelt|mistaken|mown|\ +overcome|overdone|overtaken|\ +overthrown|paid|pled|proven|\ +put|quit|read|rid|ridden|\ +rung|risen|run|sawn|said|\ +seen|sought|sold|sent|\ +set|sewn|shaken|shaven|\ +shorn|shed|shone|shod|\ +shot|shown|shrunk|shut|\ +sung|sunk|sat|slept|\ +slain|slid|slung|slit|\ +smitten|sown|spoken|sped|\ +spent|spilt|spun|spit|\ +split|spread|sprung|stood|\ +stolen|stuck|stung|stunk|\ +stridden|struck|strung|\ +striven|sworn|swept|\ +swollen|swum|swung|taken|\ +taught|torn|told|thought|\ +thrived|thrown|thrust|\ +trodden|understood|upheld|\ +upset|woken|worn|woven|\ +wed|wept|wound|won|\ +withheld|withstood|wrung|\ +written" + +if [ "$1" = "" ]; then + echo "usage: $(basename "$0") ..." + exit +fi + +grep -E -n -i --color \ + "\\b(am|are|were|being|is|been|was|be)\ + \\b[ ]*(\w+ed|($irregulars))\\b" "$*" + +exit $? diff --git a/.local/bin/power.sh b/.local/bin/power.sh index f794211..2dd7e5d 100755 --- a/.local/bin/power.sh +++ b/.local/bin/power.sh @@ -15,10 +15,10 @@ chosen=$(echo -e "lock\nshutdown\nrestart" | rofi -dmenu -i) # Info about some states are available here: # https://www.freedesktop.org/software/systemd/man/systemd-sleep.conf.html#Description -if [[ $chosen = "lock" ]]; then - $HOME/.local/bin/lock -elif [[ $chosen = "shutdown" ]]; then +if [[ $chosen == "lock" ]]; then + "$HOME"/.local/bin/lock +elif [[ $chosen == "shutdown" ]]; then systemctl poweroff -elif [[ $chosen = "restart" ]]; then +elif [[ $chosen == "restart" ]]; then systemctl reboot fi diff --git a/.local/bin/rfv b/.local/bin/rfv index 4c9a632..a178e67 100755 --- a/.local/bin/rfv +++ b/.local/bin/rfv @@ -4,11 +4,11 @@ # 2. Interactively narrow down the list using fzf # 3. Open the file in Vim IFS=: read -ra selected < <( - rg --color=always --line-number --no-heading --smart-case "${*:-}" | - fzf --ansi \ - --color "hl:-1:underline,hl+:-1:underline:reverse" \ - --delimiter : \ - --preview 'bat --color=always {1} --highlight-line {2}' \ - --preview-window='up:60%:+{2}+3/3:~3' + rg --color=always --line-number --no-heading --smart-case "${*:-}" \ + | fzf --ansi \ + --color "hl:-1:underline,hl+:-1:underline:reverse" \ + --delimiter : \ + --preview 'bat --color=always {1} --highlight-line {2}' \ + --preview-window='up:60%:+{2}+3/3:~3' ) [ -n "${selected[0]}" ] && nvim "${selected[0]}" "+${selected[1]}" diff --git a/.local/bin/spark b/.local/bin/spark new file mode 100755 index 0000000..53a38be --- /dev/null +++ b/.local/bin/spark @@ -0,0 +1,103 @@ +#!/usr/bin/env bash +# +# spark +# https://github.com/holman/spark +# +# Generates sparklines for a set of data. +# +# Here's a good web-based sparkline generator that was a bit of inspiration +# for spark: +# +# https://datacollective.org/sparkblocks +# +# spark takes a comma-separated or space-separated list of data and then prints +# a sparkline out of it. +# +# Examples: +# +# spark 1 5 22 13 53 +# # => ▁▁▃▂▇ +# +# spark 0 30 55 80 33 150 +# # => ▁▂▃▅▂▇ +# +# spark -h +# # => Prints the spark help text. + +# Generates sparklines. +# +# $1 - The data we'd like to graph. +_echo() +{ + if [ "X$1" = "X-n" ]; then + shift + printf "%s" "$*" + else + printf "%s\n" "$*" + fi +} + +spark() +{ + local n numbers= + + # find min/max values + local min=0xffffffff max=0 + + for n in ${@//,/ } + do + # on Linux (or with bash4) we could use `printf %.0f $n` here to + # round the number but that doesn't work on OS X (bash3) nor does + # `awk '{printf "%.0f",$1}' <<< $n` work, so just cut it off + n=${n%.*} + (( n < min )) && min=$n + (( n > max )) && max=$n + numbers=$numbers${numbers:+ }$n + done + + # print ticks + local ticks=(▁ ▂ ▃ ▄ ▅ ▆ ▇ █) + + # use a high tick if data is constant + (( min == max )) && ticks=(▅ ▆) + + local f=$(( (($max-$min)<<8)/(${#ticks[@]}-1) )) + (( f < 1 )) && f=1 + + for n in $numbers + do + _echo -n ${ticks[$(( ((($n-$min)<<8)/$f) ))]} + done + _echo +} + +# If we're being sourced, don't worry about such things +if [ "$BASH_SOURCE" == "$0" ]; then + # Prints the help text for spark. + help() + { + local spark=$(basename $0) + cat <&1 echo -n "${a:- }" | tee /dev/tty echo -n "${a:- }" | tee /dev/tty done - sleep 0.$((RANDOM%7)) - 1>&2 echo -ne $"\n" + sleep 0.$((RANDOM % 7)) + echo 1>&2 -ne $"\n" echo sleep 1.0 done diff --git a/.local/bin/weasel b/.local/bin/weasel new file mode 100755 index 0000000..ce82ce3 --- /dev/null +++ b/.local/bin/weasel @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +weasels="many|various|very|fairly|several|extremely\ + |exceedingly|quite|remarkably|few|surprisingly\ + |mostly|largely|huge|tiny|((are|is) a number)\ + |excellent|interestingly|significantly\ + |substantially|clearly|vast|relatively|completely" + +wordfile="" + +# Check for an alternate weasel file +if [ -f "$HOME"/etc/words/weasels ]; then + wordfile="$HOME/etc/words/weasels" +fi + +if [ -f "$WORDSDIR"/weasels ]; then + wordfile="$WORDSDIR/weasels" +fi + +if [ -f words/weasels ]; then + wordfile="words/weasels" +fi + +if [ ! "$wordfile" = "" ]; then + weasels="xyzabc123" + for w in $(cat $wordfile); do + weasels="$weasels|$w" + done +fi + +if [ "$1" = "" ]; then + echo "usage: $(basename "$0") ..." + exit +fi + +grep -E -i -n --color "\\b($weasels)\\b" "$*" + +exit $? -- cgit v1.2.3-70-g09d2 From 78a8b85744cbef5cf6064a38b6e12b72a6ede0b0 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Thu, 4 Nov 2021 12:25:39 +0300 Subject: nvim: clean up ale remains --- .config/nvim/after/ftplugin/c.vim | 1 - .config/nvim/after/ftplugin/java.vim | 1 - .config/nvim/after/ftplugin/lua.vim | 1 - .config/nvim/after/ftplugin/markdown.vim | 1 - .config/nvim/after/ftplugin/python.vim | 4 ---- .config/nvim/after/ftplugin/rust.vim | 3 --- .config/nvim/after/ftplugin/sh.vim | 1 - .config/nvim/after/ftplugin/tex.vim | 3 --- 8 files changed, 15 deletions(-) delete mode 100644 .config/nvim/after/ftplugin/lua.vim delete mode 100644 .config/nvim/after/ftplugin/markdown.vim delete mode 100644 .config/nvim/after/ftplugin/python.vim delete mode 100644 .config/nvim/after/ftplugin/sh.vim diff --git a/.config/nvim/after/ftplugin/c.vim b/.config/nvim/after/ftplugin/c.vim index 49b3953..73fdd4b 100644 --- a/.config/nvim/after/ftplugin/c.vim +++ b/.config/nvim/after/ftplugin/c.vim @@ -1,4 +1,3 @@ setlocal shiftwidth=8 setlocal tabstop=8 setlocal expandtab -let b:ale_fixers = ['clang-format'] diff --git a/.config/nvim/after/ftplugin/java.vim b/.config/nvim/after/ftplugin/java.vim index 243baeb..5441d82 100644 --- a/.config/nvim/after/ftplugin/java.vim +++ b/.config/nvim/after/ftplugin/java.vim @@ -1,2 +1 @@ -let b:ale_linters = ['javac'] let b:dispatch = 'javac %' diff --git a/.config/nvim/after/ftplugin/lua.vim b/.config/nvim/after/ftplugin/lua.vim deleted file mode 100644 index 5611ba5..0000000 --- a/.config/nvim/after/ftplugin/lua.vim +++ /dev/null @@ -1 +0,0 @@ -let b:ale_fixers = ['lua-format'] diff --git a/.config/nvim/after/ftplugin/markdown.vim b/.config/nvim/after/ftplugin/markdown.vim deleted file mode 100644 index 656bff4..0000000 --- a/.config/nvim/after/ftplugin/markdown.vim +++ /dev/null @@ -1 +0,0 @@ -let b:ale_linters = ['languagetool', 'proselint'] diff --git a/.config/nvim/after/ftplugin/python.vim b/.config/nvim/after/ftplugin/python.vim deleted file mode 100644 index 6bdca5e..0000000 --- a/.config/nvim/after/ftplugin/python.vim +++ /dev/null @@ -1,4 +0,0 @@ -let b:ale_fixers = ['black', 'isort'] -let b:ale_linters = ['flake8', 'bandit'] -let g:ale_python_flake8_options = '--max-line-length=88' - diff --git a/.config/nvim/after/ftplugin/rust.vim b/.config/nvim/after/ftplugin/rust.vim index 40d2549..fb601d1 100644 --- a/.config/nvim/after/ftplugin/rust.vim +++ b/.config/nvim/after/ftplugin/rust.vim @@ -1,6 +1,3 @@ -let b:ale_fixers = ['rustfmt'] -let b:ale_linters = ['rls'] - setlocal tags=./rusty-tags.vi;/ autocmd BufWritePost *.rs :silent! exec "!rusty-tags vi --quiet --start-dir=" . expand('%:p:h') . "&" | redraw! diff --git a/.config/nvim/after/ftplugin/sh.vim b/.config/nvim/after/ftplugin/sh.vim deleted file mode 100644 index 70f6252..0000000 --- a/.config/nvim/after/ftplugin/sh.vim +++ /dev/null @@ -1 +0,0 @@ -let b:ale_fixers = ['shfmt'] diff --git a/.config/nvim/after/ftplugin/tex.vim b/.config/nvim/after/ftplugin/tex.vim index 04307e4..27b002a 100644 --- a/.config/nvim/after/ftplugin/tex.vim +++ b/.config/nvim/after/ftplugin/tex.vim @@ -17,6 +17,3 @@ call sandwich#util#addlocal([{ \ 'buns': ['\enquote{', '}'], \ 'input': ['"'], \ }]) - -let b:ale_linters = ['chktex', 'texlab', 'proselint'] -let b:ale_fixers = ['latexindent'] -- cgit v1.2.3-70-g09d2 From fdd8868e8c6199c0c5ef05b52870f218fb139598 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Thu, 4 Nov 2021 12:25:55 +0300 Subject: nvim: use efm --- .config/nvim/init.lua | 4 ---- .config/nvim/lua/plugin_settings.lua | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 4644f60..cd20fc3 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -11,10 +11,6 @@ -- │ ▘▝▀▘▝▀▘│ -- └────────┘ --- do not source the default filetype.vim --- needed for filetype.nvim -vim.g.did_load_filetypes = 1 - require('plugins') require('settings') require('plugin_settings') diff --git a/.config/nvim/lua/plugin_settings.lua b/.config/nvim/lua/plugin_settings.lua index 4bc7081..1f39e5f 100644 --- a/.config/nvim/lua/plugin_settings.lua +++ b/.config/nvim/lua/plugin_settings.lua @@ -354,6 +354,12 @@ for _, lsp in ipairs(servers) do } end +nvim_lsp['efm'].setup{ + on_attach = on_attach, + filetypes = { 'sh' }, + capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) +} + -- }}} nvim-lsp -- -- vista {{{ -- -- cgit v1.2.3-70-g09d2 From fcb2237c01bcd2b7982bb844cea4cf9447f20d03 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Thu, 4 Nov 2021 12:26:18 +0300 Subject: efm: Tracking --- .config/efm-langserver/config.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .config/efm-langserver/config.yaml diff --git a/.config/efm-langserver/config.yaml b/.config/efm-langserver/config.yaml new file mode 100644 index 0000000..40031b0 --- /dev/null +++ b/.config/efm-langserver/config.yaml @@ -0,0 +1,19 @@ +version: 2 +root-markers: + - .git/ +lint-debounce: 1s +tools: + sh-shellcheck: &sh-shellcheck + lint-command: 'shellcheck -f gcc -x' + lint-source: 'shellcheck' + lint-formats: + - '%f:%l:%c: %trror: %m' + - '%f:%l:%c: %tarning: %m' + - '%f:%l:%c: %tote: %m' + sh-shfmt: &sh-shfmt + format-command: 'shfmt -ci -s -bn -i 4 -sr' + format-stdin: true +languages: + sh: + - <<: *sh-shellcheck + - <<: *sh-shfmt -- cgit v1.2.3-70-g09d2