diff --git a/.config/bash/.bashrc b/.config/bash/.bashrc index bf42cdf..7253679 100644 --- a/.config/bash/.bashrc +++ b/.config/bash/.bashrc @@ -33,6 +33,7 @@ export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quo bind '"\C-o":"lfcd\n"' bind '"\C-t":"tms\n"' +bind '"\C-T":"tms $(pwd)\n"' bind '"\C-n":"zk edit --interactive --sort modified-\n"' bind '"\C-f":"cd $(dirname "$(fzf)")\n"' diff --git a/.config/nvim/lua/lazyvim/init.lua b/.config/nvim/lua/lazyvim/init.lua index e7486f1..313327a 100644 --- a/.config/nvim/lua/lazyvim/init.lua +++ b/.config/nvim/lua/lazyvim/init.lua @@ -23,7 +23,7 @@ require("lazyvim.config").setup() if not vim.g.vscode then require("lazy").setup({ spec = "lazyvim.plugins", - defaults = { lazy = true, version = "*" }, + defaults = { lazy = true, version = false }, checker = { enabled = true }, }) end diff --git a/.config/nvim/lua/lazyvim/plugins/lsp/init.lua b/.config/nvim/lua/lazyvim/plugins/lsp/init.lua index c8121b5..8789129 100644 --- a/.config/nvim/lua/lazyvim/plugins/lsp/init.lua +++ b/.config/nvim/lua/lazyvim/plugins/lsp/init.lua @@ -19,8 +19,10 @@ return { virtual_text = { spacing = 4, prefix = "●" }, severity_sort = true, }, + autoformat = true, servers = { lua_ls = { + mason = true, settings = { Lua = { workspace = { @@ -45,11 +47,13 @@ return { }, }, config = function(plugin, opts) + local Util = require("lazyvim.utils") + -- setup autoformat + require("lazyvim.plugins.lsp.format").autoformat = opts.autoformat -- setup formatting and keymaps - require("lazyvim.utils").on_attach(function(client, buffer) + Util.on_attach(function(client, buffer) require("lazyvim.plugins.lsp.format").on_attach(client, buffer) require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer) - require("lazyvim.plugins.lsp.misc").on_attach(client, buffer) end) -- diagnostics @@ -58,11 +62,28 @@ return { vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" }) end - vim.diagnostic.config(opts.diagnostics) + if type(opts.diagnostics.virtual_text) == "table" and opts.diagnostics.virtual_text.prefix == "icons" then + opts.diagnostics.virtual_text.prefix = vim.fn.has("nvim-0.10.0") == 0 and "●" + or function(diagnostic) + local icons = require("lazyvim.config").icons.diagnostics + for d, icon in pairs(icons) do + if diagnostic.severity == vim.diagnostic.severity[d:upper()] then + return icon + end + end + end + end + + vim.diagnostic.config(vim.deepcopy(opts.diagnostics)) local servers = opts.servers - local capabilities = - require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()) + local capabilities = vim.tbl_deep_extend( + "force", + {}, + vim.lsp.protocol.make_client_capabilities(), + require("cmp_nvim_lsp").default_capabilities(), + opts.capabilities or {} + ) local function setup(server) local server_opts = vim.tbl_deep_extend("force", { @@ -81,15 +102,19 @@ return { require("lspconfig")[server].setup(server_opts) end - local mlsp = require("mason-lspconfig") - local available = mlsp.get_available_servers() + -- get all the servers that are available thourgh mason-lspconfig + local have_mason, mlsp = pcall(require, "mason-lspconfig") + local all_mslp_servers = {} + if have_mason then + all_mslp_servers = vim.tbl_keys(require("mason-lspconfig.mappings.server").lspconfig_to_package) + end local ensure_installed = {} ---@type string[] for server, server_opts in pairs(servers) do if server_opts then server_opts = server_opts == true and {} or server_opts -- run manual setup if mason=false or if this is a server that cannot be installed with mason-lspconfig - if server_opts.mason == false or not vim.tbl_contains(available, server) then + if server_opts.mason == false or not vim.tbl_contains(all_mslp_servers, server) then setup(server) else ensure_installed[#ensure_installed + 1] = server @@ -97,8 +122,10 @@ return { end end - require("mason-lspconfig").setup({ ensure_installed = ensure_installed }) - require("mason-lspconfig").setup_handlers({ setup }) + if have_mason then + mlsp.setup({ ensure_installed = ensure_installed }) + mlsp.setup_handlers({ setup }) + end end, }, @@ -110,6 +137,7 @@ return { opts = function() local nls = require("null-ls") return { + root_dir = require("null-ls.utils").root_pattern(".null-ls-root", ".neoconf.json", "Makefile", ".git"), debug = false, sources = { nls.builtins.formatting.stylua, @@ -143,7 +171,6 @@ return { "stylua", "shellcheck", "shfmt", - "flake8", }, }, config = function(plugin, opts) diff --git a/.config/nvim/lua/lazyvim/plugins/utility.lua b/.config/nvim/lua/lazyvim/plugins/utility.lua index 98d0a32..41be6fb 100644 --- a/.config/nvim/lua/lazyvim/plugins/utility.lua +++ b/.config/nvim/lua/lazyvim/plugins/utility.lua @@ -182,10 +182,12 @@ return { on_open = function() vim.g.cmp_active = false vim.cmd([[LspStop]]) + vim.opt.sidescrolloff = 0 end, on_close = function() vim.g.cmp_active = true vim.cmd([[LspStart]]) + vim.opt.sidescrolloff = 8 end, }) end, diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index 57d412d..b6c13a3 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -55,7 +55,6 @@ alias \ tmn="tmux new" \ tma="tmux-worker" \ tms="tmux-sessioniser" \ - tm.="tmux-sessioniser ." # Alias some extra things for ease of use alias \ diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf index e83046f..b057035 100644 --- a/.config/tmux/tmux.conf +++ b/.config/tmux/tmux.conf @@ -37,10 +37,6 @@ set -g mouse on # Key Binds # ----------------------------------------------------------------------------- -# forget the find window. That is for chumps -bind-key -r f run-shell "tmux neww tmux-sessionizer" -bind-key -r i run-shell "tmux neww cht.sh" - # Reload the tmux config. bind-key r source-file ~/.config/tmux/tmux.conf diff --git a/.local/bin/setvol b/.local/bin/setvol index a1fda14..87d337c 100755 --- a/.local/bin/setvol +++ b/.local/bin/setvol @@ -1,13 +1,7 @@ #!/bin/bash -default_loc="$HOME/.cache/pactl-default-sink" - -if [ ! -f "$default_loc" ] ; then - set-default-sink -fi - -default=$(<"$default_loc") - value=${1-$(echo -e "" | dmenu -bw 0 -i -p "Set vol to what?")} -pactl set-sink-volume "$default" "$value%" +wpctl set-volume @DEFAULT_AUDIO_SINK@ "$value%" + +pkill -RTMIN+3 dwmblocks diff --git a/.local/bin/status-bat b/.local/bin/status-bat index 9a364e5..73b727a 100755 --- a/.local/bin/status-bat +++ b/.local/bin/status-bat @@ -1,7 +1,8 @@ #!/bin/bash case $BUTTON in - 3) notify-send "Scroll to change adjust backlight." ;; + 3) notify-send "Battery Module" "Shows battery status info +- Scroll to adjust the backlight.";; 4) mod_backlight up ;; 5) mod_backlight down ;; 6) "$TERMINAL" -e "$EDITOR" "$0" ;; diff --git a/.local/bin/status-clock b/.local/bin/status-clock index 4a938f8..bd3cad6 100755 --- a/.local/bin/status-clock +++ b/.local/bin/status-clock @@ -3,7 +3,8 @@ case $BUTTON in 1) notify-send "This Month" "$(cal --color=always | sed "s/..7m//;s|..27m||")" && notify-send "Appointments" "$(calcurse -d3)" ;; 2) setsid -f "$TERMINAL" -e calcurse ;; - 3) notify-send "Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\` + 3) notify-send "Time/date module" "Shows calendar and appointments +- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\` - Middle click opens calcurse if installed" ;; 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac diff --git a/.local/bin/status-disk b/.local/bin/status-disk index 5096d8c..2471044 100755 --- a/.local/bin/status-disk +++ b/.local/bin/status-disk @@ -4,7 +4,8 @@ homeval=$(df -h -B 1048576 | grep "/home") case $BUTTON in 1) notify-send "Disk space" "$(df -h --output=target,used,size)" ;; - 3) notify-send "Disk module" "Click to show all disk info." ;; + 3) notify-send "Disk module" "Shows disk usage information +- Click to show all disk info." ;; 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac diff --git a/.local/bin/status-mem b/.local/bin/status-mem index a886150..8e12f9a 100755 --- a/.local/bin/status-mem +++ b/.local/bin/status-mem @@ -3,7 +3,7 @@ case $BUTTON in 1) notify-send "Memory hogs" "$(ps axch -o cmd:15,%mem --sort=-%mem | head)" ;; 2) setsid -f "$TERMINAL" -e htop ;; - 3) notify-send "Memory module" "\- Shows Memory Used/Total. + 3) notify-send "Memory module" "Shows Memory Used/Total. - Click to show memory hogs. - Middle click to open htop." ;; 6) "$TERMINAL" -e "$EDITOR" "$0" ;; diff --git a/.local/bin/status-net b/.local/bin/status-net index 12c6912..6797ca3 100755 --- a/.local/bin/status-net +++ b/.local/bin/status-net @@ -4,9 +4,10 @@ # Show  if connected to ethernet or ❎ if none. # Show 🔒 if a vpn connection is active -case $BLOCK_BUTTON in +case $BUTTON in 1) "$TERMINAL" -e nmtui; pkill -RTMIN+15 dwmblocks ;; - 3) notify-send "Internet module" "\- Click to connect + 3) notify-send "Internet module" "Shows network status +- Click to connect ❌: wifi disabled 󰖪 : no wifi connection  : wifi connection with quality diff --git a/.local/bin/status-vol b/.local/bin/status-vol index a80e3ea..96e0e62 100755 --- a/.local/bin/status-vol +++ b/.local/bin/status-vol @@ -7,7 +7,8 @@ case $BUTTON in 2) wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle ;; 4) wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+ ;; 5) wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%- ;; - 3) notify-send "Volume module" "\- Shows volume,  if muted. + 3) notify-send "Volume module" "Shows current volume +- Shows volume,  if muted. - Middle click to mute. - Scroll to change." ;; 6) "$TERMINAL" -e "$EDITOR" "$0" ;;