diff options
| -rw-r--r-- | .config/nvim/lazy-lock.json | 85 | ||||
| -rw-r--r-- | .config/nvim/lua/fzf.lua | 3 | ||||
| -rw-r--r-- | .config/nvim/lua/lsp.lua | 18 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins.lua | 11 | ||||
| -rw-r--r-- | .config/nvim/lua/treesitter.lua | 2 | ||||
| -rw-r--r-- | .config/sway/config | 38 | ||||
| -rwxr-xr-x | bin/idlechecker | 33 | ||||
| -rwxr-xr-x | bin/pretty-lock | 27 |
8 files changed, 145 insertions, 72 deletions
diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 829401d..fe80b5c 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,59 +1,60 @@ { "JABS.nvim": { "branch": "main", "commit": "b6dbd1a3e1b8cef3d6ebfafe96c2230ca341b65f" }, - "auto-session": { "branch": "main", "commit": "15586c4b997f4fc031432f958a942ba3b201d6aa" }, - "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "auto-session": { "branch": "main", "commit": "00334ee24b9a05001ad50221c8daffbeedaa0842" }, + "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" }, "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "031e6ba70b0ad5eee49fd2120ff7a2e325b17fa7" }, "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, - "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" }, "cmp-vsnip": { "branch": "main", "commit": "989a8a73c44e926199bfd05fa7a516d51f2d2752" }, - "fzf-lua": { "branch": "main", "commit": "975534f4861e2575396716225c1202572645583d" }, - "gitsigns.nvim": { "branch": "main", "commit": "220446c8c86a280180d852efac60991eaf1a21d4" }, - "go.nvim": { "branch": "master", "commit": "cde0c7a110c0f65b9e4e6baf342654268efff371" }, + "fzf-lua": { "branch": "main", "commit": "b45881a2043d96506ba628f3bc65a4594b179c4e" }, + "gitsigns.nvim": { "branch": "main", "commit": "43b0c856ae5f32a195d83f4a27fe21d63e6c966c" }, + "go.nvim": { "branch": "master", "commit": "37ec4d9be3edef64b725bfe29684e1fe019873bc" }, "jai.vim": { "branch": "master", "commit": "72c09c5f803b8ab2e708a3ad2b7c3704e2b4b3d8" }, - "lazy.nvim": { "branch": "main", "commit": "b02c9eae6a250f98908c146d1dc1a891f5019f0a" }, - "leap.nvim": { "branch": "main", "commit": "c6bfb191f1161fbabace1f36f578a20ac6c7642c" }, - "lspsaga.nvim": { "branch": "main", "commit": "6f920cfabddb9b7de5a3a4d0b7cd4f0774ae23e2" }, + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "leap.nvim": { "branch": "main", "commit": "2b68ddc0802bd295e64c9e2e75f18f755e50dbcc" }, + "lsp-zero.nvim": { "branch": "v2.x", "commit": "320d5913bc5a0b0f15537e32777331d2323ab7f8" }, + "lspsaga.nvim": { "branch": "main", "commit": "920b1253e1a26732e53fac78412f6da7f674671d" }, "lua-utils.nvim": { "branch": "main", "commit": "e565749421f4bbb5d2e85e37c3cef9d56553d8bd" }, - "lualine.nvim": { "branch": "master", "commit": "6a40b530539d2209f7dc0492f3681c8c126647ad" }, + "lualine.nvim": { "branch": "master", "commit": "15884cee63a8c205334ab13ab1c891cd4d27101a" }, "luarocks.nvim": { "branch": "main", "commit": "1db9093915eb16ba2473cfb8d343ace5ee04130a" }, "marks.nvim": { "branch": "master", "commit": "bb25ae3f65f504379e3d08c8a02560b76eaf91e8" }, - "neorg": { "branch": "main", "commit": "ace80b05771b65d6633f3c64b8d930b5787f20d0" }, - "nerdcommenter": { "branch": "master", "commit": "7bb1f72e802a80e37bdda5f6906c69b5a93de1eb" }, - "netrw.nvim": { "branch": "master", "commit": "c64f60b8a613900aad82ef1c285b892eb43e9e15" }, - "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, - "nvim-autopairs": { "branch": "master", "commit": "78a4507bb9ffc9b00f11ae0ac48243d00cb9194d" }, - "nvim-bqf": { "branch": "main", "commit": "1b24dc6050c34e8cd377b6b4cd6abe40509e0187" }, - "nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" }, - "nvim-dap": { "branch": "master", "commit": "6f79b822997f2e8a789c6034e147d42bc6706770" }, - "nvim-lspconfig": { "branch": "master", "commit": "cf97d2485fc3f6d4df1b79a3ea183e24c272215e" }, - "nvim-nio": { "branch": "master", "commit": "7969e0a8ffabdf210edd7978ec954a47a737bbcc" }, - "nvim-treesitter": { "branch": "master", "commit": "ebdffa78bdb16af84fb76ff6a75978496d4dcbec" }, - "nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" }, + "neorg": { "branch": "main", "commit": "e206c9642f4a115cd836e76c98ef785623d335bc" }, + "nerdcommenter": { "branch": "master", "commit": "02a3b6455fa07b61b9440a78732f1e9b7876c991" }, + "netrw.nvim": { "branch": "master", "commit": "90501c62b9b816ed3ed1e912ae9db9af5671a1b2" }, + "nui.nvim": { "branch": "main", "commit": "f535005e6ad1016383f24e39559833759453564e" }, + "nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" }, + "nvim-bqf": { "branch": "main", "commit": "e20417d5e589e03eaaaadc4687904528500608be" }, + "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, + "nvim-dap": { "branch": "master", "commit": "8df427aeba0a06c6577dc3ab82de3076964e3b8d" }, + "nvim-lspconfig": { "branch": "master", "commit": "61e5109c8cf24807e4ae29813a3a82b31821dd45" }, + "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, + "nvim-treesitter": { "branch": "master", "commit": "28d480e0624b259095e56f353ec911f9f2a0f404" }, + "nvim-web-devicons": { "branch": "master", "commit": "f1420728f59843eb2ef084406b3d0201a0a0932d" }, "odin.vim": { "branch": "master", "commit": "e7ce5f9d1804273986c661132de19798b0b2b267" }, - "oil.nvim": { "branch": "master", "commit": "10fbfdd37b6904c0776c5db1a27ab47eecba335e" }, - "pathlib.nvim": { "branch": "main", "commit": "7a5a6facd29e306bc73a37719fa67c0d2226f852" }, - "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, + "oil.nvim": { "branch": "master", "commit": "685cdb4ffa74473d75a1b97451f8654ceeab0f4a" }, + "pathlib.nvim": { "branch": "main", "commit": "57e5598af6fe253761c1b48e0b59b7cd6699e2c1" }, + "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" }, "rust.vim": { "branch": "master", "commit": "889b9a7515db477f4cb6808bef1769e53493c578" }, - "sqls.nvim": { "branch": "main", "commit": "4b1274b5b44c48ce784aac23747192f5d9d26207" }, - "templ.vim": { "branch": "main", "commit": "5cc48b93a4538adca0003c4bc27af844bb16ba24" }, - "text-case.nvim": { "branch": "main", "commit": "ec9925b27dd54809653cc766b8673acd979a888e" }, + "sqls.nvim": { "branch": "main", "commit": "d1bc5421ef3e8edc5101e37edbb7de6639207a09" }, + "templ.vim": { "branch": "main", "commit": "d482ee0bcf0606530725af27edaa320e5aaa4808" }, + "text-case.nvim": { "branch": "main", "commit": "e898cfd46fa6cde0e83abb624a16e67d2ffc6457" }, "tmuxline.vim": { "branch": "master", "commit": "4119c553923212cc67f4e135e6f946dc3ec0a4d6" }, - "todo-comments.nvim": { "branch": "main", "commit": "8f45f353dc3649cb9b44cecda96827ea88128584" }, - "vim-cool": { "branch": "master", "commit": "662e7b11064cbeedad17c45d2fe926e78d3cd0b6" }, - "vim-dadbod": { "branch": "master", "commit": "7888cb7164d69783d3dce4e0283decd26b82538b" }, + "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, + "vim-cool": { "branch": "master", "commit": "9ea940c0d537e55de0de4c0298c04b976960fb12" }, + "vim-dadbod": { "branch": "master", "commit": "fa31d0ffeebaa59cf97a81e7f92194cced54a13f" }, "vim-ember-hbs": { "branch": "master", "commit": "777095c1b25f334cef9db5504c7d409d52843aa9" }, - "vim-endwise": { "branch": "master", "commit": "3719ffddb5e42bf67b55b2183d7a6fb8d3e5a2b8" }, - "vim-eunuch": { "branch": "master", "commit": "8fb3904be27b6b60d086f87c2570085902414069" }, - "vim-fugitive": { "branch": "master", "commit": "8c8cdf4405cb8bdb70dd9812a33bb52363a87dbc" }, - "vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" }, + "vim-endwise": { "branch": "master", "commit": "eab530110d7a0d985902a3964894816b50dbf31a" }, + "vim-eunuch": { "branch": "master", "commit": "e86bb794a1c10a2edac130feb0ea590a00d03f1e" }, + "vim-fugitive": { "branch": "master", "commit": "4a745ea72fa93bb15dd077109afbb3d1809383f2" }, + "vim-illuminate": { "branch": "master", "commit": "fbc16dee336d8cc0d3d2382ea4a53f4a29725abf" }, "vim-magnum": { "branch": "master", "commit": "7a30761b935d72bada5bbe90162a6afdb77c858d" }, - "vim-matchup": { "branch": "master", "commit": "1535a769d5dca851fe7d41b0be95f7c7203a4bef" }, + "vim-matchup": { "branch": "master", "commit": "ea2ff43e09e68b63fc6d9268fc5d82d82d433cb3" }, "vim-radical": { "branch": "master", "commit": "aca8992a25d317a4c6fa42e263e8506ea3e355d8" }, - "vim-repeat": { "branch": "master", "commit": "5bd4c87a1417a7187d0329e81eb83514ee481250" }, - "vim-visual-multi": { "branch": "master", "commit": "38b0e8d94a5499ccc17d6159763d32c79f53417b" }, - "vim-vsnip": { "branch": "master", "commit": "02a8e79295c9733434aab4e0e2b8c4b7cea9f3a9" }, - "zen-mode.nvim": { "branch": "main", "commit": "21976479c7a0146b05a42707cf91c86b1e510945" }, - "zig.vim": { "branch": "master", "commit": "54c216e5306a5c3878a60596aacb94dca8652ab9" } + "vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" }, + "vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" }, + "vim-vsnip": { "branch": "master", "commit": "0a4b8419e44f47c57eec4c90df17567ad4b1b36e" }, + "zen-mode.nvim": { "branch": "main", "commit": "863f150ca321b3dd8aa1a2b69b5f411a220e144f" }, + "zig.vim": { "branch": "master", "commit": "e55a7949561d34822b7cd2290819927b79825dcd" } } diff --git a/.config/nvim/lua/fzf.lua b/.config/nvim/lua/fzf.lua index 8e12047..30ad864 100644 --- a/.config/nvim/lua/fzf.lua +++ b/.config/nvim/lua/fzf.lua @@ -1,10 +1,11 @@ local fzf = require('fzf-lua') vim.keymap.set('n', '<c-b>', fzf.buffers, {}) -vim.keymap.set('n', '<c-m>', fzf.marks, {}) +vim.keymap.set('n', '<c-t>', fzf.marks, {}) vim.keymap.set('n', '<leader>fb', fzf.lines, {}) vim.keymap.set('n', '<leader>ff', fzf.files, {}) vim.keymap.set('n', '<leader>fg', fzf.live_grep, {}) vim.keymap.set('n', '<leader>fw', fzf.grep_cword, {}) +vim.keymap.set('n', 'fw', fzf.grep_cword, {}) vim.keymap.set('n', '<leader>fW', fzf.grep_cWORD, {}) vim.keymap.set('v', '<leader>ff', fzf.grep_visual, {}) vim.keymap.set('v', '<c-f>', fzf.grep_visual, {}) diff --git a/.config/nvim/lua/lsp.lua b/.config/nvim/lua/lsp.lua index 6db6bff..467214a 100644 --- a/.config/nvim/lua/lsp.lua +++ b/.config/nvim/lua/lsp.lua @@ -4,7 +4,7 @@ vim.keymap.set('n', '<c-[>', vim.diagnostic.goto_prev, opts) vim.keymap.set('n', '<c-]>', vim.diagnostic.goto_next, opts) -- vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts) -vim.lsp.set_log_level("info") +-- vim.lsp.set_log_level("debug") -- Use an on_attach function to only map the following keys -- after the language server attaches to the current buffer @@ -188,22 +188,6 @@ if not configs.jails then end lspconfig.jails.setup({}) vim.filetype.add({ extension = { jai = "jai", } }) --- local lsp = require 'lspconfig' --- local configs = require 'lspconfig.configs' - --- if not configs.jai_lsp then --- configs.jai_lsp = { --- default_config = { --- cmd = { 'jails' }, --- filetypes = { 'jai' }, --- } --- } --- end - --- lspconfig.jai_lsp.setup({ --- on_attach = on_attach, --- capabilities = capabilities, --- }) lspconfig.ols.setup({ on_attach = on_attach, diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index f1ce125..88dcfcb 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -182,4 +182,15 @@ return require('lazy').setup({ opts = { }, }, + + { + "VonHeikemen/lsp-zero.nvim", + branch = "v2.x", + config = false, + init = function() + -- Disable automatic setup, we are doing it manually + vim.g.lsp_zero_extend_cmp = 0 + vim.g.lsp_zero_extend_lspconfig = 0 + end, + }, }) diff --git a/.config/nvim/lua/treesitter.lua b/.config/nvim/lua/treesitter.lua index ce17c70..6ad066d 100644 --- a/.config/nvim/lua/treesitter.lua +++ b/.config/nvim/lua/treesitter.lua @@ -23,6 +23,8 @@ require 'nvim-treesitter.configs'.setup { -- [options] }, } + + local parser_config = require("nvim-treesitter.parsers").get_parser_configs() parser_config.jai = { install_info = { diff --git a/.config/sway/config b/.config/sway/config index df19b04..e1f952c 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -37,11 +37,25 @@ bindsym $mod+Shift+q exec --no-startup-id ~/bin/safequit # start dmenu (a program launcher) bindsym $mod+d exec --no-startup-id fuzzel +# QWERTY +set $left h +set $down j +set $up k +set $right l +set $exit e + +# COLEMAK +# set $left n +# set $down e +# set $up u +# set $right i +# set $exit k # change focus -bindsym $mod+n focus left -bindsym $mod+e focus down -bindsym $mod+u focus up -bindsym $mod+i focus right +bindsym $mod+$left focus left +bindsym $mod+$down focus down +bindsym $mod+$up focus up +bindsym $mod+$right focus right + # alternatively, you can use the cursor keys: #bindsym $mod+Left focus left @@ -50,10 +64,10 @@ bindsym $mod+i focus right #bindsym $mod+Right focus right # move focused window -bindsym $mod+Shift+n move left -bindsym $mod+Shift+e move down -bindsym $mod+Shift+u move up -bindsym $mod+Shift+i move right +bindsym $mod+Shift+$left move left +bindsym $mod+Shift+$down move down +bindsym $mod+Shift+$up move up +bindsym $mod+Shift+$right move right # alternatively, you can use the cursor keys: #bindsym $mod+Shift+Left move left @@ -145,7 +159,9 @@ bindsym $mod+Shift+0 move container to workspace $ws10; workspace $ws10 # reload the configuration file bindsym $mod+Shift+c reload -bindsym $mod+Shift+k exec "swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway?' -B 'Yes, exit sway' 'swaymsg exit'" +bindsym $mod+Shift+$exit exec "swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway?' -B 'Yes, exit sway' 'swaymsg exit'" + + # resize window (you can also use the mouse for that) mode "resize" { @@ -243,11 +259,11 @@ client.focused_inactive "#23242a" "#2b2b2b" "#888888" "#000000" "#2b2b2b" client.unfocused "#2c2c2c" "#2b2b2b" "#888888" "#000000" "#2c2c2c" # A lock command used in several places -# set $lock_script ~/bin/pretty-lock +set $lock_script ~/bin/pretty-lock # A sleep command used in several places. # We leave a bit of time for locking to happen before putting the system to sleep -# set $sleep $lock_script && sleep 3 && systemctl suspend +set $sleep $lock_script && sleep 3 && systemctl suspend # Triggers a short notification set $notify dunstify --timeout 1500 diff --git a/bin/idlechecker b/bin/idlechecker index 36261e9..197d534 100755 --- a/bin/idlechecker +++ b/bin/idlechecker @@ -1,6 +1,37 @@ #!/bin/sh +LOCKFILE="$HOME/.local/state/algo/swayidle.lock" +LOCKDIR="$(dirname "$LOCKFILE")" + +# Ensure the directory exists +mkdir -p "$LOCKDIR" + +# Check if lockfile exists and process is running +if [ -e "$LOCKFILE" ]; then + LOCKPID=$(cat "$LOCKFILE") + if kill -0 "$LOCKPID" 2>/dev/null; then + echo "swayidle is already running with PID $LOCKPID" + exit 1 + else + echo "Stale lockfile found. Removing." + rm -f "$LOCKFILE" + fi +fi + +# Create lockfile with current PID +echo $$ > "$LOCKFILE" + +# Function to clean up on exit +cleanup() { + rm -f "$LOCKFILE" +} +trap cleanup EXIT + + # xss-lock -- ./pretty-lock & swayidle -w \ timeout 300 '~/bin/pretty-lock' \ - before-sleep '~/bin/pretty-lock' + timeout 500 'swaymsg "output * dpms off"' \ + resume 'swaymsg "output * dpms on"' \ + before-sleep 'swaymsg "output * dpms off"' \ + before-sleep '~/bin/pretty-lock' diff --git a/bin/pretty-lock b/bin/pretty-lock index 8ef40e0..48918f6 100755 --- a/bin/pretty-lock +++ b/bin/pretty-lock @@ -1,5 +1,32 @@ #!/bin/sh +LOCKFILE="$HOME/.local/state/algo/swayidle.lock" +LOCKDIR="$(dirname "$LOCKFILE")" + +# Ensure the directory exists +mkdir -p "$LOCKDIR" + +# Check if lockfile exists and process is running +if [ -e "$LOCKFILE" ]; then + LOCKPID=$(cat "$LOCKFILE") + if kill -0 "$LOCKPID" 2>/dev/null; then + echo "swayidle is already running with PID $LOCKPID" + exit 1 + else + echo "Stale lockfile found. Removing." + rm -f "$LOCKFILE" + fi +fi + +# Create lockfile with current PID +echo $$ > "$LOCKFILE" + +# Function to clean up on exit +cleanup() { + rm -f "$LOCKFILE" +} +trap cleanup EXIT + swaylock \ -f \ --screenshots \ |
