Skip to content

Instantly share code, notes, and snippets.

View Compro-Prasad's full-sized avatar
🔨
Building stuff. Mostly software.

Compro Prasad Compro-Prasad

🔨
Building stuff. Mostly software.
View GitHub Profile
@cyio
cyio / install-ripgrep-on-ubuntu.sh
Last active July 17, 2019 08:21
Install ripgrep on Debian / Ubuntu
#!/bin/bash
[[ $UID == 0 ]] || { echo "run as sudo to install"; exit 1; }
if ! [ -x "$(command -v jq)" ]; then
echo 'Error: jq is not installed.' >&2
apt install jq -y
fi
REPO="https://github.com/BurntSushi/ripgrep/releases/download/"
RG_LATEST=$(curl -sSL "https://api.github.com/repos/BurntSushi/ripgrep/releases/latest" | jq --raw-output .tag_name)
(defun copy-current-line-position-to-clipboard (p)
"Copy current line in file to clipboard as '</path/to/file>:<line-number>'"
(interactive "sAbsolute path y/n?: ")
(let ((path-with-line-number) (file-name (buffer-file-name)))
(when (and (not (string= p "y")) (projectile-project-root))
(setq file-name (file-relative-name buffer-file-name (projectile-project-root)))
)
(setq path-with-line-number (concat file-name ":" (number-to-string (line-number-at-pos))))
(x-select-text path-with-line-number)
(message (concat path-with-line-number " copied to clipboard"))))
(defvar use-layer-configuration-layers nil)
(defvar use-layer-init-hook nil)
(defvar use-layer-config-hook nil)
(defvar use-layer-excluded-packages nil)
(defsubst use-layer-error (msg)
(error "use-layer: %s" msg))