Add .e alias (more to come) and edit command; Remove auto-pair vim-plug
This commit is contained in:
parent
99af6469c9
commit
d47923cdba
3 changed files with 27 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
alias .evim='vim $HOME/.config/vim/vimrc'
|
||||||
alias .f='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
|
alias .f='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
|
||||||
|
|
||||||
alias aliases='vim ~/.config/aliasrc && source ~/.config/aliasrc'
|
alias aliases='vim ~/.config/aliasrc && source ~/.config/aliasrc'
|
||||||
|
|
|
@ -18,7 +18,6 @@ call plug#begin('~/.config/vim/plugged')
|
||||||
Plug 'scrooloose/nerdtree'
|
Plug 'scrooloose/nerdtree'
|
||||||
Plug 'vim-scripts/DoxygenToolkit.vim'
|
Plug 'vim-scripts/DoxygenToolkit.vim'
|
||||||
Plug 'drmikehenry/vim-headerguard'
|
Plug 'drmikehenry/vim-headerguard'
|
||||||
Plug 'jiangmiao/auto-pairs'
|
|
||||||
|
|
||||||
" Eye-Candy
|
" Eye-Candy
|
||||||
Plug 'itchyny/lightline.vim'
|
Plug 'itchyny/lightline.vim'
|
||||||
|
|
26
.local/bin/edit
Executable file
26
.local/bin/edit
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
#!/usr/bin/sh
|
||||||
|
|
||||||
|
priv_cmd="sudo"
|
||||||
|
|
||||||
|
if [ -x "$(command -v doas)" ]
|
||||||
|
then
|
||||||
|
priv_cmd="doas --"
|
||||||
|
fi
|
||||||
|
|
||||||
|
edit_directory="$HOME/.cache/edit/"
|
||||||
|
|
||||||
|
mkdir -p $edit_directory
|
||||||
|
|
||||||
|
filename=$(readlink -fn "$1" | md5sum | awk '{ print $1 }')
|
||||||
|
filepath="$edit_directory/$filename"
|
||||||
|
user=$(id -un)
|
||||||
|
group=$(id -gn)
|
||||||
|
|
||||||
|
echo "Editing $1 in $filepath as $user:$group"
|
||||||
|
|
||||||
|
$priv_cmd cp "$1" "$filepath"
|
||||||
|
$priv_cmd chown $user:$group "$filepath"
|
||||||
|
|
||||||
|
$EDITOR "$filepath"
|
||||||
|
|
||||||
|
$priv_cmd mv "$filepath" "$1"
|
Loading…
Reference in a new issue