This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local RemoveComments = function() | |
local ts = vim.treesitter | |
local bufnr = vim.api.nvim_get_current_buf() | |
local ft = vim.bo[bufnr].filetype | |
local lang = ts.language.get_lang(ft) or ft | |
local ok, parser = pcall(ts.get_parser, bufnr, lang) | |
if not ok then return vim.notify("No parser for " .. ft, vim.log.levels.WARN) end | |
local tree = parser:parse()[1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Print useful information about the window node by retrieving data from bspwm, X11 and Process Info (PID, RAM, CPU) | |
# Also displays it via notify-send | |
# Recommended usage: Add a keybinding in sxhkdrc to execute this script and run it only on the currently focused window to receive a notification with useful node information | |
# Requirements: bspwm (bspc), jq, xprop (x11-utils), notify-send (libnotify), servidor X11 | |
set -e | |
node_id=${1:-$(bspc query -N -n focused)} | |
if [[ -z "$node_id" ]]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use: `man somthing` | |
# Desc: This function adds the man command but opens it with nvim if it exists for your zsh or bash configuration. | |
function man() { | |
if ! command -v nvim &> /dev/null; then | |
echo "nvim is not installed, using normal man command" | |
command man "$@" | |
else | |
command man "$@" | col -bx | nvim -R - +'set ft=man' | |
fi | |
} |