I do a lot of text editing for work and there are some phrases that I have to type frequently. What's the best way to quickly paste those phrases into a document using a shortcut or keyword? I mainly use Kwrite and Kate as i prefer plain text editors and need no formatting.

  • mrh@mander.xyz
    ·
    edit-2
    5 months ago

    If I understand you correctly, this is trivial in emacs:

    (defun insert-text ()
      (interactive)
      (insert "your text here"))
    
    (global-set-key your-keybind-here #'insert-text)
    

    You could make it a format string if it relies on data specific to some file or parameter. You could also make the keybind local to certain modes/files rather than a global keybind if you don't want to pollute your keybind space.

    • cabhan@discuss.tchncs.de
      ·
      5 months ago

      Depending on the complexity, there's also abbrev-mode: https://www.gnu.org/software/emacs/manual/html_node/emacs/Abbrevs.html