mirror of
https://github.com/jessebot/dot_files.git
synced 2025-10-01 01:48:43 +00:00
add lnvim alias for opening a file to a specific line with a somefile.ext:number
This commit is contained in:
parent
017b058beb
commit
994c396e4f
1 changed files with 9 additions and 0 deletions
|
@ -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"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue