Coder Social home page Coder Social logo

Comments (8)

purcell avatar purcell commented on June 12, 2024 1

In that case you should either just disable electric-pair-mode (see init-editing-utils.el) or get in the habit of using one of the tricks I described above.

from emacs.d.

neozhaoliang avatar neozhaoliang commented on June 12, 2024 1

Thank you for the help, I will use the tricks!

from emacs.d.

purcell avatar purcell commented on June 12, 2024

It sounds like you're using your own config and wondering why the behaviour is different from mine?

If so, this behaviour could be affected by a number of things, and it's hard for me to speculate. Probably the code that's inserting the extra quote is electric-pair-mode. If that mode is disabled, then this could be a behaviour of the auto-completion framework, which may or may not be the same one I'm using.

It might also depend on the language major mode for the buffer where you're seeing this.

So perhaps provide a bit more info and I'll give you some pointers if I can.

from emacs.d.

neozhaoliang avatar neozhaoliang commented on June 12, 2024

Hi, I just cloned your repo, replace it with my old .emacs.d folder, kept all your code untouched, and created my own init-local.el file as follows:

;;; package --- my personal config

(setq-default cursor-type '(bar . 6))
(set-cursor-color "#FFFF00")
(global-set-key (kbd "C-<tab>") 'set-mark-command)

(add-to-list 'custom-theme-load-path "~/.emacs.d/themes")
(load-theme 'hardhacker t)

(setq flymake-start-on-flymake-mode nil)
(elpy-enable)

(require 'use-package)
(require 'quelpa-use-package)
(use-package copilot
  :quelpa (copilot :fetcher github
                   :repo "zerolfx/copilot.el"
                   :branch "main"
                   :files ("dist" "*.el")))
;; you can utilize :map :hook and :config to customize copilot
(add-hook 'prog-mode-hook 'copilot-mode)
(define-key copilot-completion-map (kbd "<tab>") 'copilot-accept-completion)
(define-key copilot-completion-map (kbd "TAB") 'copilot-accept-completion)
(provide 'init-local)

I also installed some packages like elpy and user-package (because I can't enable the autocompletion for python mode and I want to use copilot). Does that make a difference?

from emacs.d.

purcell avatar purcell commented on June 12, 2024

I also installed some packages like elpy and user-package (because I can't enable the autocompletion for python mode and I want to use copilot). Does that make a difference?

Probably nothing there makes a difference. You can try disabling electric-pair-mode and see if that helps. You can also use C-h k " to check that there's no special override for that character (it should normally be bound to self-insert-command).

from emacs.d.

isidoridev avatar isidoridev commented on June 12, 2024

You could use paredit-mode and use C-) to slurp after the quotes.
"|"John becomes
"|John"
Usually used for lisp languages though.

from emacs.d.

purcell avatar purcell commented on June 12, 2024

@psyconorlogy Yeah, and I'm in the process of adding puni to my config, to provide some Paredit-style structural editing support in non-Lisp buffers. But what I actually do in the above case is select the John, then hit ", which has the result of quoting the word to "John". You can also use C-q to disable any magic when inserting a char, so if there are certain occasional misbehaviours you can recognise those situations and work around them with C-q " or C-q ( etc.

from emacs.d.

neozhaoliang avatar neozhaoliang commented on June 12, 2024

@purcell I just deleted my .emacs.d folder, cloned your repo again and kept everything untouched, and it still autocompletes the quotes as before. I'm using ubuntu 22.04 and installed the snap version emacs (28.2).

from emacs.d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.