From a035e1ee1755fd719792446ab920117c4a4670ae Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Fri, 8 Jul 2022 15:24:58 +0200 Subject: [PATCH 1/4] [nvim] feat: tweak autocomplete behavior change binding autocomplete --- .config/nvim/lua/plugin/cmp.lua | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.config/nvim/lua/plugin/cmp.lua b/.config/nvim/lua/plugin/cmp.lua index c12ce81..e53c879 100644 --- a/.config/nvim/lua/plugin/cmp.lua +++ b/.config/nvim/lua/plugin/cmp.lua @@ -48,7 +48,7 @@ local icons = { cmp.setup { completion = { - autocomplete = false + autocomplete = true }, sources = { { name = "path" }, @@ -91,21 +91,31 @@ cmp.setup { select = true, }), [""] = cmp.mapping(function(fallback) + if luasnip.expand_or_locally_jumpable() then + luasnip.expand_or_jump() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() - elseif luasnip.expand_or_locally_jumpable() then - luasnip.expand_or_jump() elseif has_words_before() then cmp.complete() else fallback() end end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) + [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) else fallback() end From dede9bcf793ac8e6004cdde1f4034b8869f4c966 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Fri, 8 Jul 2022 15:26:05 +0200 Subject: [PATCH 2/4] [scripts] feat: compile main.tex the right way --- .local/bin/compiler | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/compiler b/.local/bin/compiler index e9eeb94..8bdbef8 100755 --- a/.local/bin/compiler +++ b/.local/bin/compiler @@ -31,7 +31,7 @@ shebangtest() } texcompile() { \ - [ -e "main.tex" ] && base="main" && file="$base.tex" + [ "$base" != "notes" ] && [ -e "main.tex" ] && base="main" && file="$base.tex" cmd="pdflatex" case "$(head -n 1 $file)" in *lua*) cmd="lualatex" ;; From 4540ec557838d46027144cf989f40b29f0488f1e Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Thu, 28 Jul 2022 20:06:24 +0200 Subject: [PATCH 3/4] [mail] feat: add MOVEP/QEST folders to ens account --- .config/mutt/accounts/2-david.julien@ens-lyon.fr.muttrc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.config/mutt/accounts/2-david.julien@ens-lyon.fr.muttrc b/.config/mutt/accounts/2-david.julien@ens-lyon.fr.muttrc index bb594ad..32d74f4 100644 --- a/.config/mutt/accounts/2-david.julien@ens-lyon.fr.muttrc +++ b/.config/mutt/accounts/2-david.julien@ens-lyon.fr.muttrc @@ -23,7 +23,7 @@ set signature="/home/swytch/.config/mutt/accounts/ens.signature" unmacro index o macro index o "mailsync" "run mbsync to sync david.julien@ens-lyon.fr" -mailboxes "=Sent" "=Drafts" "=Trash" "=INBOX" "=internship" "=fanfare" +mailboxes "=Sent" "=Drafts" "=Trash" "=INBOX" "=internship" "=MOVEP" "=QEST" "=fanfare" set record = "+Sent" macro index,pager gs "=Sent" "go to sent" macro index,pager Ms ";=Sent" "move mail to sent" @@ -46,3 +46,9 @@ macro index,pager Cf ";=fanfare" "copy mail to fanfare" macro index,pager gI "=internship" "go to internship" macro index,pager MI ";=internship" "move mail to internship" macro index,pager CI ";=internship" "copy mail to internship" +macro index,pager gm "=MOVEP" "go to MOVEP" +macro index,pager Mm ";=MOVEP" "move mail to MOVEP" +macro index,pager Cm ";=MOVEP" "copy mail to MOVEP" +macro index,pager gq "=QEST" "go to QEST" +macro index,pager Mq ";=QEST" "move mail to QEST" +macro index,pager Cq ";=QEST" "copy mail to QEST" From 40a6eb6330b47872b0bcaec58dec9eac361b860a Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Thu, 28 Jul 2022 20:06:53 +0200 Subject: [PATCH 4/4] [statusbar] feat: separate states for wifi down and no ssid --- .local/bin/statusbar/sb-internet | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.local/bin/statusbar/sb-internet b/.local/bin/statusbar/sb-internet index def21ed..dbe07c8 100755 --- a/.local/bin/statusbar/sb-internet +++ b/.local/bin/statusbar/sb-internet @@ -13,7 +13,11 @@ # Wifi quality percentage and  icon if ethernet is connected. ssid="$(wpa_cli status | grep -i ^ssid | sed -e 's/.*=//')" state="$(wpa_cli status | grep -i ^wpa_state | sed -e 's/.*=//')" -[ "COMPLETED" = $state ] && str="$(printf " %s" $ssid)" || str="$(printf " ---")" +case "$state" in + COMPLETED) str="$(printf " %s" $ssid)" ;; + INTERFACE_DISABLED) str="WIFI DOWN" ;; + *) str="$(printf "NO WIFI")";; +esac eth="$(cat /sys/class/net/enp0s31f6/operstate)" if [ "up" = "$eth" ]; then str="$(printf "%s /  " "$str")"