The words Under construction in black text on a yellow background with diagonal black stipes surrounding it
I'm in the process of moving my site. It's still a work in progress. Please excuse the mess and broken links.

Turn On Line Numbers For Python Automatically In Emacs

TODO: Pull subtitle into page object

I added this to my `~/.spacemacs` file to turn on relative line numbers when in Python mode:

code_start_default_section code_end_default_section

I had to move this outside of the user `(defun dotspacemacs/user-config () ... )` config section. It doesn't work if you put it in there.

This example uses python. It works with other modes as well. I confirmed the name of the hook finding the name of the variable via `C-h v` then typing `hook` and scanning the results to find what I'm looking for.

Debugging Stuff

I'm moving stuff around right now. All this below is helping me figure out where to put stuff

        -- title

Turn On Line Numbers For Python Automatically In Emacs

-- p

I added this to my `~/.spacemacs` file to turn on relative line numbers when in Python mode:

-- code/
-- lisp

(add-hook 'python-mode-hook 
  (lambda () 
    (display-line-numbers-mode +1)
    (setq display-line-numbers 'relative)
    ))

-- /code

-- p

I had to move this outside of the user `(defun dotspacemacs/user-config ()
 ... )` config section. It doesn't work if you put it in there.

-- p

This example uses python. It works with other modes as well. I confirmed the name of the hook finding the name of the variable via `C-h v` then typing `hook` and scanning the results to find what I'm looking for.


-- categories
-- Emacs

-- metadata
-- date: 2022-05-24 15:29:05
-- id: 29cm3azt
-- status: published
-- type: post
-- SCRUBBED_NEO: false
-- site: aws