Browse Source

Updates ?

master
squeaky otter 4 years ago
parent
commit
b3dfc78f78
Signed by: dashie GPG Key ID: C2D57B325840B755
  1. 0
      .gitignore
  2. 0
      README.md
  3. 0
      cfg/.gitkeep
  4. 27
      cfg/cfg-dev.el
  5. 14
      cfg/cfg-lang-hooks.el
  6. 2
      cfg/cfg-org.el
  7. 3
      cfg/cfg-utilities.el
  8. 80
      cfg/ome-cc.el
  9. 70
      cfg/ome-completion.el
  10. 0
      cfg/ome-experimental.el
  11. 2
      cfg/ome-gui.el
  12. 0
      cfg/ome-misc.el
  13. 133
      init.el
  14. 0
      snap.png
  15. 0
      vendor/.gitkeep

0
.gitignore

0
README.md

0
cfg/.gitkeep

27
cfg/cfg-dev.el

@ -1,4 +1,31 @@
;; cfg-dev
(electric-pair-mode 1)
;; make electric-pair-mode work on more brackets
(setq electric-pair-pairs '(
(?\" . ?\")
(?\{ . ?\})
) )
;;;;;; Python ;;;;;;
;; https://github.com/jorgenschaefer/elpy
(elpy-enable)
(setq python-shell-interpreter "ipython3"
python-shell-interpreter-args "-i --simple-prompt")
;; (setq elpy-rpc-backend "jedi")
(require 'web-mode)
(add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode))
(setq web-mode-engines-alist '(("django" . "\\.html\\'")))
(setq web-mode-markup-indent-offset 2)
(setq web-mode-code-indent-offset 2)
(setq web-mode-css-indent-offset 2)
(setq web-mode-enable-auto-pairing t)
(setq web-mode-enable-auto-expanding t)
(setq web-mode-enable-css-colorization t)
(provide 'cfg-dev)

14
cfg/cfg-lang-hooks.el

@ -11,9 +11,9 @@
(add-to-list 'auto-mode-alist '("\\.erb$" . web-mode))
;; ruby
(add-hook 'ruby-mode-hook
(lambda ()
(autopair-mode)))
;(add-hook 'ruby-mode-hook
; (lambda ()
; (autopair-mode)))
(add-to-list 'auto-mode-alist '("\\.rake$" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.gemspec$" . ruby-mode))
@ -78,12 +78,4 @@
(add-to-list 'auto-mode-alist '("\\.cpsa$" . cpsa-mode))
;; go mode
(require 'go-autocomplete)
(add-hook 'go-mode-hook
(lambda ()
(go-eldoc-setup)
(add-hook 'before-save-hook 'gofmt-before-save)))
(provide 'cfg-lang-hooks)

2
cfg/cfg-org.el

@ -16,7 +16,7 @@
(setq org-agenda-show-log t
org-agenda-todo-ignore-scheduled t
org-agenda-todo-ignore-deadlines t)
;(setq org-agenda-files (list "~/Dropbox/org/personal.org"))
(setq org-agenda-files (list "~/Seafile/Documents/org-mode-agenda.org"))
;; org-habit
(require 'org)

3
cfg/cfg-utilities.el

@ -30,9 +30,6 @@
(setq backup-directory-alist `((".*" . ,temporary-file-directory)))
(setq auto-save-file-name-transforms `((".*" ,temporary-file-directory t)))
;; autopair
(require 'autopair)
;; power lisp
(setq lisp-modes '(lisp-mode
emacs-lisp-mode

80
cfg/ome-cc.el

@ -1,83 +1,5 @@
;; ome-cc -- https://github.com/xiaohanyu/oh-my-emacs/blob/master/modules/ome-cc.org
;; Basic CC-Mode settings
(setq c-default-style '((java-mode . "java")
(awk-mode . "awk")
(c-mode . "k&r")
(c++-mode . "stroustrup")
(other . "linux")))
(setq-default c-basic-offset 4)
(add-to-list 'auto-mode-alist '("\\.h$" . c++-mode))
(defun ome-c-initialization-hook ()
(define-key c-mode-base-map (kbd "RET") 'c-context-line-break))
(add-hook 'c-initialization-hook 'ome-c-initialization-hook)
(defun ome-c-mode-common-hook ()
(add-to-list 'c-cleanup-list 'defun-close-semi)
;; (c-toggle-auto-newline)
(c-toggle-hungry-state))
;; this will affect all modes derived from cc-mode, like
;; java-mode, php-mode, etc
(add-hook 'c-mode-common-hook 'ome-c-mode-common-hook)
;; Makefile settings
(add-hook 'makefile-mode-hook
(lambda ()
(setq indent-tabs-mode t)))
;; CMake
;; cmake-mode
;; (x)cscope
;; xcscope
;; Auto-complete-clang
(defun ome-pkg-config-enable-clang-flag (pkg-config-lib)
"This function will add necessary header file path of a
specified by `pkg-config-lib' to `ac-clang-flags', which make it
completionable by auto-complete-clang"
(interactive "spkg-config lib: ")
(if (executable-find "pkg-config")
(if (= (shell-command
(format "pkg-config %s" pkg-config-lib))
0)
(setq ac-clang-flags
(append ac-clang-flags
(split-string
(shell-command-to-string
(format "pkg-config --cflags-only-I %s"
pkg-config-lib)))))
(message "Error, pkg-config lib %s not found." pkg-config-lib))
(message "Error: pkg-config tool not found.")))
(require 'auto-complete-clang)
(setq command "echo | g++ -v -x c++ -E - 2>&1 |
grep -A 20 starts | grep include | grep -v search")
(setq ac-clang-flags
(mapcar (lambda (item)
(concat "-I" item))
(split-string
(shell-command-to-string command))))
;; completion for C/C++ macros.
(push "-code-completion-macros" ac-clang-flags)
(push "-code-completion-patterns" ac-clang-flags)
(dolist (mode-hook '(c-mode-hook c++-mode-hook))
(add-hook mode-hook
(lambda ()
(add-to-list 'ac-sources 'ac-source-clang))))
(ome-pkg-config-enable-clang-flag "QtGui")
(ome-pkg-config-enable-clang-flag "QtCore")
(ome-pkg-config-enable-clang-flag "QtSql")
(ome-pkg-config-enable-clang-flag "QtNetwork")
(ome-pkg-config-enable-clang-flag "QtXml")
;; auto-complete-clang
;; TODO
(provide 'ome-cc)

70
cfg/ome-completion.el

@ -1,4 +1,4 @@
;; ome-completion -- https://github.com/xiaohanyu/oh-my-emacs/blob/master/core/ome-completion.org
;; ome-completion --
;; hippie expand is dabbrev expand on steroids
(setq hippie-expand-try-functions-list '(try-expand-dabbrev
@ -12,71 +12,6 @@
try-complete-lisp-symbol-partially
try-complete-lisp-symbol))
(require 'auto-complete-config)
(define-key ac-mode-map (kbd "M-/") 'ac-fuzzy-complete)
(dolist (ac-mode '(text-mode org-mode))
(add-to-list 'ac-modes ac-mode))
(dolist (ac-mode-hook '(text-mode-hook org-mode-hook prog-mode-hook))
(add-hook ac-mode-hook
(lambda ()
(setq ac-fuzzy-enable t)
(add-to-list 'ac-sources 'ac-source-files-in-current-dir)
(add-to-list 'ac-sources 'ac-source-filename))))
(ac-config-default)
(defun ac-pcomplete ()
;; eshell uses `insert-and-inherit' to insert a \t if no completion
;; can be found, but this must not happen as auto-complete source
(flet ((insert-and-inherit (&rest args)))
;; this code is stolen from `pcomplete' in pcomplete.el
(let* (tramp-mode ;; do not automatically complete remote stuff
(pcomplete-stub)
(pcomplete-show-list t) ;; inhibit patterns like * being deleted
pcomplete-seen pcomplete-norm-func
pcomplete-args pcomplete-last pcomplete-index
(pcomplete-autolist pcomplete-autolist)
(pcomplete-suffix-list pcomplete-suffix-list)
(candidates (pcomplete-completions))
(beg (pcomplete-begin))
;; note, buffer text and completion argument may be
;; different because the buffer text may bet transformed
;; before being completed (e.g. variables like $HOME may be
;; expanded)
(buftext (buffer-substring beg (point)))
(arg (nth pcomplete-index pcomplete-args)))
;; we auto-complete only if the stub is non-empty and matches
;; the end of the buffer text
(when (and (not (zerop (length pcomplete-stub)))
(or (string= pcomplete-stub ; Emacs 23
(substring buftext
(max 0
(- (length buftext)
(length pcomplete-stub)))))
(string= pcomplete-stub ; Emacs 24
(substring arg
(max 0
(- (length arg)
(length pcomplete-stub)))))))
;; Collect all possible completions for the stub. Note that
;; `candidates` may be a function, that's why we use
;; `all-completions`.
(let* ((cnds (all-completions pcomplete-stub candidates))
(bnds (completion-boundaries pcomplete-stub
candidates
nil
""))
(skip (- (length pcomplete-stub) (car bnds))))
;; We replace the stub at the beginning of each candidate by
;; the real buffer content.
(mapcar #'(lambda (cand) (concat buftext (substring cand skip)))
cnds))))))
(defvar ac-source-pcomplete
'((candidates . ac-pcomplete)))
;; helm
(require 'helm-config)
(setq helm-input-idle-delay 0.2)
@ -88,6 +23,9 @@
('windows-nt "es %s")
('darwin "mdfind -name %s %s")
(t "locate %s")))
(loop for ext in '("\\.swf$" "\\.elc$" "\\.pyc$")
do (add-to-list 'helm-boring-file-regexp-list ext))
(global-set-key (kbd "M-t") 'helm-for-files)
(global-set-key (kbd "C-x c g") 'helm-do-grep)
(global-set-key (kbd "C-x c o") 'helm-occur)

0
cfg/ome-experimental.el

2
cfg/ome-gui.el

@ -19,6 +19,6 @@
;; linum-relative
(require 'linum-relative)
(powerline-default-theme)
;(powerline-default-theme)
(provide 'ome-gui)

0
cfg/ome-misc.el

133
init.el

@ -23,15 +23,15 @@
(when (file-directory-p project)
(add-to-list 'load-path project)))
; Some work-around for emacs >=24.3.x
;(setq max-lisp-eval-depth 10000)
;(setq debug-on-error 't)
; Some work-around for emacs >=24.3.x
;(setq max-lisp-eval-depth 10000)
;(setq debug-on-error 't)
; Specific parameters for Windows
; Specific parameters for Windows
(if (eq system-type 'windows-nt)
(progn
; Internal search path
; Internal search path
(let (
(mypaths
'(
@ -48,11 +48,11 @@
(setq exec-path (append mypaths (list "." exec-directory)) )
)
; Set CTAGS binary path
; Set CTAGS binary path
(setq semantic-ectag-program "C:/Users/Dashie/.babun/cygwin/bin/ctags")
; Set default directory (like "$HOME")
; Set default directory (like "$HOME")
(setq default-directory "C:/Users/Dashie/")
;(add-to-list 'exec-path "")
;(add-to-list 'exec-path "")
(message "--- Using windows-nt variables")
)
@ -60,7 +60,7 @@
(if (eq system-type 'gnu/linux)
(progn
; Set CTAGS binary path
; Set CTAGS binary path
(setq semantic-ectag-program "/usr/bin/ctags")
(message "--- Using gnu/linux variables")
@ -69,16 +69,10 @@
(if (eq system-type 'darwin)
(progn
; Set CTAGS binary path
; Set CTAGS binary path
(setq semantic-ectag-program "/usr/bin/ctags")
(setq semantic-ectags-program "/usr/bin/ctags")
(setenv "PATH" (concat "/usr/local/bin:/opt/local/bin:/usr/bin:/bin" (getenv "PATH")))
;(setenv "GOPATH" (concat (getenv "HOME") "/src/golang"))
;(add-to-list 'exec-path (concat (getenv "GOPATH") "/bin"))
(setq exec-path (append exec-path '("/usr/local/bin")))
(message "--- Using darwin variables")
)
)
@ -86,7 +80,9 @@
(setq autoload-file (concat user-emacs-directory "loaddefs.el"))
(setq custom-file (concat user-emacs-directory "custom.el"))
; Initialize packaging
(load custom-file 'noerror)
; Initialize packaging
(load "package")
(package-initialize)
(add-to-list 'package-archives
@ -95,12 +91,17 @@
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(add-to-list 'package-archives
'("org" . "http://orgmode.org/elpa/") t)
(add-to-list 'package-archives
'("elpy" . "https://jorgenschaefer.github.io/packages/") t)
(when (< emacs-major-version 24)
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(setq package-archive-enable-alist '(("melpa" deft magit)))
;; Fix pathes for osx
(when (memq window-system '(mac ns))
(exec-path-from-shell-initialize))
(setq package-archive-enable-alist '(("melpa" deft magit)))
;; Fancy gdb ? yeaa
(setq
@ -118,90 +119,78 @@
(require 'ansi-color)
(require 'recentf)
; Seems to be a bug somewhere...
; Seems to be a bug somewhere...
(setq inhibit-x-resources t)
; By defaults shits come from `xrdb -query | grep Emacs`
; and then override custom theme ...
; By defaults shits come from `xrdb -query | grep Emacs`
; and then override custom theme ...
;(add-to-list 'default-frame-alist '(background-color . "#3F3F3F"))
; Light theme
;(load-theme 'professional t)
; Not so dark
;(load-theme 'ample-zen t)
;(add-to-list 'default-frame-alist '(background-color . "#3F3F3F"))
; Light theme
;(load-theme 'professional t)
; Not so dark
;(load-theme 'ample-zen t)
(add-hook 'emacs-startup-hook
(lambda ()
(when (string= (buffer-name) "*scratch*")
(animate-string ";; OM NOM NOM NOM NOM NOM MEMORY" (/ (frame-height) 2)))))
; W3M
; W3M
;; Set default browser
(setq browse-url-browser-function 'browse-url-generic)
;(set-face-background 'hl-line "linen")(set-face-background 'hl-line "linen")(setq browse-url-generic-program "firefox")
;(set-face-background 'hl-line "linen")(set-face-background 'hl-line "linen")(setq browse-url-generic-program "firefox")
(autoload 'w3m-browse-url "w3m" "Ask a WWW browser to show a URL." t)
(setq w3m-use-cookies t)
; Battery mode
; Battery mode
(display-battery-mode 1)
; GPG
(require 'epa-file)
(epa-file-enable)
; GPG
; Enabled by default
; (require 'epa-file)
;(epa-file-enable)
; packages
; packages
(defvar abedra/packages '(ac-slime
auto-complete
autopair
clojure-mode
coffee-mode
csharp-mode
deft
erlang
feature-mode
flycheck
gist
go-autocomplete
go-eldoc
go-mode
graphviz-dot-mode
haml-mode
haskell-mode
htmlize
idris-mode
magit
markdown-mode
marmalade
nodejs-repl
o-blog
org
paredit
php-mode
puppet-mode
restclient
rvm
scala-mode
smex
sml-mode
solarized-theme
alect-themes
web-mode
writegood-mode
yaml-mode
pastelmac-theme
w3m
twittering-mode
cmake-mode
xcscope
auto-complete-clang
helm
pos-tip
yasnippet
helm-descbinds
sr-speedbar
yascroll
lacarte
rainbow-delimiters
projectile
smartparens)
w3m
twittering-mode
cmake-mode
pos-tip
yasnippet
sr-speedbar
yascroll
lacarte
rainbow-delimiters
projectile
jedi
smartparens
company-quickhelp
company-jedi
elpy
exec-path-from-shell
helm
helm-descbinds)
"Default packages")
(defun abedra/packages-installed-p ()
@ -218,10 +207,9 @@
;; Color scheme
;; https://emacsthemes.com/themes/pastelmac-theme.html
;(require 'pastelmac-theme)
(if window-system
(require 'pastelmac-theme)
(load-theme 'wombat t))
;(require 'pastelmac-theme)
;(load-theme 'wombat t))
(load-theme 'alect-dark)
(require 'ansi-color)
(defun colorize-compilation-buffer ()
@ -233,8 +221,6 @@
;; Set multi-term shell
(setq multi-term-program "/bin/zsh")
(load custom-file 'noerror)
;; We don't want a FQDN for system-name, just the hostname portion
(setq system-name (car (split-string system-name "[.]")))
@ -288,6 +274,9 @@
(require 'tramp)
(setq tramp-default-method "ssh")
(add-to-list 'tramp-default-proxies-alist '(nil "\\`root\\'" "/ssh:%h:"))
(add-to-list 'tramp-default-proxies-alist '((regexp-quote (system-name)) nil nil))
;; Read and write compressed files transparently.
(auto-compression-mode 1)
@ -327,7 +316,7 @@
;; Hilight current mode
(global-hl-line-mode 1)
(set-face-background 'hl-line "light grey")
(set-face-background 'hl-line "dim grey")
;; Twittering mode
(setq twittering-icon-mode t) ; Show icons

0
snap.png

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

0
vendor/.gitkeep

Loading…
Cancel
Save