From b030deb9bc34f52abead32da970af75ebdce8f78 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Thu, 24 Jan 2019 17:04:00 +0100 Subject: Use emacsclient as the default editor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I've created a special emacsclient-a-nw executable script which should suffice for places like the gitconfig or bashrc. The good thing about having emacsclient as the default editor, is that then you gain Magit, for example, when writing `git commit`. Signed-off-by: Miquel Sabaté Solà --- bashrc | 4 ++-- bin/emacsclient-a-nw | 18 ++++++++++++++++++ gitconfig | 2 +- install.sh | 1 + 4 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 bin/emacsclient-a-nw diff --git a/bashrc b/bashrc index 2d212d6..1bdad72 100644 --- a/bashrc +++ b/bashrc @@ -30,8 +30,8 @@ source_maybe() { # Editors & terminals. # Set vim as the default editor. -export EDITOR=vim -export VISUAL=vim +export EDITOR=emacsclient-a-nw +export VISUAL=emacsclient-a-nw alias vi=vim # Shortcut for GNU Emacs. diff --git a/bin/emacsclient-a-nw b/bin/emacsclient-a-nw new file mode 100644 index 0000000..e0f2292 --- /dev/null +++ b/bin/emacsclient-a-nw @@ -0,0 +1,18 @@ +#!/bin/bash +# Copyright (C) 2019 Miquel Sabaté Solà +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +emacsclient -a "" -nw "$@" -c diff --git a/gitconfig b/gitconfig index cd61d20..40dda5e 100644 --- a/gitconfig +++ b/gitconfig @@ -4,7 +4,7 @@ signingkey = 0x96BE8C6FD89D6565 [core] - editor = vim + editor = emacsclient-a-nw excludesfile = ~/.gitignore whitespace = trailing-space,space-before-tab abbrev = 12 diff --git a/install.sh b/install.sh index 637760d..032612b 100755 --- a/install.sh +++ b/install.sh @@ -34,6 +34,7 @@ chmod +x $HOME/.rake_completion # Some random scripts cp -r bin $HOME/bin rm -rf $HOME/bin/test +chmod +x $HOME/bin/* # i3 and X stuff. An incomplete list of openSUSE packages that I need in order # to have a good i3 environment is: i3 xlockmore dunst i3status nitrogen scrot -- cgit v1.2.3