add lnvim alias for opening a file to a specific line with a somefile.ext:number

This commit is contained in:
JesseBot 2024-04-24 22:28:50 +02:00
parent 017b058beb
commit 994c396e4f

View file

@ -21,6 +21,15 @@ alias nivm=$EDITOR
alias ivm=$EDITOR
alias vmi=$EDITOR
# open vi, vim, or nvim to a specific line
# example to open a file to line 255
# lnvim /home/friend/somefile.py:255
lnvim() {
file=$(echo $1 |cut -f 1 -d ":")
line=$(echo $1 | cut -f 2 -d ":")
$EDITOR +$line $file
}
# this is useful because I split a lot of files
alias vsplit="$EDITOR -O"