diff --git a/init.el b/init.el index cf54deb..77029bd 100644 --- a/init.el +++ b/init.el @@ -128,6 +128,9 @@ (global-set-key (kbd "C-") 'other-window) ;; Reduce whitespace around point to 0 or 1, according to context (global-set-key (kbd "C-S-") 'fixup-whitespace) +;; Scroll without moving the cursor +(global-set-key (kbd "M-") 'scroll-up-line) +(global-set-key (kbd "M-") 'scroll-down-line) ;;;;;;;;;;;;;;;;;;;; Programming / RTags ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (unless slow-computer @@ -214,8 +217,17 @@ "cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -G 'Unix Makefiles' .." projectile-project-compilation-cmd "cmake --build .") + + (defun projectile-kill-buffers-and-change-tabbar-grouping () + "Kill project buffers and change tabbar-ruler grouping to user-buffers." + (interactive) + (projectile-kill-buffers) + (tabbar-ruler-group-user-buffers)) :bind - ("C-c p" . 'projectile-command-map))) + ("C-c p" . 'projectile-command-map) + (:map projectile-command-map + ("k" . 'projectile-kill-buffers-and-change-tabbar-grouping)) + )) ;; Debugger (use-package realgud @@ -301,9 +313,20 @@ (unless slow-computer (use-package git-commit)) (use-package magit + :config + (defun my-magit-kill-buffers () + "Restore window configuration and kill all Magit buffers." + (interactive) + (let ((buffers (magit-mode-get-buffers))) + (magit-restore-window-configuration) + (mapc #'kill-buffer buffers))) + ;; (bind-key "q" #'my-magit-kill-buffers magit-status-mode-map) + :bind ("C-x g" . magit-status) - ("C-x M-g" . magit-dispatch)) + ("C-x M-g" . magit-dispatch) + (:map magit-status-mode-map + ("q" . my-magit-kill-buffers))) ;; Draw line in column 80 (use-package fill-column-indicator @@ -340,7 +363,7 @@ (flx-ido-mode t) (setq ido-enable-flex-matching t ido-ignore-extensions t - ido-use-virtual-buffers t)) ; Keep log of recently opened files + ido-use-virtual-buffers t)) ; Keep history of recently opened buffers ;; Tab bar (unless slow-computer @@ -353,7 +376,6 @@ ;; (tabbar-ruler-group-buffer-groups) ; Group by file type (tabbar-ruler-group-user-buffers) ; Group by frame ;; (mode-icons-mode 0) ; Disable modeline symbols - (setq tabbar-ruler-swap-faces nil) ; Swap tab colors ;; I have to define these 2 times, don't know why. (set-face-attribute 'tabbar-selected nil @@ -366,6 +388,9 @@ :foreground "dark gray" :family "Sans Serif" :italic t) + + (add-hook 'projectile-after-switch-project-hook ; Does not work under :hood + 'tabbar-ruler-group-by-projectile-project) :bind ("C-" . 'tabbar-ruler-tabbar-backward-tab) ("C-" . 'tabbar-ruler-tabbar-forward-tab) @@ -380,14 +405,26 @@ :background "gray18" :foreground "dark gray" :family "Sans Serif" - :italic t)))) + :italic t)) + )) ;; Keybinding for whitespace, don't visualise newlines (use-package whitespace :config (delete 'newline-mark whitespace-style) + (global-whitespace-mode) + ;; Don't show dots in company menu + (defun on-off-whitespace-before-company(command) + (when (string= "show" command) + (whitespace-mode -1)) + (when (string= "hide" command) + (whitespace-mode t))) + (advice-add 'company-call-frontends + :before #'on-off-whitespace-before-company) :bind - ("C-x w" . 'whitespace-mode)) + ("C-x w" . 'whitespace-mode) + :custom-face + (whitespace-space ((nil :foreground "gray18")))) ;; Spell checking (use-package flyspell @@ -439,7 +476,7 @@ :after nginx-mode :config :hook - (nginx-mode #'company-nginx-keywords)) + (nginx-mode . company-nginx-keywords)) ;;;;;;;;;;;;;;;;;;;; Server / Remote editing ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Edit remote files diff --git a/server/server b/server/server index fac88bd..d1d0507 100644 --- a/server/server +++ b/server/server @@ -1,2 +1,2 @@ -127.0.0.1:51313 12458 +127.0.0.1:51313 9509 phahw2ohVoh0oopheish7IVie9desh8aequeenei3uo8wahShe%thuadaeNa4ieh \ No newline at end of file