New answers tagged

0

I don't know if this is the best solution, but it works. (defun evil*-complete-previous () (interactive) (let ((old (string (char-syntax ?_)))) (modify-syntax-entry ?_ "w") (evil-complete-previous) (modify-syntax-entry ?_ old))) (define-key evil-insert-state-map (kbd "M-p") 'evil*-complete-previous)


3

Use C-u C-c C-c. See python-shell-buffer-substring function docstring: When optional argument NOMAIN is non-nil everything under an if __name__ == '__main__' block will be removed. And python-shell-send-buffer: When optional argument SEND-MAIN is non-nil, allow execution of code inside blocks delimited by if __name__== '__main__':. When called ...


1

Generally forward-sexp should know what to do in any given mode, so you could perhaps base it on this: (save-excursion (ignore-errors (forward-sexp) (1- (point)))) Alternatively... Something like how show-paren-mode works You could use that exact same code. Look at M-x find-function RET show-paren-function and how it uses the results of (funcall show-...


1

Just use forward-sexp instead (bound to C-M-f). Likewise, backward-sexp (C-M-b). See (elisp) List Motion. If you don't want to do that then you'll need to change the syntax for character * in your buffer to be word syntax: (modify-syntax-entry ?* "w") Or for a given syntax table, my-table: (modify-syntax-entry ?* "w" my-table)


Top 50 recent answers are included