Opengist

Explore

  • All gists
  • Topics
  • Users
Give feedback on the new UI Powered by Opengist ⋅ 25ms

user:thomas gists created by user

title:mygist gists with given title

description:sync gists with given description

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

all:systemctl search all fields

Login
v

vim

Recently created Least recently created Recently updated Least recently updated
santiago

santiago / vd.sh - fzf pick + vim edit

Last active 2 hours ago bash fzf linux vim

use fzf to select file and launch editor

0 0 1
1 #!/usr/bin/env zsh
2
3 # Use fzf and open file in text editor
4
5 vd() {
6 # folder, default to current directory
7 # depth, default to 1
8 local dir=${1:-.}
9 local depth=${2:-1}
10 local selected_file
santiago

santiago / vv.sh - vim or sudo vim

Last active 2 hours ago bash vim

Bash command to edit file with nvim with my user or sudo if necessary to write the file. Use config for my user with root (will download modules again)

0 0 1
1 #!/bin/bash
2
3 vv() {
4 if [ $# -eq 0 ]; then
5 echo "Usage: vv <file>"
6 echo "Will edit with current user or sudo if needed but using nvim config of this user"
7 return 1
8 fi
9
10 vpath=$(which $EDITOR)