Edit improvements
This commit is contained in:
parent
358d0d79fd
commit
315ab343bc
2 changed files with 29 additions and 9 deletions
27
zsh/funcs/editor
Normal file
27
zsh/funcs/editor
Normal file
|
@ -0,0 +1,27 @@
|
|||
function edit() {
|
||||
local editor
|
||||
printf -v editor "emacsclient -a=\"\" \"\$@\""
|
||||
echo $editor
|
||||
eval "${editor}"
|
||||
}
|
||||
|
||||
function editc() {
|
||||
local editor
|
||||
printf -v editor "emacsclient -c -a=\"\" \"\$@\""
|
||||
echo $editor
|
||||
eval "${editor}"
|
||||
}
|
||||
|
||||
function editn() {
|
||||
local editor
|
||||
printf -v editor "emacsclient -n -a=\"\" \"\$@\""
|
||||
echo $editor
|
||||
eval "${editor}"
|
||||
}
|
||||
|
||||
function editcn() {
|
||||
local editor
|
||||
printf -v editor "emacsclient -cn -a=\"\" \"\$@\""
|
||||
echo $editor
|
||||
eval "${editor}"
|
||||
}
|
11
zsh/zshrc
11
zsh/zshrc
|
@ -36,8 +36,8 @@ zle -N down-line-or-beginning-search
|
|||
|
||||
|
||||
export COMPLETION_WAITING_DOTS="true"
|
||||
export VISUAL='emacsclient -c'
|
||||
export EDITOR='emacsclient -c'
|
||||
export VISUAL='editc'
|
||||
export EDITOR='editn'
|
||||
path=("$HOME/bin" "$HOME/go/bin" $path)
|
||||
|
||||
zstyle ':znap:*' auto-compile no
|
||||
|
@ -135,13 +135,6 @@ function vim() {
|
|||
fi
|
||||
}
|
||||
|
||||
function edit() {
|
||||
local editor
|
||||
printf -v editor "${EDITOR} \"\$@\""
|
||||
echo $editor
|
||||
eval "${editor}"
|
||||
}
|
||||
|
||||
function root() {
|
||||
if [[ -n $(git rev-parse --show-toplevel) ]]
|
||||
then
|
||||
|
|
Loading…
Add table
Reference in a new issue