]> code.delx.au - dotfiles/commitdiff
emacs: switch from vim, simplify vim config a little
authorJames Bunton <jamesbunton@delx.net.au>
Fri, 24 Jun 2016 17:25:56 +0000 (03:25 +1000)
committerJames Bunton <jamesbunton@delx.net.au>
Fri, 24 Jun 2016 17:59:19 +0000 (03:59 +1000)
18 files changed:
.bash/environment
.gitignore
.inputrc
.vim/abbrs/YDATE [deleted file]
.vim/abbrs/ccopy.c [deleted file]
.vim/abbrs/cmain.c [deleted file]
.vim/abbrs/cmaina.c [deleted file]
.vim/abbrs/cppmain.cpp [deleted file]
.vim/abbrs/cppmaina.cpp [deleted file]
.vim/abbrs/jmain.java [deleted file]
.vim/abbrs/latexreport.tex [deleted file]
.vim/abbrs/pycopy.py [deleted file]
.vim/abbrs/pymain.py [deleted file]
.vim/abbrs/pymaina.py [deleted file]
.vim/abbrs/xhtmltemplate.xhtml [deleted file]
.vim/abbrs2vim.py [deleted file]
.vim/macros.vim
.vimrc

index 647f6a6a4c0377b64848c5a4c68ce8b724acc3f4..0146c1309171c65dbfd5cf15a73e0651905159ae 100644 (file)
@@ -13,12 +13,19 @@ fi
 
 # General environment settings
 export PAGER="less"
-export EDITOR="vim"
 export CVS_RSH="ssh"
 export RSYNC_RSH="ssh"
 export PYTHONSTARTUP="${HOME}/.pythonrc.py"
 export EMAIL="James Bunton <jamesbunton@delx.net.au>"
 
+# Editor settings
+if emacsclient --version &> /dev/null; then
+    export ALTERNATE_EDITOR="vim"
+    export EDITOR="emacsclient --create-frame"
+else
+    export EDITOR="vim"
+fi
+
 # Expand any symbolic links in the TMPDIR environment variable
 [ -n "$TMPDIR" ] && export TMPDIR="$(cd "${TMPDIR}" && pwd -P)"
 
index 5c5585257948f0bb774b03fc5085c22d58dfdb40..e4c42ea7c55b345a33cd4366f7632d152d293fe9 100644 (file)
@@ -1,7 +1,9 @@
 .bash/environment_local
 .bash/functions_local
 .bash/interactive_local
-.vim/abbrsout.vim
+.emacs.d/auto-save-list
+.emacs.d/elpa
+.emacs.d/save-place-file
 .vim/.netrwhist
 .vim/viminfo
 .*.swp
index 9b2d22e4778c7403b565a2d3a135d7d87aa02ac6..8916e9e2c86b81797f51c78fdb9ee2e5f7d4ed2f 100644 (file)
--- a/.inputrc
+++ b/.inputrc
@@ -3,29 +3,3 @@ set completion-ignore-case on
 set completion-map-case on
 set show-all-if-ambiguous on
 set colored-stats on
-
-set editing-mode vi
-
-set keymap vi-insert
-"\C-l": clear-screen
-"\e[2~": quoted-insert
-"\e[3~": vi-delete
-"\e[1~": beginning-of-line
-"\e[4~": end-of-line
-"\e[5~": beginning-of-history
-"\e[6~": end-of-history
-
-set keymap vi-command
-"\C-l": clear-screen
-"\e[2~": quoted-insert
-"\e[3~": vi-delete
-"\e[1~": beginning-of-line
-"\e[4~": end-of-line
-"\e[5~": beginning-of-history
-"\e[6~": end-of-history
-"\7f":  backward-char
-"gg": beginning-of-history
-"G": end-of-history
-"{": complete-into-braces
-"*": insert-completions
-
diff --git a/.vim/abbrs/YDATE b/.vim/abbrs/YDATE
deleted file mode 100644 (file)
index cd9d886..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<C-R>=strftime("%Y-%m-%d")<CR>
diff --git a/.vim/abbrs/ccopy.c b/.vim/abbrs/ccopy.c
deleted file mode 100644 (file)
index 27f2e9a..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-/* Copyright YEAR EMAIL
- * Licensed for distribution under the GPL version 2.
- *
- * ___Program purpose...
- */
-
diff --git a/.vim/abbrs/cmain.c b/.vim/abbrs/cmain.c
deleted file mode 100644 (file)
index 5a317f5..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <inttypes.h>
-#include <stdbool.h>
-
-
-int
-main(void)
-{
-    ___
-    return 0;
-}
-
diff --git a/.vim/abbrs/cmaina.c b/.vim/abbrs/cmaina.c
deleted file mode 100644 (file)
index 9cc5d31..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <inttypes.h>
-#include <stdbool.h>
-
-
-int
-main(int argc, char** argv)
-{
-    ___
-    return 0;
-}
-
diff --git a/.vim/abbrs/cppmain.cpp b/.vim/abbrs/cppmain.cpp
deleted file mode 100644 (file)
index cedf7a4..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <iostream>
-#include <cmath>
-#include <string>
-#include <vector>
-#include <inttypes.h>
-
-
-int
-main(void)
-{
-    ___
-    return 0;
-}
-
diff --git a/.vim/abbrs/cppmaina.cpp b/.vim/abbrs/cppmaina.cpp
deleted file mode 100644 (file)
index a8f468c..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <iostream>
-#include <cmath>
-#include <string>
-#include <vector>
-#include <inttypes.h>
-
-
-int
-main(int argc, char** argv)
-{
-    ___
-    return 0;
-}
-
diff --git a/.vim/abbrs/jmain.java b/.vim/abbrs/jmain.java
deleted file mode 100644 (file)
index de791b3..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-public class ___ClassName {
-    public static void main(String[] args) {
-        // code
-    }
-}
-
diff --git a/.vim/abbrs/latexreport.tex b/.vim/abbrs/latexreport.tex
deleted file mode 100644 (file)
index ff02003..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-\documentclass[a4paper,12pt]{report}
-
-% This file must be saved in the UTF8 encoding
-\usepackage[utf8]{inputenc}
-
-% These packages need to be included to insert pictures into your report
-\usepackage[pdftex]{graphicx}
-
-% Better maths suport
-\usepackage{amssymb,amsmath}
-
-% Support links in the pdf file
-\usepackage[pdfborder={0,0,0}]{hyperref}
-
-% Allow \url{}
-\usepackage{url}
-
-% Allow fancier citations, \citet \citep \citeauthor, etc
-% See details here: http://merkel.zoneo.net/Latex/natbib.php
-\usepackage[square,comma,sort,authoryear]{natbib}
-
-% Put a medium sized gap between paragraphs
-\setlength{\parskip}{\medskipamount}
-
-% Don't indent the start of new paragraphs
-\setlength{\parindent}{0pt}
-
-% Changes section numbering somehow...
-\renewcommand{\thesection}{\arabic{section}}
-
-% Bibliography style. Aside from plain, there is also apalike.
-% Look for *.bst files
-\bibliographystyle{plainnat}
-
-
-\title{___The Title goes here}
-\author{
-    ___First Author\\
-    (email: \tt{___user@example.com}) \\
-}
-
-\begin{document}
-\maketitle
-
-\begin{abstract}
-___Abstract goes here
-\end{abstract}
-
-\tableofcontents
-\newpage
-\listoffigures
-\newpage
-
-\section{___First Section}
-
-
-
-\bibliography{___something}
-
-\end{document}
-
diff --git a/.vim/abbrs/pycopy.py b/.vim/abbrs/pycopy.py
deleted file mode 100644 (file)
index f13374f..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/usr/bin/env python
-# Copyright YEAR EMAIL
-# Licensed for distribution under the GPL version 2, check COPYING for details
-# ___Program purpose
diff --git a/.vim/abbrs/pymain.py b/.vim/abbrs/pymain.py
deleted file mode 100644 (file)
index 54e8ecc..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-import math
-import os
-import sys
-
-def main():
-    ___ pass
-
-if __name__ == "__main__":
-    main()
-
-
diff --git a/.vim/abbrs/pymaina.py b/.vim/abbrs/pymaina.py
deleted file mode 100644 (file)
index f5cddef..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-import math
-import os
-import sys
-
-def main(___arg):
-    ___ pass
-
-if __name__ == "__main__":
-    try:
-        ___arg = sys.argv[1]
-    except:
-        print >>sys.stderr, "Usage: %s ___arg" % sys.argv[0]
-        sys.exit(1)
-
-    main(___arg)
-
-
diff --git a/.vim/abbrs/xhtmltemplate.xhtml b/.vim/abbrs/xhtmltemplate.xhtml
deleted file mode 100644 (file)
index e37169f..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
-  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-<head>
-    <title>___</title>
-    <link rel="stylesheet" type="text/css" href="___" />
-    <script type="text/javascript" src="___"/>
-</head>
-
-<body>
-___
-</body>
-
-</html>
-
diff --git a/.vim/abbrs2vim.py b/.vim/abbrs2vim.py
deleted file mode 100644 (file)
index a2a37f5..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/env python
-
-import time, os, os.path, sys
-
-# To override the defaults, set these variables
-EMAIL = ""
-
-macros = {}
-macros["YDATE"] = lambda: time.strftime("%Y-%m-%d")
-macros["YEAR"]  = lambda: time.strftime("%Y")
-macros["EMAIL"] = lambda: EMAIL or os.environ.get("EMAIL", "~/.vim/abbrs2vim.py")
-
-
-vimdir = os.path.join(os.environ.get("HOME"), ".vim")
-try:
-    outfilename = os.path.join(vimdir, "abbrsout.vim")
-    outfile = open(outfilename, "w")
-except IOError:
-    print >> sys.stderr, "Couldn't open output file for writing: %s" % outfilename
-    sys.exit(1)
-
-abbrsdir = os.path.join(vimdir, "abbrs")
-if not os.path.isdir(abbrsdir):
-    print >> sys.stderr, "Could not find directory with abbreviations: %s" % abbrsdir
-    sys.exit(1)
-
-for abbrfile in os.listdir(abbrsdir):
-    abbr = open(os.path.join(abbrsdir, abbrfile), "r").read()
-    for macro in macros.keys():
-        if abbr.find(macro) >= 0:
-            abbr = abbr.replace(macro, macros[macro]())
-    abbr = abbr.replace("\n", "\r")
-    # Put into paste mode and take out of paste mode
-    abbr = "iab %s \x1b:set paste\ri%s\x1b:set nopaste\r" % (abbrfile.rsplit('.', 1)[0], abbr)
-    if abbr.find("___") >= 0:
-        # Then search for ___ to place the cursor there
-        abbr += "gg\r/___\x1b:nohlsearch\n"
-    else:
-        # Leave the cursor in insert mode
-        abbr += "a\n"
-    outfile.write(abbr)
-
-
index b1c6878a2f199ccfdd8857d8d501fca59078eca7..cb8ef4b2b5e4eccf2ed4b92c2613e240e9f79aec 100644 (file)
@@ -8,9 +8,6 @@ imap <F10> <C-o>:call WrapToggle()<CR>
 map <F11> :call PasteToggle()<CR>
 imap <F11> <C-o>:call PasteToggle()<CR>
 
-" Python Calculator
-command -nargs=+ Calc :r! python -c "from math import *; print <args>"
-
 " Unhighlight search results and redraw the screen
 nmap <C-l> :nohlsearch<CR>:redraw!<CR>
 
diff --git a/.vimrc b/.vimrc
index 313a8bb074057f0bdca18bb5f228594b6aeb4627..21abecbc662d8314b256f431eac8a0bbb49d01c8 100644 (file)
--- a/.vimrc
+++ b/.vimrc
@@ -11,10 +11,6 @@ source ~/.vim/indent.vim
 source ~/.vim/macros.vim
 source ~/.vim/commenter.vim
 source ~/.vim/filetypes.vim
-if !filereadable(expand("~/.vim/abbrsout.vim"))
-    !python ~/.vim/abbrs2vim.py
-endif
-source ~/.vim/abbrsout.vim
 if filereadable(expand("~/.vim/local.vim"))
     source ~/.vim/local.vim
 endif