Browse Source

Updated clang format, whitespace, mark buffer save pos

master
Macoy Madson 2 years ago
parent
commit
f739b8e131
5 changed files with 103 additions and 8 deletions
  1. +79
    -0
      ClangFormat/clang-format-gripp.txt
  2. +6
    -1
      ClangFormat/clang_format.vsSettings
  3. +10
    -1
      Emacs/keybinds.el
  4. +7
    -6
      Emacs/visual-early.el
  5. +1
    -0
      Emacs/visual-late.el

+ 79
- 0
ClangFormat/clang-format-gripp.txt View File

@ -0,0 +1,79 @@
# http://releases.llvm.org/6.0.0/tools/clang/docs/ClangFormatStyleOptions.html
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: Left
AlignOperands: false
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortFunctionsOnASingleLine: InlineOnly
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: false
AfterStruct: true
AfterUnion: true
AfterExternBlock: false
BeforeCatch: true
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: false
BreakConstructorInitializers: BeforeComma
ColumnLimit: 115
CommentPragmas: ''
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 0
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DerivePointerBinding: false
FixNamespaceComments: true
IndentCaseLabels: true
IndentFunctionDeclarationAfterType: false
IndentWidth: 4
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 0
PenaltyBreakComment: 100
PenaltyBreakFirstLessLess: 0
PenaltyBreakString: 100
PenaltyExcessCharacter: 6
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
ReflowComments: false
SortIncludes: false
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
#SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 4
UseTab: Always

+ 6
- 1
ClangFormat/clang_format.vsSettings View File

@ -1,3 +1,4 @@
# http://releases.llvm.org/6.0.0/tools/clang/docs/ClangFormatStyleOptions.html
BasedOnStyle: Google
AccessModifierOffset: -4
AllowShortBlocksOnASingleLine: false
@ -5,6 +6,8 @@ AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
BreakBeforeBraces: Allman
BraceWrapping:
AfterNamespace: false
BreakBeforeTernaryOperators: false
ColumnLimit: 100
ConstructorInitializerIndentWidth: 4
@ -14,4 +17,6 @@ Standard: Cpp11
TabWidth: 4
UseTab: ForIndentation
DerivePointerAlignment: false
PointerAlignment: Left
PointerAlignment: Left
NamespaceIndentation: None
IndentCaseLabels: true

+ 10
- 1
Emacs/keybinds.el View File

@ -50,8 +50,17 @@
;; Close. was kill-region
(global-set-key (kbd "C-w") 'kill-buffer)
(defun macoy-mark-whole-buffer ()
"Save a register with start position in case the user wants to go back to where they were before
they marked the buffer"
(interactive)
;; From Macoy's navigation.el
(macoy-save-place)
(call-interactively 'mark-whole-buffer)
)
;; Select All. was move-beginning-of-line
(global-set-key (kbd "C-a") 'mark-whole-buffer)
(global-set-key (kbd "C-a") 'macoy-mark-whole-buffer)
;; Open. was open-line
(global-set-key (kbd "C-o") 'ido-find-file)


+ 7
- 6
Emacs/visual-early.el View File

@ -104,12 +104,13 @@
(global-set-key (kbd "C-<f9>") 'macoy-toggle-wrapping)
;; Show whitespace
;; Not enabled globally because it looks a bit too ugly for my tastes; I can toggle it when needed
;;(require 'whitespace)
;;(global-whitespace-mode 0)
(setq whitespace-style '(faces tabs tabs-mark spaces space-mark))
(setq whitespace-line-column 100)
(setq whitespace-newline nil)
(when (require 'whitespace)
;; Not enabled globally because it looks a bit too ugly for my tastes; I can toggle it when needed
;;(global-whitespace-mode 0)
(setq whitespace-style '(tab-mark space-mark))
(setq whitespace-line-column 100)
(setq whitespace-newline nil)
)
(defun macoy-toggle-whitespace-mode ()
(interactive)


+ 1
- 0
Emacs/visual-late.el View File

@ -17,6 +17,7 @@
;; but still more subdued than regular text (and regular fringe foreground)
;; See base16-theme.el for faces and colors and stuff
(set-face-foreground 'fringe (face-foreground 'font-lock-comment-face))
;; (set-face-foreground 'fringe (face-foreground 'font-lock-comment-delimiter-face)) ;; for extra subdued
;; Make fringe same color as background. We still want fringe for wrap indicators
;; If you change your theme you should run this code again


Loading…
Cancel
Save