From 735d01b5c7de9c0ee3a75323351c9251bf75af1d Mon Sep 17 00:00:00 2001 From: taptap Date: Tue, 3 Jan 2017 17:15:16 +0300 Subject: [PATCH 01/22] update .emacs transient mark mode, merged setq form, local CLHS browsing, optimized add-to-list packages form. --- .emacs | 88 +++++++++++++++++++++++----------------------------------- 1 file changed, 35 insertions(+), 53 deletions(-) diff --git a/.emacs b/.emacs index b2ca7cf..e56a0c5 100755 --- a/.emacs +++ b/.emacs @@ -2,72 +2,54 @@ '((sbcl ("/usr/bin/sbcl")) (ccl ("/usr/bin/ccl")))) (setq slime-contribs '(slime-fancy)) +(require 'cl) + +;;; Local CLHS browsing! +(load "~/quicklisp/clhs-use-local.el" t) + +(setq-default c-basic-offset 4) +(global-set-key [insert] 'delete-selection-mode) ;; Overwrite mode (tool-bar-mode -1) (menu-bar-mode -1) (scroll-bar-mode -1) +(transient-mark-mode -1) (column-number-mode t) - -(setq-default indent-tabs-mode nil) -(setq-default c-basic-offset 4) -(setq inhibit-startup-screen t) - (desktop-save-mode 1) (require 'package) -(add-to-list 'package-archives - '("melpa" . "http://melpa.milkbox.net/packages/")) (add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/")) +(add-to-list 'package-archives + '("melpa" . "http://melpa.milkbox.net/packages/")) (package-initialize) -(add-hook 'lisp-mode-hook #'enable-paredit-mode) +(setq-default indent-tabs-mode nil) + +(set-face-attribute 'default nil :font "8x13") +(set-fontset-font t 'unicode "unifont-10:antialias=false" nil 'prepend) +(set-fontset-font t 'unicode "MS Mincho-12" nil 'prepend) + +(require 'ido) +(ido-mode) + +(setq default-input-method "russian-computer" + browse-url-firefox-new-window-is-tab t + browse-url-firefox-program "firefox-bin" + ring-bell-function 'ignore + ido-enable-flex-matching t + mouse-yank-at-point t + inhibit-startup-screen t + column-number-mode t) + +(load-theme 'tango-dark) + +;;; Paredit +(add-hook 'lisp-mode-hook #'enable-paredit-mode) +(add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode) (add-hook 'lisp-interaction-mode-hook #'enable-paredit-mode) -(add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode) - -(load-theme 'tango-dark t) - -(add-to-list 'auto-mode-alist '("\\.asm\\'" . nasm-mode)) (add-hook 'before-save-hook 'delete-trailing-whitespace) -(set-face-attribute 'default nil :font "MS Mincho-12") -(set-fontset-font t 'unicode "MS Mincho-12" nil 'prepend) -(set-fontset-font t 'unicode "Unifont 12" nil 'prepend) - -(global-set-key (kbd "ESC ESC ESC") nil) - -(global-set-key (kbd "C-c C-j") 'avy-goto-word-or-subword-1) -(global-set-key (kbd "C-x w") 'ace-window) - -(require 'ido) -(ido-mode t) -(setq ido-enable-flex-matching t) -(setq ido-default-buffer-method 'selected-window) ;;; I hate ido switching to other frame - -(global-set-key (kbd "C-x C-b") 'buffer-menu) - -(setq mouse-yank-at-point t) - -;;; Set windowd width - -(defun set-window-width (n) - "Set the selected window's width." - (adjust-window-trailing-edge (selected-window) (- n (window-width)) t)) - -(defun set-80-columns () - "Set the selected window to 80 columns." - (interactive) - (set-window-width 80)) - -(global-set-key "\C-x~" 'set-80-columns) - -;;; Rust autocomplete - -(add-hook 'rust-mode-hook #'racer-mode) -(add-hook 'racer-mode-hook #'eldoc-mode) - -(add-hook 'racer-mode-hook #'company-mode) - -(setq company-tooltip-align-annotations t) -(add-to-list 'exec-path "/home/ex/.cargo/bin/") +(define-key global-map (kbd "C-[ C-[ C-[") nil) +(define-key global-map (kbd "C-x w") #'switch-to-buffer-other-window) From b5743b99bb32458260a5e1e44002d500d94c26b8 Mon Sep 17 00:00:00 2001 From: taptap Date: Wed, 4 Jan 2017 01:07:52 +0300 Subject: [PATCH 02/22] disable left corner menu button in rc.lua --- rc.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc.lua b/rc.lua index c7db4d8..eaa84f7 100755 --- a/rc.lua +++ b/rc.lua @@ -128,8 +128,8 @@ mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesom } }) -mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon, - menu = mymainmenu }) +-- mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon, +-- menu = mymainmenu }) -- Menubar configuration menubar.utils.terminal = terminal -- Set the terminal for applications that require it From f026c7393f4f1ad1944ecc01c45ddfb61fb20ad5 Mon Sep 17 00:00:00 2001 From: taptap Date: Thu, 19 Jan 2017 14:43:34 +0300 Subject: [PATCH 03/22] change ido default buffer/file methods Ido has a nasty feature of switching to frame in which window with file/buffer in question is already opened, instead opening it in current window. Most probably it was designed for lesser, non-tiling WMs. Patch fixes this behaviour, forcing C-x C-f and C-x b to open file/buffer in the current window. --- .emacs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.emacs b/.emacs index e56a0c5..4fd46b3 100755 --- a/.emacs +++ b/.emacs @@ -40,7 +40,9 @@ ido-enable-flex-matching t mouse-yank-at-point t inhibit-startup-screen t - column-number-mode t) + column-number-mode t + ido-default-buffer-method 'selected-window + ido-default-file-method 'selected-window) (load-theme 'tango-dark) From 1c89f0e4f3157b4edd1460312b1546a907b8b083 Mon Sep 17 00:00:00 2001 From: taptap Date: Mon, 6 Feb 2017 17:24:56 +0300 Subject: [PATCH 04/22] add xkb config for F13 remapping and language toggle --- xkb_config/README | 4 ++++ xkb_config/keycodes/override | 3 +++ xkb_config/keymap/mymap | 7 +++++++ xkb_config/symbols/f13_toggle | 7 +++++++ 4 files changed, 21 insertions(+) create mode 100644 xkb_config/README create mode 100644 xkb_config/keycodes/override create mode 100644 xkb_config/keymap/mymap create mode 100644 xkb_config/symbols/f13_toggle diff --git a/xkb_config/README b/xkb_config/README new file mode 100644 index 0000000..125cb68 --- /dev/null +++ b/xkb_config/README @@ -0,0 +1,4 @@ +Compile and apply +-------- + + xkbcomp -I$HOME/path/to/xkb_config ~/path/to/xkb_config/keymap/mymap $DISPLAY diff --git a/xkb_config/keycodes/override b/xkb_config/keycodes/override new file mode 100644 index 0000000..15050a2 --- /dev/null +++ b/xkb_config/keycodes/override @@ -0,0 +1,3 @@ +default xkb_keycodes "f13" { + = 66; +}; \ No newline at end of file diff --git a/xkb_config/keymap/mymap b/xkb_config/keymap/mymap new file mode 100644 index 0000000..bb3bc95 --- /dev/null +++ b/xkb_config/keymap/mymap @@ -0,0 +1,7 @@ +xkb_keymap { + xkb_keycodes { include "evdev+aliases(qwerty)+override(f13)" }; + xkb_types { include "complete" }; + xkb_compat { include "complete" }; + xkb_symbols { include "pc+us+ru:2+inet(evdev)+f13_toggle" }; + xkb_geometry { include "pc(pc105)" }; +}; diff --git a/xkb_config/symbols/f13_toggle b/xkb_config/symbols/f13_toggle new file mode 100644 index 0000000..25f1c31 --- /dev/null +++ b/xkb_config/symbols/f13_toggle @@ -0,0 +1,7 @@ +partial modifier_keys +xkb_symbols "f13_toggle" { + key { + type[Group1] = "PC_CONTROL_LEVEL2", + symbols[Group1] = [ ISO_Next_Group, F14 ] + }; +}; From 50f2d45c1ea678bc7b9fd6ecae9f9caba2613d0e Mon Sep 17 00:00:00 2001 From: taptap Date: Wed, 15 Feb 2017 20:21:56 +0300 Subject: [PATCH 05/22] update .Xresources to urxvt --- .Xresources | 45 ++++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/.Xresources b/.Xresources index 57637aa..7c4e846 100644 --- a/.Xresources +++ b/.Xresources @@ -1,26 +1,25 @@ !! Molokai Theme -*xterm*background: #101010 -*xterm*foreground: #d0d0d0 -*xterm*cursorColor: #d0d0d0 -*xterm*color0: #101010 -*xterm*color1: #960050 -*xterm*color2: #66aa11 -*xterm*color3: #c47f2c -*xterm*color4: #30309b -*xterm*color5: #7e40a5 -*xterm*color6: #3579a8 -*xterm*color7: #9999aa -*xterm*color8: #303030 -*xterm*color9: #ff0090 -*xterm*color10: #80ff00 -*xterm*color11: #ffba68 -*xterm*color12: #5f5fee -*xterm*color13: #bb88dd -*xterm*color14: #4eb4fa -*xterm*color15: #d0d0d0 +URxvt*background: #101010 +URxvt*foreground: #d0d0d0 +URxvt*cursorColor: #d0d0d0 +URxvt*color0: #101010 +URxvt*color1: #960050 +URxvt*color2: #66aa11 +URxvt*color3: #c47f2c +URxvt*color4: #30309b +URxvt*color5: #7e40a5 +URxvt*color6: #3579a8 +URxvt*color7: #9999aa +URxvt*color8: #303030 +URxvt*color9: #ff0090 +URxvt*color10: #80ff00 +URxvt*color11: #ffba68 +URxvt*color12: #5f5fee +URxvt*color13: #bb88dd +URxvt*color14: #4eb4fa +URxvt*color15: #d0d0d0 -UXTerm*metaSendsEscape: true -UXTerm*faceName: DejaVu Sans Mono:style=Book -UXTerm*faceNameDoublesize: IPAGothic:style=Regular -UXTerm*faceSize: 11 + +URxvt*font: 8x13, + xft:Unifont \ No newline at end of file From ffcee4ce15bce0c8861f0b2e391b7d1a08a84085 Mon Sep 17 00:00:00 2001 From: taptap Date: Mon, 13 Feb 2017 23:37:56 +0300 Subject: [PATCH 06/22] add awesome widgets for volume and battery --- awesome-widgets/battery/battery.lua | 117 ++++++++++++++++++++++++++++ awesome-widgets/sound/volume.lua | 29 +++++++ 2 files changed, 146 insertions(+) create mode 100644 awesome-widgets/battery/battery.lua create mode 100644 awesome-widgets/sound/volume.lua diff --git a/awesome-widgets/battery/battery.lua b/awesome-widgets/battery/battery.lua new file mode 100644 index 0000000..efae8bb --- /dev/null +++ b/awesome-widgets/battery/battery.lua @@ -0,0 +1,117 @@ +local wibox = require("wibox") +local beautiful = require("beautiful") +local awful = require("awful") +local naughty = require("naughty") + +local io = io +local math = math +local tonumber = tonumber +local tostring = tostring +local print = print +local pairs = pairs + +local limits = {{12, 3}, + { 5, 1}, + {0}} + +function get_bat_state (adapter) + -- power_supply/charge_now changes to energy_now when resuming from hibernation + local fcur = io.open("/sys/class/power_supply/"..adapter.."/charge_now") + local fcap = io.open("/sys/class/power_supply/"..adapter.."/charge_full") + local fsta = io.open("/sys/class/power_supply/"..adapter.."/status") + if fcur == nil then + fcur = io.open("/sys/class/power_supply/"..adapter.."/energy_now") + if fcur == nil then + -- most probably, we just returned from sleep or + -- nibernation and file is not here yet + return nil, nil + end + end + + if fcap == nil then + fcap = io.open("/sys/class/power_supply/"..adapter.."/energy_full") + end + + local cur = fcur:read() + local cap = fcap:read() + local sta = fsta:read() + fcur:close() + fcap:close() + fsta:close() + local battery = math.floor(cur * 100 / cap) + if sta:match("Charging") then + dir = 1 + elseif sta:match("Discharging") then + dir = -1 + else + dir = 0 + battery = "" + end + return battery, dir +end + +function getnextlim (num) + for ind, pair in pairs(limits) do + lim = pair[1]; step = pair[2]; nextlim = limits[ind+1][1] or 0 + if num > nextlim then + repeat + lim = lim - step + until num > lim + if lim < nextlim then + lim = nextlim + end + return lim + end + end +end + + +function batclosure (adapter) + local nextlim = limits[1][1] + return function () + local prefix = "⚡C⚡" + local battery, dir = get_bat_state(adapter) + if battery == nil then return end -- just thawed or woke up + if dir == -1 then + dirsign = "↓" + prefix = "Bat:" + if battery <= nextlim then + naughty.notify({title = "⚡ Warning ⚡", + text = "Battery charge is low ( ⚡ "..battery.."%)!", + timeout = 7, + position = "bottom_right", + fg = beautiful.fg_focus, + bg = beautiful.bg_focus + }) + nextlim = getnextlim(battery) + end + return " "..prefix.." "..dirsign..battery..dirsign.." " + elseif dir == 1 then + dirsign = "↑" + nextlim = limits[1][1] + return " "..prefix.." "..dirsign..battery..dirsign.." " + else + dirsign = "" + return " "..prefix.." " + end + if dir ~= 0 then battery = battery.."%" end + + end +end + +battery_widget_text = wibox.widget.textbox() +battery_widget_text:set_align("right") + +bat_clo = batclosure("BAT0") + +battery_widget_text:set_markup(bat_clo()) +battimer = timer({ timeout = 30 }) +battimer:connect_signal("timeout", + function() + battery_widget_text:set_markup(bat_clo()) + end) +battimer:start() + +battery_widget = wibox.widget.background() +battery_widget:set_widget(battery_widget_text) +--battery_widget:set_bg('#660066') diff --git a/awesome-widgets/sound/volume.lua b/awesome-widgets/sound/volume.lua new file mode 100644 index 0000000..5683c56 --- /dev/null +++ b/awesome-widgets/sound/volume.lua @@ -0,0 +1,29 @@ +local wibox = require("wibox") +local awful = require("awful") + +volume_widget_text = wibox.widget.textbox() +volume_widget_text:set_align("right") + +function update_volume(widget) + local fd = io.popen("amixer sget Master") + local status = fd:read("*all") + fd:close() + + local volume = string.match(status, "(%d?%d?%d)%%") + volume = string.format("%d", volume) + + status = string.match(status, "%[(o[^%]]*)%]") + + if string.find(status, "on", 1, true) then + volume = " " .. volume .. " " + else + volume = " " .. volume .. " " + end + widget:set_markup(volume) +end + +update_volume(volume_widget_text) + +volume_widget = wibox.widget.background() +volume_widget:set_widget(volume_widget_text) +--volume_widget:set_bg('#000066') From 2fd57e93faa05953b33d411bcf3342d5c7a14d38 Mon Sep 17 00:00:00 2001 From: taptap Date: Tue, 14 Feb 2017 13:20:52 +0300 Subject: [PATCH 07/22] rename and move awesome config files --- rc.lua => .config/awesome/rc.lua | 0 {awesome-widgets => .config/awesome/widgets}/battery/battery.lua | 0 {awesome-widgets => .config/awesome/widgets}/sound/volume.lua | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename rc.lua => .config/awesome/rc.lua (100%) rename {awesome-widgets => .config/awesome/widgets}/battery/battery.lua (100%) rename {awesome-widgets => .config/awesome/widgets}/sound/volume.lua (100%) diff --git a/rc.lua b/.config/awesome/rc.lua similarity index 100% rename from rc.lua rename to .config/awesome/rc.lua diff --git a/awesome-widgets/battery/battery.lua b/.config/awesome/widgets/battery/battery.lua similarity index 100% rename from awesome-widgets/battery/battery.lua rename to .config/awesome/widgets/battery/battery.lua diff --git a/awesome-widgets/sound/volume.lua b/.config/awesome/widgets/sound/volume.lua similarity index 100% rename from awesome-widgets/sound/volume.lua rename to .config/awesome/widgets/sound/volume.lua From 2352520f55350ea53e861faea359b1c34cfc6347 Mon Sep 17 00:00:00 2001 From: taptap Date: Wed, 15 Feb 2017 20:23:44 +0300 Subject: [PATCH 08/22] switch from ibus to fcitx, update rc.lua accordingly Ibus is not maintained as well as fcitx, which is quite alive project, which also plays nice with pinyin and anthy as well. --- .config/awesome/rc.lua | 2 +- .xinitrc | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .xinitrc diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index eaa84f7..d71aab2 100755 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -73,7 +73,7 @@ awful.util.spawn_with_shell( awful.util.spawn_with_shell( "xmodmap -e 'clear Lock' -e 'keycode 66 = Control_L' -e 'add Control = Control_L'") -awful.util.spawn_with_shell("ibus-daemon -d -r -x -n awesome") +awful.util.spawn_with_shell("fcitx -r") -- @DOC_LAYOUT@ -- Table of layouts to cover with awful.layout.inc, order matters. diff --git a/.xinitrc b/.xinitrc new file mode 100644 index 0000000..c88c56e --- /dev/null +++ b/.xinitrc @@ -0,0 +1,3 @@ +export GTK_IM_MODULE=fcitx +export QT_IM_MODULE=fcitx +export XMODIFIERS=@im=fcitx From aa3315d4e4986c283c4dcd315fda672a43fef540 Mon Sep 17 00:00:00 2001 From: taptap Date: Fri, 17 Feb 2017 15:56:20 +0300 Subject: [PATCH 09/22] ditch ido-mode in favor of icicles icicles are more vanilla-like and less strict and less invasive about the way I interact with them, so I decided to switch to them. --- .emacs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.emacs b/.emacs index 4fd46b3..73799d8 100755 --- a/.emacs +++ b/.emacs @@ -30,8 +30,8 @@ (set-fontset-font t 'unicode "unifont-10:antialias=false" nil 'prepend) (set-fontset-font t 'unicode "MS Mincho-12" nil 'prepend) -(require 'ido) -(ido-mode) +(require 'icicles) +(icicle-mode 1) (setq default-input-method "russian-computer" browse-url-firefox-new-window-is-tab t From f808a5d7598b039625e255bd20e584d6677e6d09 Mon Sep 17 00:00:00 2001 From: taptap Date: Thu, 16 Feb 2017 12:57:37 +0300 Subject: [PATCH 10/22] fix xkb layout for regular setups Previous layout was for already remapped ctrl and capslock on OSX machine. Now its suitable for less exotic cases --- xkb_config/keycodes/override | 6 +++++- xkb_config/keymap/mymap | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/xkb_config/keycodes/override b/xkb_config/keycodes/override index 15050a2..185acac 100644 --- a/xkb_config/keycodes/override +++ b/xkb_config/keycodes/override @@ -1,3 +1,7 @@ default xkb_keycodes "f13" { - = 66; + = 37; +}; + +default xkb_keycodes "left_ctrl" { + = 66; }; \ No newline at end of file diff --git a/xkb_config/keymap/mymap b/xkb_config/keymap/mymap index bb3bc95..fcf5e12 100644 --- a/xkb_config/keymap/mymap +++ b/xkb_config/keymap/mymap @@ -1,5 +1,5 @@ xkb_keymap { - xkb_keycodes { include "evdev+aliases(qwerty)+override(f13)" }; + xkb_keycodes { include "evdev+aliases(qwerty)+override(f13)+override(left_ctrl)" }; xkb_types { include "complete" }; xkb_compat { include "complete" }; xkb_symbols { include "pc+us+ru:2+inet(evdev)+f13_toggle" }; From 63e50cf01b31ae7f9e6a2a5efe72c7f4cd9f9e4f Mon Sep 17 00:00:00 2001 From: taptap Date: Fri, 17 Feb 2017 16:01:33 +0300 Subject: [PATCH 11/22] update xkb config README and rename it to README.md --- xkb_config/README | 4 ---- xkb_config/README.md | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) delete mode 100644 xkb_config/README create mode 100644 xkb_config/README.md diff --git a/xkb_config/README b/xkb_config/README deleted file mode 100644 index 125cb68..0000000 --- a/xkb_config/README +++ /dev/null @@ -1,4 +0,0 @@ -Compile and apply --------- - - xkbcomp -I$HOME/path/to/xkb_config ~/path/to/xkb_config/keymap/mymap $DISPLAY diff --git a/xkb_config/README.md b/xkb_config/README.md new file mode 100644 index 0000000..9fd0545 --- /dev/null +++ b/xkb_config/README.md @@ -0,0 +1,17 @@ +Install +-------- + +Copy the contents to `~/.config/xkb`. + + +Compile and apply +-------- + +To immediately apply new map, run the following command: + + + xkbcomp -I$HOME/.config/xkb ~/.config/xkb/keymap/mymap $DISPLAY + + +And to run it every time your window manager starts, add it to `.xinitrc`, or +just to your WM of choise default autostart mechanism. From a45a847145dd4e5303b9bc9f601ec9df3ef13566 Mon Sep 17 00:00:00 2001 From: taptap Date: Mon, 20 Feb 2017 14:25:54 +0300 Subject: [PATCH 12/22] add URxvt*saveLines to .Xresources --- .Xresources | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.Xresources b/.Xresources index 7c4e846..1640a4e 100644 --- a/.Xresources +++ b/.Xresources @@ -22,4 +22,6 @@ URxvt*color15: #d0d0d0 URxvt*font: 8x13, - xft:Unifont \ No newline at end of file + xft:Unifont + +Rxvt*saveLines: 8192 \ No newline at end of file From 6d87a9f9822e2d5f6661b8e7abed1a5085df71c6 Mon Sep 17 00:00:00 2001 From: taptap Date: Fri, 17 Mar 2017 14:43:40 +0300 Subject: [PATCH 13/22] bind M-o to swithch to other window --- .emacs | 1 + 1 file changed, 1 insertion(+) diff --git a/.emacs b/.emacs index 73799d8..c84f742 100755 --- a/.emacs +++ b/.emacs @@ -9,6 +9,7 @@ (setq-default c-basic-offset 4) (global-set-key [insert] 'delete-selection-mode) ;; Overwrite mode +(global-set-key (kbd "M-o") 'other-window) ;; Instead of C-x o (tool-bar-mode -1) (menu-bar-mode -1) From ab7429ba394be7ab06da5d2d3545b36f6183f7ad Mon Sep 17 00:00:00 2001 From: taptap Date: Fri, 17 Mar 2017 17:35:01 +0300 Subject: [PATCH 14/22] enable winner-mode by default --- .emacs | 1 + 1 file changed, 1 insertion(+) diff --git a/.emacs b/.emacs index c84f742..9c1a668 100755 --- a/.emacs +++ b/.emacs @@ -17,6 +17,7 @@ (transient-mark-mode -1) (column-number-mode t) (desktop-save-mode 1) +(winner-mode 1) (require 'package) (add-to-list 'package-archives From ab5a76b65a4d94c620c76925ed41f98fe312ac67 Mon Sep 17 00:00:00 2001 From: taptap Date: Fri, 26 May 2017 16:37:11 +0300 Subject: [PATCH 15/22] hello projectile-mode --- .emacs | 1 + 1 file changed, 1 insertion(+) diff --git a/.emacs b/.emacs index 9c1a668..09f461c 100755 --- a/.emacs +++ b/.emacs @@ -34,6 +34,7 @@ (require 'icicles) (icicle-mode 1) +(projectile-mode 1) (setq default-input-method "russian-computer" browse-url-firefox-new-window-is-tab t From fe8c5b97f7d66912a6eb724939ddce004093d589 Mon Sep 17 00:00:00 2001 From: taptap Date: Fri, 26 May 2017 16:36:52 +0300 Subject: [PATCH 16/22] bye icicles, hello ivy I like ivy more. --- .emacs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.emacs b/.emacs index 09f461c..d19a3b5 100755 --- a/.emacs +++ b/.emacs @@ -32,8 +32,7 @@ (set-fontset-font t 'unicode "unifont-10:antialias=false" nil 'prepend) (set-fontset-font t 'unicode "MS Mincho-12" nil 'prepend) -(require 'icicles) -(icicle-mode 1) +(ivy-mode 1) (projectile-mode 1) (setq default-input-method "russian-computer" From 8f9712bf5eef5494548ccb57ec47f23fac424023 Mon Sep 17 00:00:00 2001 From: taptap Date: Fri, 26 May 2017 17:07:32 +0300 Subject: [PATCH 17/22] bye 8x13, unifont and MS Mincho, hello Input fonts Change fonts to proportional from monospace. It looks nicer. --- .emacs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.emacs b/.emacs index d19a3b5..e1d3038 100755 --- a/.emacs +++ b/.emacs @@ -28,9 +28,7 @@ (setq-default indent-tabs-mode nil) -(set-face-attribute 'default nil :font "8x13") -(set-fontset-font t 'unicode "unifont-10:antialias=false" nil 'prepend) -(set-fontset-font t 'unicode "MS Mincho-12" nil 'prepend) +(set-face-attribute 'default nil :font "Input Sans-10") (ivy-mode 1) (projectile-mode 1) From 49bcbbc3bb1dbf3e162e7a2226839f57a9b62eb5 Mon Sep 17 00:00:00 2001 From: taptap Date: Fri, 26 May 2017 17:08:13 +0300 Subject: [PATCH 18/22] add hooks with setting monospaced font to some modes with tables and aligning --- .emacs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.emacs b/.emacs index e1d3038..faa2bf1 100755 --- a/.emacs +++ b/.emacs @@ -30,6 +30,14 @@ (set-face-attribute 'default nil :font "Input Sans-10") +(defun set-monospace-font () + (buffer-face-set '(:family "Input Mono"))) + +(dolist (mode-hook '(dired-mode-hook + help-mode-hook + minibuffer-setup-hook)) + (add-hook mode-hook #'set-monospace-font)) + (ivy-mode 1) (projectile-mode 1) From 0dcb3a768882b67c95bef859a2dfa3289b2b0bd6 Mon Sep 17 00:00:00 2001 From: taptap Date: Fri, 26 May 2017 17:45:44 +0300 Subject: [PATCH 19/22] add function add-hook-modes to reduce code duplication --- .emacs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.emacs b/.emacs index faa2bf1..a891cb9 100755 --- a/.emacs +++ b/.emacs @@ -33,10 +33,19 @@ (defun set-monospace-font () (buffer-face-set '(:family "Input Mono"))) -(dolist (mode-hook '(dired-mode-hook - help-mode-hook - minibuffer-setup-hook)) - (add-hook mode-hook #'set-monospace-font)) +(defun add-hook-modes (mode-hook-list hook) + (dolist (mode-hook mode-hook-list) + (add-hook mode-hook hook))) + +(add-hook-modes '(dired-mode-hook + help-mode-hook + minibuffer-setup-hook) + #'set-monospace-font) + +(add-hook-modes '(lisp-mode-hook + emacs-lisp-mode-hook + lisp-interaction-mode-hook) + #'enable-paredit-mode) (ivy-mode 1) (projectile-mode 1) @@ -54,11 +63,6 @@ (load-theme 'tango-dark) -;;; Paredit -(add-hook 'lisp-mode-hook #'enable-paredit-mode) -(add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode) -(add-hook 'lisp-interaction-mode-hook #'enable-paredit-mode) - (add-hook 'before-save-hook 'delete-trailing-whitespace) (define-key global-map (kbd "C-[ C-[ C-[") nil) From 32db4b7972c277e7e2bc047e8bdac44cb65c1dce Mon Sep 17 00:00:00 2001 From: taptap Date: Fri, 26 May 2017 17:46:41 +0300 Subject: [PATCH 20/22] mode all mode enabling/disabling to one place --- .emacs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.emacs b/.emacs index a891cb9..b721ebe 100755 --- a/.emacs +++ b/.emacs @@ -11,13 +11,6 @@ (global-set-key [insert] 'delete-selection-mode) ;; Overwrite mode (global-set-key (kbd "M-o") 'other-window) ;; Instead of C-x o -(tool-bar-mode -1) -(menu-bar-mode -1) -(scroll-bar-mode -1) -(transient-mark-mode -1) -(column-number-mode t) -(desktop-save-mode 1) -(winner-mode 1) (require 'package) (add-to-list 'package-archives @@ -47,6 +40,13 @@ lisp-interaction-mode-hook) #'enable-paredit-mode) +(tool-bar-mode -1) +(menu-bar-mode -1) +(scroll-bar-mode -1) +(transient-mark-mode -1) +(column-number-mode t) +(desktop-save-mode 1) +(winner-mode 1) (ivy-mode 1) (projectile-mode 1) From ea65a10c9e9a48d9fd4a831b0289ac70b10b26aa Mon Sep 17 00:00:00 2001 From: taptap Date: Fri, 26 May 2017 17:46:56 +0300 Subject: [PATCH 21/22] add macro for defining global keymap and make use of it This stupidity with (define-key global-map ...) and (global-set-key ...) now unified and prettified. --- .emacs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.emacs b/.emacs index b721ebe..9a2d2de 100755 --- a/.emacs +++ b/.emacs @@ -8,9 +8,19 @@ (load "~/quicklisp/clhs-use-local.el" t) (setq-default c-basic-offset 4) -(global-set-key [insert] 'delete-selection-mode) ;; Overwrite mode -(global-set-key (kbd "M-o") 'other-window) ;; Instead of C-x o +(defmacro global-set-keys (&rest map) + (let (a) + (dolist (key-action map) + (push `(global-set-key ,(car key-action) ,(cdr key-action)) + a)) + `(progn ,@a))) + +(global-set-keys + ([insert] . 'delete-selection-mode) ;; Overwrite mode + ((kbd "M-o") . 'other-window) ;; Instead of C-x o + ((kbd "C-[ C-[ C-[") . nil) + ((kbd "C-x w") . #'switch-to-buffer-other-window)) (require 'package) (add-to-list 'package-archives @@ -64,6 +74,3 @@ (load-theme 'tango-dark) (add-hook 'before-save-hook 'delete-trailing-whitespace) - -(define-key global-map (kbd "C-[ C-[ C-[") nil) -(define-key global-map (kbd "C-x w") #'switch-to-buffer-other-window) From a41a9f62e71221d1bb8ae52374e84c0c36654900 Mon Sep 17 00:00:00 2001 From: taptap Date: Mon, 29 May 2017 17:57:57 +0300 Subject: [PATCH 22/22] move custom to separate file Because it creates ugly mess otherwise! --- .emacs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.emacs b/.emacs index 9a2d2de..e7e11b3 100755 --- a/.emacs +++ b/.emacs @@ -74,3 +74,6 @@ (load-theme 'tango-dark) (add-hook 'before-save-hook 'delete-trailing-whitespace) + +(setq custom-file "~/.emacs.d/custom.el") +(load custom-file)