Fork me on GitHub
#spacemacs
<
2018-10-09
>
kirill.salykin12:10:42

is it possible to truncate long lines (SPC t l) globally and always?

kirill.salykin12:10:11

and if possible - how? 🙂 thanks

practicalli-johnny15:10:54

@kirill.salykin I believe so, although havent tried it. There are a few ways you can add this to the dotspacemacs/user-config section of .spacemacs Set global visual line mode to true, this wraps lines and is a minor mode around truncate lines

(setq-default global-visual-line-mode t)
I use the following which works for org-mode:
;; turn on visual-line-mode for org-mode only
  (add-hook 'org-mode-hook 'turn-on-visual-line-mode)
You may have to reload your configuration or restart Spacemacs for this to be picked up

kirill.salykin15:10:25

nope, doesnt work

practicalli-johnny15:10:56

I cant help with this minimal response, sorry.

kirill.salykin15:10:40

nothing happened, no errors and lines not truncated

kirill.salykin15:10:41

I’d like to provide as much as possible, but don’t actually know what else I can tell

practicalli-johnny15:10:26

what modes are not truncating lines? do the lines truncate in those modes manually ? are you using horizontal splits in your windows? are you using master or develop? did you reboot after changing the config? did you try both forms of config suggested?

ag16:10:12

@kirill.salykin maybe try (add-hook 'prog-mode-hook 'spacemacs/toggle-visual-line-navigation-on)

kirill.salykin21:10:31

@U05254DQM sorry for delay: - clojure mode - yes, when manually toggle - it truncates - no, not horizontal, but vertical - develop - yes, I reboot - yes, both

kirill.salykin21:10:27

(add-hook 'prog-mode-hook 'spacemacs/toggle-truncate-lines-on)
worked for me thanks @U05254DQM and @U0G75ARHC

practicalli-johnny23:10:57

I've never needed to truncate lines / visual-line when writing Clojure, or any other programming language so apologies for not understanding what you were trying to do. Thanks @U0G75ARHC, that is how I would do it. I've only used it for org-mode, hence the example. I usually switching it off when creating wide tables in org-mode.

kirill.salykin06:10:57

No need to apologize. Thanks a lot for your help! And yeah, our code should be a bit shorter)

practicalli-johnny13:10:46

I tend to avoid longer lines in Clojure code as personally I find it easier to read Clojure that way. Spacemacs does a good job of auto-indenting, more so in vim insert mode though. And TAB is always handy for tweaking the indents on lines or regions.

kirill.salykin15:10:45

but sometimes 2 vertical windows side-by-side on 13" cant fit all…

kirill.salykin15:10:03

I agree with your points!

practicalli-johnny16:10:43

@kirill.salykin have you tried using golden ratio, SPC t g. it will automatically make the active buffer bigger relative to the other windows you have open. when you switch buffers then the new active buffer becomes bigger. For an example, see https://github.com/roman/golden-ratio.el Golden ratio is already part of Spacemacs, so nothing to install.

kirill.salykin05:10:29

That’s good one, thanks!