Several changes for clemacs, added auto-complete, dunno how hooking rainbowmode to conf mode works

clean_emacs
TuDatTr 2018-01-19 06:50:57 +01:00
parent 6b96a115a4
commit 7165004c23
No known key found for this signature in database
GPG Key ID: 6B2AC5D2CAECE06A
8 changed files with 85 additions and 24 deletions

View File

@ -8,10 +8,11 @@ I'm using:
* [Oh My Zsh](http://ohmyz.sh) * [Oh My Zsh](http://ohmyz.sh)
* [GNU stow](https://www.gnu.org/software/stow) * [GNU stow](https://www.gnu.org/software/stow)
* [Materia Theme](https://github.com/nana-4/materia-theme) * [Materia Theme](https://github.com/nana-4/materia-theme)
## TODOS: ## ## TODOS: ##
1. Update this README for the migration to GNU stow and clemacs 1. Update this README for the migration to GNU stow and clemacs
2. Making an own conky, conky_maia-like 2. Making an own conky, conky_maia-like
..* [conky](https://github.com/brndnmtthws/conky/wiki/Configuraion-Settings) * [conky](https://github.com/brndnmtthws/conky/wiki/Configuraion-Settings)
3. Sorting the "Prerequisites" by importance 3. Sorting the "Prerequisites" by importance
4. Improve the README.md or maybe make a wiki. 4. Improve the README.md or maybe make a wiki.
5. Getting away from Manjaro i3 (?) 5. Getting away from Manjaro i3 (?)
@ -55,6 +56,7 @@ Yaourt Install
* [i3lock-color](https://github.com/PandorasFox/i3lock-color) - Needed for ~/.scripts/i3lock.py * [i3lock-color](https://github.com/PandorasFox/i3lock-color) - Needed for ~/.scripts/i3lock.py
* [cava](https://github.com/karlstav/cava) - **C**onsole-based **A**udio **V**isualizer for **A**LSA (MPD and Pulseaudio) * [cava](https://github.com/karlstav/cava) - **C**onsole-based **A**udio **V**isualizer for **A**LSA (MPD and Pulseaudio)
* [materia-theme](https://github.com/nana-4/materia-theme) * [materia-theme](https://github.com/nana-4/materia-theme)
``` shell ``` shell
sudo pacman -Syu sudo pacman -Syu
sudo pacman -S emacs git termite python-pip zsh-theme-powerlevel9k powerline-fonts awesome-terminal-fonts texlive-most firefox thunderbird evince veracrypt keepassx2 xorg-xbacklight pulseaudio-alsa pulseaudio-bluetooth nyancat cmus lxappearance sudo pacman -S emacs git termite python-pip zsh-theme-powerlevel9k powerline-fonts awesome-terminal-fonts texlive-most firefox thunderbird evince veracrypt keepassx2 xorg-xbacklight pulseaudio-alsa pulseaudio-bluetooth nyancat cmus lxappearance
@ -73,10 +75,6 @@ rm -rf ~/.*bash* # remove bash-stuff from your home directory.. don't do it if y
### Setting up Emacs ### ### Setting up Emacs ###
I tried to make this as easy as possible. All packages should be installed automatically. I'm not sure whether it works or not I tried to make this as easy as possible. All packages should be installed automatically. I'm not sure whether it works or not
``` shell
curl -L https://github.com/bbatsov/prelude/raw/master/utils/installer.sh | sh
```
### Setups ### ### Setups ###
Setting up some programs. Setting up some programs.
#### Installing Nextcloud-Client (optional) #### #### Installing Nextcloud-Client (optional) ####
@ -89,7 +87,9 @@ sudo ln -s ~/Downloads/Nextcloud-2.3.3-x86_64.AppImage /usr/bin/nextcloud
#### Finally *"installing"* the dotfiles. #### #### Finally *"installing"* the dotfiles. ####
``` shell ``` shell
git clone https://github.com/TuDatTr/dotfiles .dotfiles git clone https://github.com/TuDatTr/dotfiles .dotfiles
stow stow emacs
stow i3
stow zsh
rm -rf ~/.i3/ rm -rf ~/.i3/
sudo ln -s ~/.scripts/pipes.sh /usr/local/bin/pipes sudo ln -s ~/.scripts/pipes.sh /usr/local/bin/pipes
``` ```

View File

@ -0,0 +1,4 @@
((("defun" .
[0 0 0 1 0])
("wird" .
[2 0 0 0])))

View File

@ -33,6 +33,10 @@
'(lambda () '(lambda ()
(set-face-background 'default "unspecified-bg"))) (set-face-background 'default "unspecified-bg")))
(f-mkdir "~/.emacs-saves")
(setq auto-save-file-name-transforms
'((".*" "~/.emacs-saves/" t)))
(defun copy-to-xclipboard(arg) (defun copy-to-xclipboard(arg)
(interactive "P") (interactive "P")
(cond (cond
@ -91,10 +95,13 @@
(menu-bar-mode -1) (menu-bar-mode -1)
(ac-config-default)
(add-hook 'python-mode-hook 'anaconda-mode) (add-hook 'python-mode-hook 'anaconda-mode)
(add-hook 'python-mode-hook 'anaconda-eldoc-mode) (add-hook 'python-mode-hook 'anaconda-eldoc-mode)
(require 'tex) (require 'tex)
(require 'auto-complete-auctex)
(setq TeX-auto-save t) (setq TeX-auto-save t)
(setq TeX-parse-self t) (setq TeX-parse-self t)
(setq-default TeX-master nil) (setq-default TeX-master nil)
@ -113,10 +120,11 @@
(add-hook 'org-mode-hook 'rainbow-delimiters-mode) (add-hook 'org-mode-hook 'rainbow-delimiters-mode)
(counsel-mode 1) (counsel-mode 1)
(global-set-key "\C-s" 'swiper)
(require 'paren) (require 'paren)
(setq show-paren-style 'parenthesis) (setq show-paren-style 'parenthesis)
(show-paren-mode +1) (show-paren-mode 1)
(global-hl-line-mode 1) (global-hl-line-mode 1)
(set-face-background 'hl-line "#141b1e") (set-face-background 'hl-line "#141b1e")
@ -142,3 +150,5 @@
:lighter " my-keys") :lighter " my-keys")
(my-keys-minor-mode 1) (my-keys-minor-mode 1)
(add-hook 'conf-mode 'rainbow-mode)

View File

@ -11,6 +11,7 @@
#+SELECT_TAGS: export #+SELECT_TAGS: export
* Packages * Packages
A list of installed packages and details about them.
** Package Archives ** Package Archives
Adding the melpa package repository to Emacs. Adding the melpa package repository to Emacs.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -73,8 +74,18 @@ Changes the Emacs background to the terminals defaults. (Generally)
'(lambda () '(lambda ()
(set-face-background 'default "unspecified-bg"))) (set-face-background 'default "unspecified-bg")))
#+END_SRC #+END_SRC
* Emacs behavior
Save auto-save files in ~/.emacs-save
#+BEGIN_SRC emacs-lisp
(f-mkdir "~/.emacs-saves")
(setq auto-save-file-name-transforms
'((".*" "~/.emacs-saves/" t)))
#+END_SRC
* Functions * Functions
All the functions I use.
** Cut/Copy and Paste by Boruch Baum ** Cut/Copy and Paste by Boruch Baum
A nice way to copy and paste contents comfortably inside and out of emacs.
*** Copy *** Copy
Copy the marked area to the clipboard. Copy the marked area to the clipboard.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -144,7 +155,8 @@ Go back to indentation, if you are at the indentation, go to beginning of the li
#+END_SRC #+END_SRC
Sets the background of Emacs in terminal-mode to the terminals. Doesn't change it in window Sets the background of Emacs in terminal-mode to the terminals. Doesn't change it in window
mode tho. mode though.
Function is not currently used since I still have to figure out how to make it work with emacs in daemon mode
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defun transparent-terminal () (defun transparent-terminal ()
(unless (display-graphic-p (selected-frame)) (unless (display-graphic-p (selected-frame))
@ -155,7 +167,11 @@ mode tho.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(menu-bar-mode -1) (menu-bar-mode -1)
#+END_SRC #+END_SRC
** Autocomplete
#+BEGIN_SRC emacs-lisp
(ac-config-default)
#+END_SRC
** Python ** Python
Using Anaconda-mode as default python development mode Using Anaconda-mode as default python development mode
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -167,6 +183,7 @@ Some default settings for LaTeX-Mode.
AucTeX is needed. AucTeX is needed.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(require 'tex) (require 'tex)
(require 'auto-complete-auctex)
(setq TeX-auto-save t) (setq TeX-auto-save t)
(setq TeX-parse-self t) (setq TeX-parse-self t)
(setq-default TeX-master nil) (setq-default TeX-master nil)
@ -199,12 +216,13 @@ Add rainbow-delimiters in org-mode
** Ivy/Counsel/Swiper ** Ivy/Counsel/Swiper
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(counsel-mode 1) (counsel-mode 1)
(global-set-key "\C-s" 'swiper)
#+END_SRC #+END_SRC
** Parenthesis ** Parenthesis
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(require 'paren) (require 'paren)
(setq show-paren-style 'parenthesis) (setq show-paren-style 'parenthesis)
(show-paren-mode +1) (show-paren-mode 1)
#+END_SRC #+END_SRC
** Highlight line ** Highlight line
Globaly highlight the current line in a slightly darker shade of grey. Globaly highlight the current line in a slightly darker shade of grey.
@ -221,7 +239,7 @@ Globaly highlight the current line in a slightly darker shade of grey.
(yas-global-mode 1) (yas-global-mode 1)
#+END_SRC #+END_SRC
** Personal mode ** Personal
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defvar my-keys-minor-mode-map (defvar my-keys-minor-mode-map
(let ((map (make-sparse-keymap))) (let ((map (make-sparse-keymap)))
@ -239,3 +257,9 @@ Globaly highlight the current line in a slightly darker shade of grey.
(my-keys-minor-mode 1) (my-keys-minor-mode 1)
#+END_SRC #+END_SRC
** Conf
#+BEGIN_SRC emacs-lisp
(add-hook 'conf-mode 'rainbow-mode)
#+END_SRC

View File

@ -7,7 +7,7 @@
;; If there is more than one, they won't work right. ;; If there is more than one, they won't work right.
'(package-selected-packages '(package-selected-packages
(quote (quote
(counsel swiper material-theme anaconda-mode rainbow-mode ox-twbs google-this auctex smartparens eclim flycheck rainbow-delimiters forest-blue-theme)))) (auto-complete-auctex auto-complete counsel swiper material-theme anaconda-mode rainbow-mode ox-twbs google-this auctex smartparens eclim flycheck rainbow-delimiters forest-blue-theme))))
(custom-set-faces (custom-set-faces
;; custom-set-faces was added by Custom. ;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.

20
emacs/.emacs.d/tramp Normal file
View File

@ -0,0 +1,20 @@
;; -*- emacs-lisp -*- <18/01/15 17:18:27 /home/tuan/.emacs.d/tramp>
;; Tramp connection history. Don't change this file.
;; You can delete it, forcing Tramp to reapply the checks.
((["ssh" "infra" "mx" nil nil]
("uname" "Linux 4.4.0-109-generic")
("locale" "LC_ALL=en_US.utf8")
("test" "test")
("remote-path"
("/bin" "/usr/bin" "/sbin" "/usr/sbin" "/usr/local/bin" "/usr/local/sbin"))
("remote-shell" "/bin/sh")
("readlink" "\\readlink")
("stat" nil)
("perl-file-spec" t)
("perl-cwd-realpath" t)
("perl" "\\perl")
("id" "/usr/bin/id")
("gid-integer" 1000)
("gid-string" "infra")
("file-exists" "test -e")))

View File

@ -1,4 +1,4 @@
import datetime import time
import os import os
from PIL import Image from PIL import Image
@ -106,7 +106,14 @@ def lock_config():
lock_pic) lock_pic)
def log_command(command): def lock():
'Locks the System'
command = lock_config()
os.system(command)
def log(start_time):
write_mode = '' write_mode = ''
home = os.path.expanduser('~') home = os.path.expanduser('~')
log_file_path = "{}/{}".format(home, ".scripts/lock.log") log_file_path = "{}/{}".format(home, ".scripts/lock.log")
@ -116,23 +123,18 @@ def log_command(command):
else: else:
write_mode = 'w' write_mode = 'w'
program_duration = time.time() - start_time
with open(log_file_path, write_mode) as f: with open(log_file_path, write_mode) as f:
f.write("[{}] {}\n".format(str(datetime.datetime.now()), command)) f.write("[{}] {} seconds runtime.\n".format(time.asctime(), program_duration))
f.close() f.close()
def lock():
'Locks the System'
command = lock_config()
log_command(command)
os.system(command)
if __name__ == '__main__': if __name__ == '__main__':
start_time = time.time()
screenshot() screenshot()
pixelate() pixelate()
lock() lock()
log(start_time)

View File

@ -65,5 +65,6 @@ alias dir="du -h -d 1"
alias -s tex=emacs alias -s tex=emacs
alias -s cpp=emacs alias -s cpp=emacs
alias org="e ~/Nextcloud/orgs/man.org" alias org="e ~/Nextcloud/orgs/man.org"
alias neofetch="neofetch --block_range 0 16"
source $ZSH/oh-my-zsh.sh source $ZSH/oh-my-zsh.sh
export GPG_TTY=$(tty) export GPG_TTY=$(tty)