config.phundrak.com/org/config/rustfmt.org
Lucien Cartier-Tilet a958ee8a60
Remove unused parts, updated my theme
== ALL FILES ==
The org TOCs were unused on export, and Spacemacs makes it useless.
This commits removes them. The startup header of org files is moved to
the header file.

== AWESOME ==
In the Awesome file, this commit removes everything about custom theme
creation as this part is not yet used. I also remade and reorganized
the windows titlebars.
Theme files for Awesome shall be added soon. The wallpaper functions
were updated accordingly.

In the autostart part, I updated some commands (picom will not launch
if another instance is already running, same for the XFCE polkit), and
I added PumoPM to the autolaunched software (power management). Due to
some issues, I also let Awesome one second before launching
`set-screens'.

== AWESOME AND CUSTOM SCRIPTS ==
This commit also removes any usage of pywal. My Awesome configuration
and my custom scripts were updated accordingly.

== CUSTOM SCRIPTS ==
In bin.org, the script `pape-restore' has been removed since it can
now be replaced with the command `nitrogen --restore'. `pape-update'
has also been updated so it doesn’t depend on `pape-restore' and gets
a random wallpaper for nitrogen to set without the help of pywal.

== XRESOURCES / ST AND PICOM ==
St’s transparency was tweaked to match my windows’ titlebar
transparency. It also got the Nord theme mentionned above. Some custom
Picom rule about St’s transparency has been removed.

== PICOM ==
I made it clearer in the index and on Picom’s page Picom is the new
Compton.

== FIREFOX ==
A new git submodule (blurredfox-nord) has been added, which adds some
transparency to Firefox as well as some Nord colors.

== I3 AND POLYBAR ==
My i3 and Polybar config have been deprecated since I do not use them
anymore.

== SPACEMACS ==
Changed shortcuts for config files
2020-08-22 16:46:33 +02:00

127 lines
3.2 KiB
Org Mode
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#+TITLE: Rust format config
#+setupfile: headers
#+OPTIONS: auto-id:t
#+HTML_HEAD_EXTRA: <meta name="description" content="Phundrak's Rust format config" />
#+HTML_HEAD_EXTRA: <meta property="og:title" content="Phundrak's Rust format config" />
#+HTML_HEAD_EXTRA: <meta property="og:description" content="Description of the Rust format config file of Phundrak" />
#+PROPERTY: header-args:toml :tangle ~/.rustfmt.toml
* Introduction
:PROPERTIES:
:CUSTOM_ID: Introduction-465e99fe
:END:
The ~.rustfmt.toml~ file located in the ~$HOME~ directory is a global
configuration file for Rusts code formatters, such as ~rustfmt~. In this
file, you can find how my Rust code is always formatted.
* General settings
:PROPERTIES:
:CUSTOM_ID: General_settings-7f5cb2f6
:END:
First, we are using the 2018 edition of Rust.
#+BEGIN_SRC toml
edition = "2018"
#+END_SRC
Put single-expression functions on a single line.
#+BEGIN_SRC toml
fn_single_line = true
#+END_SRC
Format string literals where necessary.
#+BEGIN_SRC toml
format_strings = true
#+END_SRC
Maximum width of each line
#+BEGIN_SRC toml
max_width = 80
#+END_SRC
Merge multiple imports into a single nested import.
#+BEGIN_SRC toml
merge_imports = true
#+END_SRC
* Structs and Enums
:PROPERTIES:
:CUSTOM_ID: Structs_and_Enums-6a2a856d
:END:
The maximum length of enum variant having discriminant, that gets vertically
aligned with others. Variants without discriminants would be ignored for the
purpose of alignment.
Note that this is not how much whitespace is inserted, but instead the longest
variant name that doesn't get ignored when aligning.
#+BEGIN_SRC toml
enum_discrim_align_threshold = 20
#+END_SRC
The maximum diff of width between struct fields to be aligned with each other.
#+BEGIN_SRC toml
struct_field_align_threshold = 20
#+END_SRC
Reorder impl items. ~type~ and ~const~ are put first, then macros and methods.
#+BEGIN_SRC toml
reorder_impl_items = true
#+END_SRC
* Comments
:PROPERTIES:
:CUSTOM_ID: Comments-b1904bb0
:END:
Convert ~/* */~ comments to ~//~ comments where possible.
#+BEGIN_SRC toml
normalize_comments = true
#+END_SRC
Break comments to fit on the line.
#+BEGIN_SRC toml
wrap_comments = true
#+END_SRC
Report ~FIXME~ items in comments.
#+BEGIN_SRC toml
report_fixme = "Always"
#+END_SRC
Report ~TODO~ items in comments.
#+BEGIN_SRC toml
todo = "Always"
#+END_SRC
* Documentation
:PROPERTIES:
:CUSTOM_ID: Documentation-0c7981c7
:END:
Format code snippet included in doc comments.
#+BEGIN_SRC toml
format_code_in_doc_comments = true
#+END_SRC
Convert ~#![doc]~ and ~#[doc]~ attributes to ~//!~ and ~///~ doc comments.
#+BEGIN_SRC toml
normalize_doc_attributes = true
#+END_SRC
* Whitespace
:PROPERTIES:
:CUSTOM_ID: Whitespace-e8792b44
:END:
Use tab characters for indentation, spaces for alignment.
#+BEGIN_SRC toml
hard_tabs = false
#+END_SRC
Number of spaces per tab.
#+BEGIN_SRC toml
tab_spaces = 4
#+END_SRC
I want newlines to always be Unix style.
#+BEGIN_SRC toml
newline_style = "Unix"
#+END_SRC