diff options
| author | filip <“filip.rabiega@gmail.com”> | 2026-02-14 12:11:31 +0100 |
|---|---|---|
| committer | filip <“filip.rabiega@gmail.com”> | 2026-02-14 12:11:31 +0100 |
| commit | 4829b3f7720ad7953690bdefa559fda3a32a6518 (patch) | |
| tree | c424b391a1c9ac6585d46be51e5072ee7d51de2c | |
| parent | e5f3e6f06280f80d1dcff57f9ad654b7cf53e65b (diff) | |
| download | dotfiles-4829b3f7720ad7953690bdefa559fda3a32a6518.tar.gz dotfiles-4829b3f7720ad7953690bdefa559fda3a32a6518.tar.bz2 dotfiles-4829b3f7720ad7953690bdefa559fda3a32a6518.zip | |
new stuff
| -rw-r--r-- | .config/nvim/init.lua | 42 | ||||
| -rw-r--r-- | .config/shell/aliasrc | 23 | ||||
| -rw-r--r-- | .config/shell/envvarrc | 2 | ||||
| -rw-r--r-- | .config/x11/xprofile | 2 |
4 files changed, 51 insertions, 18 deletions
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 2c7e130..e4a910c 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -74,7 +74,6 @@ vim.opt.completeopt = { "menuone", "noinsert" } ------------------------------------------------------------ -- Clipboard and mouse ------------------------------------------------------------ -vim.opt.clipboard:append("unnamedplus") vim.opt.mouse = "a" ------------------------------------------------------------ @@ -168,9 +167,6 @@ end -- Delete char before cursor + char under cursor map("n", "<BS>", "dBx", { desc = "Delete char before + under cursor" }) --- Insert blank line below current line and center view -map("n", "s", "o<Esc>kzz", { desc = "Insert blank line below + center" }) - -- Start substitute on current line (pre-filled :%s//g) map("n", "S", ":%s//g<Left><Left>", { silent = false, desc = "Substitute on current line" }) -- Note: silent = false because it enters command-line mode @@ -198,12 +194,40 @@ map("n", "<Tab><Tab>", "<C-^>", { desc = "Toggle last / alternate buffer" }) -- Split window vertically map("n", "vv", "<C-w>v", { desc = "Split the current window vertically" }) +-- Insert blank line below current line and center view +map("n", "<leader>o", "o<Esc>kzz", { desc = "Insert blank line below + center" }) + -- Pressing <leader>h will prompt for a help topic and open it in vsplit map("n", "<leader>h", ":vert help ", { desc = "Open help vertically" }) -- Open messages in vplit map("n", "<leader>m", ":vnew | put =execute('messages')<CR>", { desc = "Open messages in vsplit" }) +-- Explain diagnostics +map("n", "<leader>de", ":lua vim.diagnostic.open_float()<CR>", { desc = "Explain diagnostics" }) + +-- Go to the next diagnostic +map("n", "<leader>dn", ":lua vim.diagnostic.goto_next()<CR>", { desc = "Go to the next diagnostic" }) + +-- Go to the previous diagnostic +map("n", "<leader>dp", ":lua vim.diagnostic.goto_prev()<CR>", { desc = "Go to the previous diagnostic" }) + +-- Open diagnostics locations +map("n", "<leader>dl", ":lua vim.diagnostic.setqflist()<CR>", { desc = "Open diagnostics locations" }) + +-- Toggle diagnostics +map("n", "<leader>dt", function() + local is_enabled = vim.diagnostic.is_enabled() + vim.diagnostic.enable(not is_enabled) + + -- Print a small message so you know the state + if not is_enabled then + print("Diagnostics Enabled") + else + print("Diagnostics Disabled") + end +end, { desc = "Toggle diagnostics" }) + -- Repeat action on visual block map("v", ".", ":normal .<CR>", { desc = "Repeat action on visual block" }) @@ -216,6 +240,16 @@ map("n", "<C-Down>", ":resize -2<CR>", { desc = "Decrease window height" }) map("n", "<C-Left>", ":vertical resize +2<CR>", { desc = "Increase window width" }) map("n", "<C-Right>", ":vertical resize -2<CR>", { desc = "Decrease window width" }) +-- Create a custom user command to restart LSP +vim.api.nvim_create_user_command("LspRestart", function() + local clients = vim.lsp.get_clients() + for _, client in ipairs(clients) do + vim.lsp.stop_client(client.id) + end + vim.cmd("edit") -- Re-opens the file to trigger LSP start + print("LSP Restarted") +end, {}) + ------------------------------------------------------------ -- Tabs & indentation ------------------------------------------------------------ diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index 172b5bf..f767152 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -5,10 +5,11 @@ [ -f "$XINITRC" ] && alias startx="startx \$XINITRC" # sudo not required for some system commands -sudo_cmds="mount umount sv apt apt-get aptitude dpkg su shutdown poweroff reboot cryptsetup" +sudo_cmds="mount umount sv apt apt-get aptitude dpkg shutdown poweroff reboot cryptsetup" for command in $sudo_cmds; do alias \$command="sudo \$command" -done; unset command +done +unset command # Verbosity and settings that you pretty much just always are going to want. alias \ @@ -22,7 +23,7 @@ alias \ rm="logrm -vI" \ rmdir="rmdir -vp" \ rsync="rsync -vrPlu" \ - vim="nvim" \ + vim="nvim" # Colorize commands when possible. alias \ @@ -33,20 +34,20 @@ alias \ fgrep="fgrep --color=auto" \ grep="grep --color=auto" \ ip="ip -color=auto" \ - vdir="vdir --color=auto" \ + vdir="vdir --color=auto" # Making stuff easy to customize and source automatically alias \ - vrc='$EDITOR "$HOME/.config/nvim/init.lua"' \ - zal='$EDITOR "$ZDOTDIR/aliasrc" && source "$ZDOTDIR/aliasrc"' \ - zen='$EDITOR "$ZDOTDIR/envvarrc" && source "$ZDOTDIR/envvarrc"' \ - zrc='$EDITOR "$ZDOTDIR/.zshrc" && source "$ZDOTDIR/.zshrc"' \ + vrc='$EDITOR "$HOME/.config/nvim/init.lua"' \ + zal='$EDITOR "$ZDOTDIR/aliasrc" && source "$ZDOTDIR/aliasrc"' \ + zen='$EDITOR "$ZDOTDIR/envvarrc" && source "$ZDOTDIR/envvarrc"' \ + zrc='$EDITOR "$ZDOTDIR/.zshrc" && source "$ZDOTDIR/.zshrc"' # Aliases for connecting to server alias \ - ctg="ssh git@rabiega.xyz" \ + ctg="ssh git@rabiega.xyz" \ cts="ssh root@rabiega.xyz" \ - ctc="ssh root@chadguide.site" \ + ctc="ssh root@chadguide.site" # Making stuff shorter alias \ @@ -61,7 +62,7 @@ alias \ sd="sudo shutdown -h now" \ sql="pgcli" \ update="sudo apt update && apt upgrade" \ - wttr="curl wttr.in/Wroclaw" \ + wttr="curl wttr.in/Wroclaw" # Git aliases alias \ diff --git a/.config/shell/envvarrc b/.config/shell/envvarrc index 5401b1d..acdb24d 100644 --- a/.config/shell/envvarrc +++ b/.config/shell/envvarrc @@ -67,8 +67,6 @@ export GOBIN="$GOPATH/bin" # Python / Conda export _CONDA_ROOT="$HOME/.local/opt/miniconda3" export IPYTHONDIR="$XDG_CONFIG_HOME/ipython" - -# Ren'Py export RENPY_USER="$HOME/langs/python/renpy" # Java diff --git a/.config/x11/xprofile b/.config/x11/xprofile index aa66e07..35af708 100644 --- a/.config/x11/xprofile +++ b/.config/x11/xprofile @@ -5,7 +5,7 @@ autostart="remaps slstatus xcompmgr xhidecursor" for program in $autostart; do - pidof -sx "$program" || "$program" & + pidof -sx "$program" || "$program" & done >/dev/null 2>&1 # Set wallpaper |
