From fa919171a24c9a7cc8e269419907723a81c9370e Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Mon, 28 Nov 2022 11:05:48 +0100 Subject: [PATCH 1/9] [system] fix: external mode for displayselect --- .local/bin/displayselect | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.local/bin/displayselect b/.local/bin/displayselect index c2176cb..13a473f 100755 --- a/.local/bin/displayselect +++ b/.local/bin/displayselect @@ -44,10 +44,11 @@ twoscreen() { # If multi-monitor is selected and there are two screens. } default() { - primary=$(echo "$allposs" | grep -w "connected primary" | awk '{ print $1 }') + [ -z "$primary" ] && primary=$(echo "$allposs" | grep -w "connected primary" | awk '{ print $1 }') secondary=$(echo "$screens" | grep -v -w "$primary") direction="left" rotation="normal" + setup } @@ -55,9 +56,7 @@ external() { internal=$(echo "$screens" | dmenu -i -p "Select internal display:") screens=$(echo "$screens" | grep -v -w "eDP-1") primary=$(echo "$screens" | dmenu -i -p "Select primary display:") - xrandr --output $primary --primary - - default + xrandr --output $primary --primary && default } setup() { From 47cc2a369477fda7a85e6ec1e3cd1fa5d05e4b65 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Fri, 2 Dec 2022 16:12:44 +0100 Subject: [PATCH 2/9] [nvim] fix: lsp installation dir variable this is now a global variable --- .config/nvim/lua/plugin/lsp/clangd.lua | 3 +-- .config/nvim/lua/plugin/lsp/init.lua | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.config/nvim/lua/plugin/lsp/clangd.lua b/.config/nvim/lua/plugin/lsp/clangd.lua index 5996b05..ad11624 100644 --- a/.config/nvim/lua/plugin/lsp/clangd.lua +++ b/.config/nvim/lua/plugin/lsp/clangd.lua @@ -6,8 +6,7 @@ local M = {} -local lsp_root_path = vim.fn.stdpath("data") .. "/lsp_servers/" -local clangd_binary = lsp_root_path .. "clangd/clangd/bin/clangd" +local clangd_binary = _G.lsp_root_dir .. "clangd/clangd/bin/clangd" M.setup = function(opts) opts.settings = { diff --git a/.config/nvim/lua/plugin/lsp/init.lua b/.config/nvim/lua/plugin/lsp/init.lua index 274c9b6..6dbccae 100644 --- a/.config/nvim/lua/plugin/lsp/init.lua +++ b/.config/nvim/lua/plugin/lsp/init.lua @@ -70,6 +70,8 @@ mason.setup({ } }) +_G.lsp_root_dir = vim.fn.stdpath("data") .. "/mason/bin" + mason_lspconfig.setup({ ensure_installed = servers, }) From a2ead9f0c07e00b5451bd1de19887232364219dd Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Fri, 2 Dec 2022 16:13:21 +0100 Subject: [PATCH 3/9] [nvim] fix: lspconfig require formatting --- .config/nvim/lua/plugin/lsp/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/nvim/lua/plugin/lsp/init.lua b/.config/nvim/lua/plugin/lsp/init.lua index 6dbccae..f4291ef 100644 --- a/.config/nvim/lua/plugin/lsp/init.lua +++ b/.config/nvim/lua/plugin/lsp/init.lua @@ -83,7 +83,7 @@ for _, server in ipairs(servers) do capabilities = capabilities, } - local plugin = string.format("%s.%s", "plugin.lsp", server) + local plugin = string.format("plugin.lsp.%s", server) require(plugin).setup(opts) lspconfig[server].setup(opts) From c2d120ecf4c5ee35f7b3a75a51f15521399bc04d Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Fri, 2 Dec 2022 16:14:33 +0100 Subject: [PATCH 4/9] [nvim] format: nvim lsp server list --- .config/nvim/lua/plugin/lsp/init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.config/nvim/lua/plugin/lsp/init.lua b/.config/nvim/lua/plugin/lsp/init.lua index f4291ef..fbedf26 100644 --- a/.config/nvim/lua/plugin/lsp/init.lua +++ b/.config/nvim/lua/plugin/lsp/init.lua @@ -58,7 +58,11 @@ end local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities) -local servers = { "clangd", "sumneko_lua", "texlab" } +local servers = { + "clangd", + "sumneko_lua", + "texlab", +} mason.setup({ ui = { From e87b8636408c034e874a6ac4b0e4d35b6c510b8f Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Fri, 2 Dec 2022 16:15:29 +0100 Subject: [PATCH 5/9] [nvim] feat: add rust_analyzer LSP --- .config/nvim/lua/plugin/lsp/init.lua | 1 + .config/nvim/lua/plugin/lsp/rust_analyzer.lua | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 .config/nvim/lua/plugin/lsp/rust_analyzer.lua diff --git a/.config/nvim/lua/plugin/lsp/init.lua b/.config/nvim/lua/plugin/lsp/init.lua index fbedf26..8af6b8d 100644 --- a/.config/nvim/lua/plugin/lsp/init.lua +++ b/.config/nvim/lua/plugin/lsp/init.lua @@ -60,6 +60,7 @@ capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities) local servers = { "clangd", + "rust_analyzer", "sumneko_lua", "texlab", } diff --git a/.config/nvim/lua/plugin/lsp/rust_analyzer.lua b/.config/nvim/lua/plugin/lsp/rust_analyzer.lua new file mode 100644 index 0000000..604a4e5 --- /dev/null +++ b/.config/nvim/lua/plugin/lsp/rust_analyzer.lua @@ -0,0 +1,16 @@ +-- Author : swytch +-- Created : Wednesday Nov. 30, 2022 16:35:43 CET +-- License : GPLv3 +-- Description : neovim lsp config file for rust_analyzer + + +local M = {} + +local rust_analayzer_binary = _G.lsp_root_dir .. "rust_analyzer/rust_analyzer" + +M.setup = function(opts) + opts.settings = {} +end + +return M + From 17e545328791f78090e5c52cc7e58e0f0be763ff Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Fri, 2 Dec 2022 16:54:40 +0100 Subject: [PATCH 6/9] [nvim] feat: rust config file format-on-save ! --- .config/nvim/after/ftplugin/rust.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .config/nvim/after/ftplugin/rust.lua diff --git a/.config/nvim/after/ftplugin/rust.lua b/.config/nvim/after/ftplugin/rust.lua new file mode 100644 index 0000000..44272ee --- /dev/null +++ b/.config/nvim/after/ftplugin/rust.lua @@ -0,0 +1,13 @@ +-- Author : swytch +-- Created : Thursday Dec. 01, 2022 11:41:26 CET +-- License : GPLv3 +-- Description : rust settings file + +local format_sync_grp = vim.api.nvim_create_augroup("Format", {}) +vim.api.nvim_create_autocmd("BufWritePre", { + pattern = "*.rs", + callback = function() + vim.lsp.buf.format({ timeout_ms = 200 }) + end, + group = format_sync_grp, +}) From f5b5d3709c8c4eefbeb8d28f7decaa0e079d8099 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Sun, 4 Dec 2022 23:35:29 +0100 Subject: [PATCH 7/9] [nvim] feat: add treesitter support for rust --- .config/nvim/lua/plugin/treesitter.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/nvim/lua/plugin/treesitter.lua b/.config/nvim/lua/plugin/treesitter.lua index 0f70eb9..2b7f3a3 100644 --- a/.config/nvim/lua/plugin/treesitter.lua +++ b/.config/nvim/lua/plugin/treesitter.lua @@ -4,7 +4,7 @@ -- Description : treesitter config file require("nvim-treesitter.configs").setup { - ensure_installed = { "c", "lua", "python", "bash" }, + ensure_installed = { "c", "lua", "python", "rust", "bash" }, ignore_install = { "javascript" }, highlight = { enable = true, From c0ec146fc23696ed0e3cf35cb74928e081b42cad Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Mon, 5 Dec 2022 14:09:58 +0100 Subject: [PATCH 8/9] [git] feat: fetch submodules on-demand --- .config/git/config | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.config/git/config b/.config/git/config index 0dc9787..280ebc7 100644 --- a/.config/git/config +++ b/.config/git/config @@ -10,10 +10,9 @@ submodulesummary = 1 [fetch] prune = true + recurseSubmodules = on-demand [pull] rebase = false -[submodule] - recurse = true [push] recurseSubmodules = check [alias] From 97dcc60445b654891e553ee35f7fe8f499d6ec7a Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Sun, 11 Dec 2022 21:52:39 +0100 Subject: [PATCH 9/9] [sxhkd] fix: do not open a tmux session for neomut --- .config/sxhkd/sxhkdrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 6082152..ea67150 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -73,7 +73,7 @@ super + shift + m $TERMINAL -g 128x32 -c "floating" -e $MUSIC_CLIENT super + shift + n - $TERMINAL -g 128x32 -c "floating" -e tsession "mail" "$MAIL_CLIENT" + $TERMINAL -g 128x32 -c "floating" -e "$MAIL_CLIENT" super + shift + i $TERMINAL -g 128x32 -c "floating" -e tsession "irc" "$IRC_CLIENT"