Browse Source

Updated clang format, whitespace, mark buffer save pos

master
macoymadson@gmail.com 4 years ago
parent
commit
f739b8e131
  1. 79
      ClangFormat/clang-format-gripp.txt
  2. 7
      ClangFormat/clang_format.vsSettings
  3. 11
      Emacs/keybinds.el
  4. 13
      Emacs/visual-early.el
  5. 1
      Emacs/visual-late.el

79
ClangFormat/clang-format-gripp.txt

@ -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

7
ClangFormat/clang_format.vsSettings

@ -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

11
Emacs/keybinds.el

@ -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)

13
Emacs/visual-early.el

@ -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
Emacs/visual-late.el

@ -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