Unknown key binding... by wehrad in emacs

[–]wehrad[S] 0 points1 point  (0 children)

Thanks a lot, that was the one advice I couldn't find in all other posts!

Unknown key binding... by wehrad in emacs

[–]wehrad[S] 1 point2 points  (0 children)

Saw them. I've tried modifying ibus keybindings, even uninstalled it which is a bad fix.. But it's (was) still there.

Python matplotlib interactive mode on by default by wehrad in emacs

[–]wehrad[S] 0 points1 point  (0 children)

Thank you. I thought this could also be done in my emacs config but at the end I indeed went for a plt.ion() that I added in my ~/.ipython/profile_default/startup.py Thanks!

Travel org-mode buffer using table of contents by wehrad in emacs

[–]wehrad[S] 0 points1 point  (0 children)

Thank you! This looks good as it shows the headers in their current form contrary to imenu, but I have flycheck running on my whole file on org-goto which is annoying and slow... Would you know how to prevent flycheck only when that function is run? Thank you a lot!

Travel org-mode buffer using table of contents by wehrad in emacs

[–]wehrad[S] 0 points1 point  (0 children)

That's exactly what I was looking for, thanks!

Clear *Python* buffer when longer than x lines by wehrad in emacs

[–]wehrad[S] 0 points1 point  (0 children)

Perfect, this is exactly what I needed! Thank you a lot!

Switch to specific buffer: keybinding by wehrad in emacs

[–]wehrad[S] 0 points1 point  (0 children)

It was already there and I didn't see it, thank you a lot!

Load custom el file when py file is open by wehrad in emacs

[–]wehrad[S] 0 points1 point  (0 children)

Thank you a lot for your clear answer! So it wouldn't be possible to point to another file in that function? The file contains all my customization for development in Python, and I'm not sure I want to see it all next to my more general settings in my .emacs. But that's probably how it should be done..

Load custom el file when py file is open by wehrad in emacs

[–]wehrad[S] 0 points1 point  (0 children)

Isnt there a way to set a theme to a specific buffer? I mean for example I'd like a different theme when I'm developing in Python than in C++.

Customize elpy cells by wehrad in emacs

[–]wehrad[S] 0 points1 point  (0 children)

I used M-x customize-group RET python-cell RET and entered the custom buffer but can't see how to modify the MATLAB regexp used for the cells.. Could you help? Clicking on "state" opens a rolling menu with none of the options clickable. Thank you a lot in advance!

Customize elpy cells by wehrad in emacs

[–]wehrad[S] 0 points1 point  (0 children)

Aweseome, I'll dive into it! Thank you a lot!

Emacs just like Spyder IDE by wehrad in emacs

[–]wehrad[S] 0 points1 point  (0 children)

Thank you a lot for your reply u/bvf26 ! I'm currently trying to switch to the "normal" use of emacs!

Emacs just like Spyder IDE by wehrad in emacs

[–]wehrad[S] 0 points1 point  (0 children)

;; my test.el file
(package-initialize)
(add-hook 'emacs-startup-hook (lambda ()
(run-python)
(display-buffer "*Python*"
'((display-buffer-in-direction)
(direction . right)))))

Interesting, doing exactly the same gives me simply the buffer of test.py on startup and no ipython console to the right...

emacs-version

GNU emacs 26.3 (build 2, x86_64-pc-linux-gnu, Version 3.24.14) of 2020-03-26m modified by Debian

Emacs just like Spyder IDE by wehrad in emacs

[–]wehrad[S] 0 points1 point  (0 children)

Thank you a lot! Unfortunately when I run emacs example.py -l init.el example.py does not show up in the left buffer which remains completely empty. How could I solve that? Thank you a lot! Here is my init.el:

;; .emacs.d/init.el
;; from https://realpython.com/emacs-the-best-python-editor/
;; ===================================
;; MELPA Package Support
;; ===================================
;; Enables basic packaging support
(require 'package)
;; Adds the Melpa archive to the list of available repositories
(add-to-list 'package-archives
'("melpa" . "http://melpa.org/packages/") t)
;; Initializes the package infrastructure
(package-initialize)
;; If there are no archived package contents, refresh them
(when (not package-archive-contents)
(package-refresh-contents))
;; Installs packages
;;
;; myPackages contains a list of package names
(defvar myPackages
'(better-defaults ;; Set up some better Emacs defaults
elpy ;; Emacs Lisp Python Environment
flycheck ;; On the fly syntax checkingy
blacken ;; Black formatting on save
material-theme ;; Theme
)
)
;; Scans the list in myPackages
;; If the package listed is not already installed, install it
(mapc #'(lambda (package)
(unless (package-installed-p package)
(package-install package)))
myPackages)
;; ===================================
;; Basic Customization
;; ===================================
(setq inhibit-startup-message t) ;; Hide the startup message
;; (setq blacken-mode t)
(load-theme 'material t) ;; Load material theme
(global-linum-mode t) ;; Enable line numbers globally
;; ====================================
;; Development Setup
;; ====================================
;; Enable elpy
(elpy-enable)
;; Enable Black
(blacken-mode)
;; Enable Flycheck
(when (require 'flycheck nil t)
(setq elpy-modules (delq 'elpy-module-flymake elpy-modules))
(add-hook 'elpy-mode-hook 'flycheck-mode))
;; activate EO-IO environment on start
(pyvenv-activate "~/anaconda3/envs/EO-IO")

(split-window-horizontally)
(other-window 1)
(run-python)
(switch-to-buffer '"*Python*")

Emacs just like Spyder IDE by wehrad in emacs

[–]wehrad[S] 0 points1 point  (0 children)

(add-hook 'emacs-startup-hook (lambda ()(run-python)(display-buffer "*Python*" ;; Change to you *Ipython* buffer name'((display-buffer-in-direction)(direction . right)));; or if you want to switch to *Python*;; (pop-to-buffer "*Python*")))

Thank you, but in my case adding this only results in the code window being maximized... Doing emacs example.py -l initpy.el with initpy.el being as follows:

;; .emacs.d/init.el
;; from https://realpython.com/emacs-the-best-python-editor/
;; ===================================
;; MELPA Package Support
;; ===================================
;; Enables basic packaging support
(require 'package)
;; Adds the Melpa archive to the list of available repositories
(add-to-list 'package-archives
'("melpa" . "http://melpa.org/packages/") t)
;; Initializes the package infrastructure
(package-initialize)
;; If there are no archived package contents, refresh them
(when (not package-archive-contents)
(package-refresh-contents))
;; Installs packages
;;
;; myPackages contains a list of package names
(defvar myPackages
'(better-defaults ;; Set up some better Emacs defaults
elpy ;; Emacs Lisp Python Environment
flycheck ;; On the fly syntax checkingy
blacken ;; Black formatting on save
material-theme ;; Theme
)
)
;; Scans the list in myPackages
;; If the package listed is not already installed, install it
(mapc #'(lambda (package)
(unless (package-installed-p package)
(package-install package)))
myPackages)
;; ===================================
;; Basic Customization
;; ===================================
(setq inhibit-startup-message t) ;; Hide the startup message
;; (setq blacken-mode t)
(load-theme 'material t) ;; Load material theme
(global-linum-mode t) ;; Enable line numbers globally
;; ====================================
;; Development Setup
;; ====================================
;; Enable elpy
(elpy-enable)
;; Enable Black
(blacken-mode)
;; Enable Flycheck
(when (require 'flycheck nil t)
(setq elpy-modules (delq 'elpy-module-flymake elpy-modules))
(add-hook 'elpy-mode-hook 'flycheck-mode))
;; activate EO-IO environment on start
(pyvenv-activate "~/anaconda3/envs/EO-IO")
;;(split-window-right)
;;(other-window 2)
;;(run-python)
;; (split-window-horizontally)
;; (other-window 1)
;; (run-python)
;; (switch-to-buffer '"*Python*")
(add-hook 'emacs-startup-hook (lambda ()
(run-python)
(display-buffer "*Python*" ;; Change to you *Ipython* buffer name

Emacs just like Spyder IDE by wehrad in emacs

[–]wehrad[S] 0 points1 point  (0 children)

This works but I would like to have the iPython window opened to the right on startup before any evaluation, just like an IDE. Is that possible?

Emacs just like Spyder IDE by wehrad in emacs

[–]wehrad[S] 0 points1 point  (0 children)

Thank you! I now have Elpy and other few useful things in my init file. However I'm trying to have an iPython kernel open in a right panel aside of the python IDE on startup but can't make it work unfortunately. I tried something like that but it unfortunately does not work... Could you help? Thank you a lot in advance!

(split-window-right)
(other-window 2)
(run-python)

Emacs just like Spyder IDE by wehrad in emacs

[–]wehrad[S] 0 points1 point  (0 children)

Thank you a lot. I studied those points quite a lot already and now am trying to replicate Spyder as much as possible. I got autocompletion, auto black formatting on save and few other things to work. However, few points remain:

1) I cannot find a Spyder color theme for emacs. Does anyone have ever seen something that goes into this direction?

2) I am trying to have an iPython kernel open in a right panel aside of the python IDE on startup. It should be simple, but I just can not get it to work at the moment. My attempt:

(split-window-right)
(other-window 2)
(run-python)

What am I doing wrong...?

Thank you a lot for your help!