如何摆脱迷你缓冲区 Emacs 中奇怪的白色条
How to get rid of weird white bar in the minibuffer Emacs
我有一个奇怪的问题,每当我键入 :w
或任何其他可以在 vim 命令模式下使用的命令时(我在 emacs 中使用邪恶模式所以我可以 vim 仿真)我总是在迷你缓冲区的底部看到这个奇怪的白色光标。你能告诉我一个摆脱这个的方法吗,因为它真的很烦我。
我认为如果包含我的 init.el 可能会有用。如果需要,就这样:
(defun ali/initial-setup ()
"Basic Settings to make emacs usable"
(set-default-coding-systems 'utf-8)
(set-face-attribute 'default nil :font "Consolas" :height 120)
(setq scroll-margin 6)
(setq visible-bell 1)
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
(setq inhibit-startup-message t)
(tool-bar-mode -1)
(menu-bar-mode -1)
(scroll-bar-mode -1)
(setq mouse-wheel-scroll-amount '(1 ((shift) . 1)))
(setq mouse-wheel-progressive-speed nil)
(setq mouse-wheel-follow-mouse 't)
(setq scroll-step 3)
(setq-default indent-tabs-mode nil)
"Setting up fringes and truncated lines"
(global-visual-line-mode t)
(setq truncate-lines t)
(add-to-list 'default-frame-alist '(internal-border-width . 1))
(setq-default left-fringe-width 6)
"Making the line numbers wider"
(add-hook 'display-line-numbers-mode-hook '(lambda() (setq display-line-numbers-width 3)))
"Getting rid of autosave files and other stuff"
(setq make-lockfiles nil
make-backup-files nil)
(auto-save-mode -1)
"Making splits always be vertical by default"
(setq split-height-threshold nil
split-width-threshold 0)
(setq-default tab-width 4)
(setq-default indent-tabs-mode nil)
(setq-default c-basic-offset 4
c-default-style "linux"))
(defun ali/brackets()
"Automatically completing brackets and pairs"
(show-paren-mode 1)
(electric-pair-mode 1)
(setq electric-pair-pairs
'((?\" . ?\")
(?\{ . ?\}))))
;; Setting up packages
(require 'package)
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
("gnu" . "https://elpa.gnu.org/packages/")))
(require 'package)
(package-initialize)
(unless package-archive-contents
(package-refresh-contents))
(defvar packages-we-need '(org modus-themes evil ido))
(dolist (package packages-we-need)
(unless (package-installed-p 'package)
(package-install 'package)))
(defun ali/ido()
"Setting up ido mode"
(require 'ido)
(setq ido-create-new-buffer 'always)
"Making ido-mode work in M-x"
(global-set-key
"\M-x"
(lambda ()
(interactive)
(call-interactively
(intern
(ido-completing-read
"M-x "
(all-completions "" obarray 'commandp))))))
(ido-everywhere t)
(ido-mode 1))
(require 'modus-themes)
(load-theme 'modus-vivendi t)
(defun ali/evil()
(require 'evil)
"Making cursor always be a box"
(setq evil-insert-state-cursor 'box)
(evil-make-overriding-map ali-keymap 'normal 'motion)
(evil-mode 1))
(let ((ali-keymap (make-sparse-keymap)))
(define-key ali-keymap (kbd "C-h") 'evil-window-left)
(define-key ali-keymap (kbd "C-j") 'evil-window-down)
(define-key ali-keymap (kbd "C-k") 'evil-window-up)
(define-key ali-keymap (kbd "C-l") 'evil-window-right)
(define-key ali-keymap (kbd "M-d") '(lambda() (interactive) (execute-kbd-macro (read-kbd-macro "C-x d RET"))))
(define-key ali-keymap (kbd "C-p") 'ido-switch-buffer)
(define-key ali-keymap (kbd "C-f") 'ido-find-file)
(define-key ali-keymap (kbd "M-=") 'enlarge-window-horizontally)
(define-key ali-keymap (kbd "M--") 'shrink-window-horizontally)
(define-key ali-keymap (kbd "C-=") 'text-scale-increase)
(define-key ali-keymap (kbd "C--") 'text-scale-decrease)
(define-key ali-keymap (kbd "C-/") 'comment-line)
(define-key ali-keymap (kbd "C-S-i") 'display-line-numbers-mode)
(define-key ali-keymap (kbd "M-v") 'evil-window-vsplit)
(define-key ali-keymap (kbd "M-h") 'evil-window-split)
(define-key ali-keymap (kbd "C-S-h") 'help)
(define-key ali-keymap (kbd "C-d") 'kill-buffer)
(define-key ali-keymap (kbd "M-1") '(lambda() (interactive) (execute-kbd-macro (read-kbd-macro "M-x make-directory RET"))))
(defvar ali-keymap ali-keymap
"These are my keybindings"))
(define-minor-mode ali-keybindings-mode
nil
:global t
:lighter " keys"
:keymap ali-keymap)
(ali-keybindings-mode 1)
(ali/initial-setup)
(ali/evil)
(ali/brackets)
(ali/ido)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(custom-safe-themes
'("27a1dd6378f3782a593cc83e108a35c2b93e5ecc3bd9057313e1d88462701fcd" "0feb7052df6cfc1733c1087d3876c26c66410e5f1337b039be44cb406b6187c6" "57e3f215bef8784157991c4957965aa31bac935aca011b29d7d8e113a652b693" "0f7fa4835d02a927d7d738a0d2d464c38be079913f9d4aba9c97f054e67b8db9" "ddff22007104a1317014e48ff3d4911a83771a4ccf57185ccebf7f91339dbfb8" default))
'(package-selected-packages '(geiser-stklos modus-themes evil)))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
我解决了删除我写 (setq-default left-fringe-width 6)
的地方,而是添加了 (add-to-list 'default-frame-alist '(left-fringe . 5))
我有一个奇怪的问题,每当我键入 :w
或任何其他可以在 vim 命令模式下使用的命令时(我在 emacs 中使用邪恶模式所以我可以 vim 仿真)我总是在迷你缓冲区的底部看到这个奇怪的白色光标。你能告诉我一个摆脱这个的方法吗,因为它真的很烦我。
我认为如果包含我的 init.el 可能会有用。如果需要,就这样:
(defun ali/initial-setup ()
"Basic Settings to make emacs usable"
(set-default-coding-systems 'utf-8)
(set-face-attribute 'default nil :font "Consolas" :height 120)
(setq scroll-margin 6)
(setq visible-bell 1)
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
(setq inhibit-startup-message t)
(tool-bar-mode -1)
(menu-bar-mode -1)
(scroll-bar-mode -1)
(setq mouse-wheel-scroll-amount '(1 ((shift) . 1)))
(setq mouse-wheel-progressive-speed nil)
(setq mouse-wheel-follow-mouse 't)
(setq scroll-step 3)
(setq-default indent-tabs-mode nil)
"Setting up fringes and truncated lines"
(global-visual-line-mode t)
(setq truncate-lines t)
(add-to-list 'default-frame-alist '(internal-border-width . 1))
(setq-default left-fringe-width 6)
"Making the line numbers wider"
(add-hook 'display-line-numbers-mode-hook '(lambda() (setq display-line-numbers-width 3)))
"Getting rid of autosave files and other stuff"
(setq make-lockfiles nil
make-backup-files nil)
(auto-save-mode -1)
"Making splits always be vertical by default"
(setq split-height-threshold nil
split-width-threshold 0)
(setq-default tab-width 4)
(setq-default indent-tabs-mode nil)
(setq-default c-basic-offset 4
c-default-style "linux"))
(defun ali/brackets()
"Automatically completing brackets and pairs"
(show-paren-mode 1)
(electric-pair-mode 1)
(setq electric-pair-pairs
'((?\" . ?\")
(?\{ . ?\}))))
;; Setting up packages
(require 'package)
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
("gnu" . "https://elpa.gnu.org/packages/")))
(require 'package)
(package-initialize)
(unless package-archive-contents
(package-refresh-contents))
(defvar packages-we-need '(org modus-themes evil ido))
(dolist (package packages-we-need)
(unless (package-installed-p 'package)
(package-install 'package)))
(defun ali/ido()
"Setting up ido mode"
(require 'ido)
(setq ido-create-new-buffer 'always)
"Making ido-mode work in M-x"
(global-set-key
"\M-x"
(lambda ()
(interactive)
(call-interactively
(intern
(ido-completing-read
"M-x "
(all-completions "" obarray 'commandp))))))
(ido-everywhere t)
(ido-mode 1))
(require 'modus-themes)
(load-theme 'modus-vivendi t)
(defun ali/evil()
(require 'evil)
"Making cursor always be a box"
(setq evil-insert-state-cursor 'box)
(evil-make-overriding-map ali-keymap 'normal 'motion)
(evil-mode 1))
(let ((ali-keymap (make-sparse-keymap)))
(define-key ali-keymap (kbd "C-h") 'evil-window-left)
(define-key ali-keymap (kbd "C-j") 'evil-window-down)
(define-key ali-keymap (kbd "C-k") 'evil-window-up)
(define-key ali-keymap (kbd "C-l") 'evil-window-right)
(define-key ali-keymap (kbd "M-d") '(lambda() (interactive) (execute-kbd-macro (read-kbd-macro "C-x d RET"))))
(define-key ali-keymap (kbd "C-p") 'ido-switch-buffer)
(define-key ali-keymap (kbd "C-f") 'ido-find-file)
(define-key ali-keymap (kbd "M-=") 'enlarge-window-horizontally)
(define-key ali-keymap (kbd "M--") 'shrink-window-horizontally)
(define-key ali-keymap (kbd "C-=") 'text-scale-increase)
(define-key ali-keymap (kbd "C--") 'text-scale-decrease)
(define-key ali-keymap (kbd "C-/") 'comment-line)
(define-key ali-keymap (kbd "C-S-i") 'display-line-numbers-mode)
(define-key ali-keymap (kbd "M-v") 'evil-window-vsplit)
(define-key ali-keymap (kbd "M-h") 'evil-window-split)
(define-key ali-keymap (kbd "C-S-h") 'help)
(define-key ali-keymap (kbd "C-d") 'kill-buffer)
(define-key ali-keymap (kbd "M-1") '(lambda() (interactive) (execute-kbd-macro (read-kbd-macro "M-x make-directory RET"))))
(defvar ali-keymap ali-keymap
"These are my keybindings"))
(define-minor-mode ali-keybindings-mode
nil
:global t
:lighter " keys"
:keymap ali-keymap)
(ali-keybindings-mode 1)
(ali/initial-setup)
(ali/evil)
(ali/brackets)
(ali/ido)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(custom-safe-themes
'("27a1dd6378f3782a593cc83e108a35c2b93e5ecc3bd9057313e1d88462701fcd" "0feb7052df6cfc1733c1087d3876c26c66410e5f1337b039be44cb406b6187c6" "57e3f215bef8784157991c4957965aa31bac935aca011b29d7d8e113a652b693" "0f7fa4835d02a927d7d738a0d2d464c38be079913f9d4aba9c97f054e67b8db9" "ddff22007104a1317014e48ff3d4911a83771a4ccf57185ccebf7f91339dbfb8" default))
'(package-selected-packages '(geiser-stklos modus-themes evil)))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
我解决了删除我写 (setq-default left-fringe-width 6)
的地方,而是添加了 (add-to-list 'default-frame-alist '(left-fringe . 5))