Vim - indent like Emacs
Date : March 29 2020, 07:55 AM
should help you out I don't know if there's a way to directly import Emacs indentation settings into vim, but you can probably configure the same behavior in vim itself: set expandtab will convert tabs to spaces
|
How to re-indent Python code after changing indent width in Emacs?
Tag : python , By : Chris Tattum
Date : March 29 2020, 07:55 AM
I hope this helps you . There is the indent-region function. So I'd try mark the whole buffer, then M-x and type indent-region. It's usually bound to C-M-\, as far as I know. Edit
|
How to get auto indent (not smart indent) in emacs in all modes
Tag : emacs , By : user186876
Date : March 29 2020, 07:55 AM
hop of those help? I'm new to emacs, and its indenting is driving me up the walls. It's too smart for its own good; it (incorrectly) thinks it knows how I want to format my source, but I don't have time to chase down every setting for every mode for every different language that I write code for; and many of those languages don't have any mode enabled at all. , Here's the code: (setq tab-width 4)
(defun plain-tab ()
(interactive)
(insert (make-string tab-width ?\ )))
(defun plain-ret ()
(interactive)
(looking-back "^\\( +\\).*")
(newline)
(insert (match-string 1)))
(defun plain-del ()
(interactive)
(backward-delete-char
(if (looking-back (format " \\{%d\\}" tab-width)) tab-width 1)))
(defvar all-the-mode-maps
'(c-mode-map c++-mode-map java-mode-map
js-mode-map emacs-lisp-mode-map
clojure-mode-map))
(require 'cc-mode)
(require 'js)
(require 'clojure-mode)
(eval `(mapc
(lambda(map)
(define-key map [tab] 'plain-tab)
(define-key map [return] 'plain-ret)
(define-key map [backspace] 'plain-del)
(define-key map "{" (lambda()(interactive)(insert "{")))
(define-key map "}" (lambda()(interactive)(insert "}"))))
(list ,@all-the-mode-maps)))
|
Indent clojure on Emacs
Tag : emacs , By : Sigtryggur
Date : March 29 2020, 07:55 AM
help you fix your problem Here is a sample emacs config for what i consider the "minimal" usable emacs config for Clojure. I say minimal in that I'm not willing to work without good code completion, jump to definition, project aware file handling etc: from this example which you can clone to ~/.emacs.d: (use-package clojure-mode
:ensure t
:config
(add-hook 'clojure-mode-hook 'yas-minor-mode))
(use-package cider
:ensure t
:config (progn (add-hook 'clojure-mode-hook 'cider-mode)
(add-hook 'clojure-mode-hook 'cider-turn-on-eldoc-mode)
(add-hook 'cider-repl-mode-hook 'subword-mode)
(setq cider-annotate-completion-candidates t
cider-prompt-for-symbol nil)))
;; clojure refactor library
;; https://github.com/clojure-emacs/clj-refactor.el
(use-package clj-refactor
:ensure t
:config (progn (setq cljr-suppress-middleware-warnings t)
(add-hook 'clojure-mode-hook (lambda ()
(clj-refactor-mode 1)
(cljr-add-keybindings-with-prefix "C-c C-m")))))
{:user {:plugins [[cider/cider-nrepl "0.10.0-SNAPSHOT"]
[refactor-nrepl "1.1.0"]]
:dependencies [[acyclic/squiggly-clojure "0.1.3-SNAPSHOT"]]}}
|
How do I indent n spaces in emacs?
Date : March 29 2020, 07:55 AM
|