From 6d8d7cddc1fca555336426a52abfbf52a0eed5a7 Mon Sep 17 00:00:00 2001 From: Stochastica Date: Tue, 26 Jan 2021 23:33:12 -0500 Subject: [PATCH] Fix config problems; Add spacemacs transparency --- bin/latex-runtime.sh | 2 +- home/clang-format | 62 +++++++++++++++++++++++++ home/fish/config.fish | 15 ------ home/spacemacs | 105 +++++++++++++++++++++++++++++++----------- symlinks.sh | 9 ++-- 5 files changed, 146 insertions(+), 47 deletions(-) create mode 100644 home/clang-format diff --git a/bin/latex-runtime.sh b/bin/latex-runtime.sh index 8580aeb..acec6ef 100755 --- a/bin/latex-runtime.sh +++ b/bin/latex-runtime.sh @@ -2,7 +2,7 @@ docker run --rm -it \ --volume "$PWD:/data" \ - --volume "$HOME/.latexmkrc:/data/ro" \ + --volume "$HOME/.latexmkrc:/data/.latexmkrc:ro" \ --volume "$HOME/texmf:/root/texmf" \ --workdir "/data" \ --entrypoint=$1 \ diff --git a/home/clang-format b/home/clang-format new file mode 100644 index 0000000..110cd32 --- /dev/null +++ b/home/clang-format @@ -0,0 +1,62 @@ +--- +BasedOnStyle: Mozilla +AccessModifierOffset: '-2' +AlignAfterOpenBracket: Align +AlignConsecutiveAssignments: 'true' +AlignConsecutiveDeclarations: 'true' +AlignEscapedNewlinesLeft: 'false' +AlignOperands: 'true' +AlignTrailingComments: 'true' +AllowAllParametersOfDeclarationOnNextLine: 'true' +AllowShortBlocksOnASingleLine: Empty +AllowShortCaseLabelsOnASingleLine: 'true' +AllowShortFunctionsOnASingleLine: All +AllowShortIfStatementsOnASingleLine: 'false' +AllowShortLoopsOnASingleLine: 'false' +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +AlwaysBreakTemplateDeclarations: 'true' +BreakBeforeBinaryOperators: All +BreakBeforeBraces: Allman +BreakBeforeTernaryOperators: 'true' +BreakConstructorInitializersBeforeComma: 'true' +BreakStringLiterals: 'true' +ColumnLimit: '80' +ConstructorInitializerAllOnOneLineOrOnePerLine: 'true' +ConstructorInitializerIndentWidth: '0' +ContinuationIndentWidth: '2' +Cpp11BracedListStyle: 'false' +DerivePointerAlignment: 'false' +DisableFormat: 'false' +ExperimentalAutoDetectBinPacking: 'true' +IncludeBlocks: Preserve +IndentCaseLabels: 'false' +IndentGotoLabels: 'false' +IndentWidth: '2' +IndentWrappedFunctionNames: 'false' +JavaScriptQuotes: Single +KeepEmptyLinesAtTheStartOfBlocks: 'false' +Language: Cpp +MaxEmptyLinesToKeep: '2' +NamespaceIndentation: Inner +ObjCBlockIndentWidth: '2' +ObjCSpaceAfterProperty: 'false' +ObjCSpaceBeforeProtocolList: 'false' +PointerAlignment: Left +ReflowComments: 'true' +SortIncludes: 'false' +SpaceAfterCStyleCast: 'true' +SpaceAfterLogicalNot: 'false' +SpaceBeforeAssignmentOperators: 'true' +SpaceBeforeParens: ControlStatements +SpaceInEmptyParentheses: 'false' +SpacesBeforeTrailingComments: '2' +SpacesInAngles: 'false' +SpacesInCStyleCastParentheses: 'false' +SpacesInContainerLiterals: 'false' +SpacesInParentheses: 'false' +SpacesInSquareBrackets: 'false' +Standard: Cpp11 +TabWidth: '2' +UseTab: ForIndentation +... diff --git a/home/fish/config.fish b/home/fish/config.fish index 4681895..e3c49ec 100755 --- a/home/fish/config.fish +++ b/home/fish/config.fish @@ -6,18 +6,3 @@ alias ubisunt='grep . -rnw -e' set -x GIT_EDITOR vim set -x LANG en_US.UTF-8 - -function latexmk --argument-names 'path' - if test -n "$path" - set abspath (realpath $argv[1]) - else - set abspath $PWD - end - docker run --rm -it \ - --volume "$HOME/.latexmkrc:/root/.latexmkrc:ro" \ - --volume "$abspath:/data" \ - --workdir "/data" \ - --entrypoint latexmk \ - latex \ - $argv -end diff --git a/home/spacemacs b/home/spacemacs index 7415faf..880b64a 100644 --- a/home/spacemacs +++ b/home/spacemacs @@ -64,22 +64,28 @@ This function should only modify configuration layer settings." emacs-lisp bibtex (latex :variables - latex-enable-folding t - latex-enable-auto-fill t - latex-enable-magic t) + latex-enable-folding t + latex-enable-auto-fill t + latex-enable-magic t) markdown yaml shell-scripts (python :variables - python-shell-interpreter "/home/hsv/common/scr/python.sh" - python-shell-interpreter-args "-m IPython --simple-prompt -i") + python-shell-interpreter "/home/hsv/common/scr/python.sh" + python-shell-interpreter-args "-m IPython --simple-prompt -i") (ocaml :variables - ocaml-format-on-save t) + ocaml-format-on-save t) (c-c++ :variables - c-c++-adopt-subprojects t - c-c++-backend 'lsp-clangd - c-c++-lsp-enable-semantic-highlight 'rainbow) + c-c++-adopt-subprojects t + c-c++-default-mode-for-headers 'c++-mode + c-c++-enable-clang-support t + c-c++-backend 'lsp-clangd + c-c++-enable-clang-format-on-save t + clang-format-style "file" + c-c++-lsp-enable-semantic-highlight 'rainbow) + (cmake :variables + cmake-backend 'lsp) javascript typescript html @@ -96,6 +102,10 @@ This function should only modify configuration layer settings." ;; Also include the dependencies as they will not be resolved automatically. dotspacemacs-additional-packages '( + all-the-icons + centaur-tabs + company-statistics + highlight-doxygen smart-tabs-mode tablist ) @@ -388,7 +398,7 @@ It should only modify the values of Spacemacs settings." ;; A value from the range (0..100), in increasing opacity, which describes ;; the transparency level of a frame when it's inactive or deselected. ;; Transparency can be toggled through `toggle-transparency'. (default 90) - dotspacemacs-inactive-transparency 90 + dotspacemacs-inactive-transparency 80 ;; If non-nil show the titles of transient states. (default t) dotspacemacs-show-transient-state-title t @@ -538,8 +548,17 @@ This function is called immediately after `dotspacemacs/init', before layer configuration. It is mostly for variables that should be set before packages are loaded. If you are unsure, try setting them in `dotspacemacs/user-config' first." - (add-to-list 'TeX-view-program-selection '(output-pdf "Emacs")) - (add-to-list 'TeX-view-program-list '("Emacs" "emacsclient -n %o")) + + ;; Centaur + (setq + centaur-tabs-set-icons t + centaur-tabs-set-bar 'over + centaur-tabs-set-close-button t + centaur-tabs-style "wave" + centaur-tabs-set-bar 'under + centaur-tabs-set-modified-marker t + centaur-tabs-modified-marker "*" + centaur-tabs-cycle-scope 'tabs) ) (defun dotspacemacs/user-load () @@ -547,8 +566,9 @@ If you are unsure, try setting them in `dotspacemacs/user-config' first." This function is called only while dumping Spacemacs configuration. You can `require' or `load' the libraries of your choice that will be included in the dump." - (setq pdf-sync-backward-display-action t) - (setq pdf-sync-forward-display-action t) + (setq + pdf-sync-backward-display-action t + pdf-sync-forward-display-action t) ) (defun dotspacemacs/user-config () @@ -559,20 +579,20 @@ Put your configuration code here, except for variables that should be set before packages are loaded." ;; Key Bindings - (global-set-key (kbd "") 'centaur-tabs-forward) - (global-set-key (kbd "") 'centaur-tabs-backward) + (global-set-key (kbd "") 'centaur-tabs-forward) + (global-set-key (kbd "") 'centaur-tabs-backward) (evil-ex-define-cmd "q" 'kill-this-buffer) (evil-ex-define-cmd "quit" 'evil-quit) ;; Displaying whitespaces (spacemacs/toggle-whitespace-globally-on) (setq whitespace-display-mappings - ;; all numbers are Unicode codepoint in decimal. ⁖ (insert-char 182 1) - '( - (space-mark 32 [183] [46]) ; 32 SPACE 「 」, 183 MIDDLE DOT 「·」, 46 FULL STOP 「.」 - (newline-mark 10 [172 10]) ; 10 LINE FEED, 172 Not Sign「¬」 - (tab-mark 9 [10141 9] [92 9]) ; 9 TAB, 10141 Triangle-headed rightwards arrow 「➝」 - )) + ;; all numbers are Unicode codepoint in decimal. ⁖ (insert-char 182 1) + '( + (space-mark 32 [183] [46]) ; 32 SPACE 「 」, 183 MIDDLE DOT 「·」, 46 FULL STOP 「.」 + (newline-mark 10 [172 10]) ; 10 LINE FEED, 172 Not Sign「¬」 + (tab-mark 9 [10141 9] [92 9]) ; 9 TAB, 10141 Triangle-headed rightwards arrow 「➝」 + )) (set-face-attribute 'whitespace-space nil :background nil @@ -586,7 +606,21 @@ before packages are loaded." (set-face-attribute 'whitespace-newline nil :background nil :foreground "gray30") - (spacemacs/toggle-transparency) + (set-face-attribute 'whitespace-line nil + :background "gray20" + :foreground nil) + ;; Disabling this since we use smart indenting + (set-face-attribute 'whitespace-indentation nil + :background nil + :foreground "gray30") + ;; Syntax highlighting + (set-face-attribute 'font-lock-type-face nil + :foreground "#55fe55") + (set-face-attribute 'font-lock-constant-face nil + :foreground "#ecbd3d") + + ;(add-hook 'after-make-frame-functions 'spacemacs/enable-transparency) + (spacemacs/enable-transparency) ;; Auto save upon defocus (add-hook 'focus-out-hook @@ -599,11 +633,28 @@ before packages are loaded." (setq evil-indent-convert-tabs nil) (setq-default indent-tabs-mode t) (setq-default tab-width 2) - (setq c-default-style "stroustrup") - (setq c-basic-offset 2) + (setq + c-default-style "stroustrup" + c-basic-offset 2) (setq css-indent-offset 2) - (smart-tabs-insinuate 'c 'c++ 'java 'javascript) + (smart-tabs-insinuate + 'c + 'c++ + 'java + 'javascript) + (add-hook 'after-init-hook #'company-statistics-mode) + (add-hook 'text-mode-hook #'origami-mode) (add-hook 'prog-mode-hook #'origami-mode) + (add-hook 'text-mode-hook #'display-fill-column-indicator-mode) + (add-hook 'prog-mode-hook #'display-fill-column-indicator-mode) + (add-hook 'LaTeX-mode-hook + (lambda () + (setq indent-tabs-mode t))) + + (highlight-doxygen-global-mode 1) + (set-face-attribute 'highlight-doxygen-comment nil + :background nil + :slant 'italic) ) ;; Do not write anything past this comment. This is where Emacs will @@ -621,7 +672,7 @@ This function is called at the very end of Spacemacs initialization." '(evil-want-Y-yank-to-eol nil) '(helm-completion-style 'emacs) '(package-selected-packages - '(unicode-fonts ucs-utils font-utils persistent-soft pcache git-gutter-fringe+ fringe-helper git-gutter+ dockerfile-mode docker docker-tramp browse-at-remote xterm-color vterm terminal-here smart-tabs-mode shell-pop multi-term eshell-z eshell-prompt-extras esh-help company-web web-completion-data centaur-tabs yaml-mode yasnippet-snippets lsp-ui lsp-python-ms lsp-pyright lsp-origami origami lsp-latex helm-lsp helm-company helm-c-yasnippet fuzzy flycheck-ycmd flycheck-rtags flycheck-pos-tip pos-tip flycheck-ocaml dap-mode lsp-treemacs bui treemacs cfrs pfuture posframe company-ycmd company-rtags company-reftex company-math company-c-headers company-auctex company-anaconda ccls lsp-mode ht dash-functional auto-yasnippet yasnippet ac-ispell auto-complete neotree insert-shebang helm-gtags ggtags flycheck-bashate fish-mode counsel-gtags counsel swiper company-shell company ycmd request-deferred yapfify sphinx-doc pytest pyenv-mode py-isort poetry pippel pipenv pyvenv pip-requirements org-ref pdf-tools key-chord ivy htmlize tablist mmm-mode math-symbol-lists markdown-toc live-py-mode importmagic epc ctable concurrent deferred helm-rtags rtags helm-pydoc helm-bibtex bibtex-completion biblio parsebib biblio-core google-c-style gh-md disaster cython-mode cpp-auto-include blacken auctex anaconda-mode pythonic utop tuareg caml treemacs-magit smeargle ocp-indent ocamlformat merlin-eldoc merlin magit-svn magit-section magit-gitflow magit-popup helm-gitignore helm-git-grep gitignore-templates gitignore-mode gitconfig-mode gitattributes-mode git-timemachine git-messenger git-link forge markdown-mode ghub closql emacsql-sqlite emacsql treepy evil-magit magit git-commit with-editor transient dune ws-butler writeroom-mode winum which-key volatile-highlights vi-tilde-fringe uuidgen use-package undo-tree treemacs-projectile treemacs-persp treemacs-icons-dired treemacs-evil toc-org symon symbol-overlay string-inflection spaceline-all-the-icons restart-emacs request rainbow-delimiters popwin pcre2el password-generator paradox overseer org-superstar open-junk-file nameless move-text macrostep lorem-ipsum link-hint indent-guide hybrid-mode hungry-delete hl-todo highlight-parentheses highlight-numbers highlight-indentation helm-xref helm-themes helm-swoop helm-purpose helm-projectile helm-org helm-mode-manager helm-make helm-ls-git helm-flx helm-descbinds helm-ag google-translate golden-ratio font-lock+ flycheck-package flycheck-elsa flx-ido fancy-battery eyebrowse expand-region evil-visualstar evil-visual-mark-mode evil-unimpaired evil-tutor evil-textobj-line evil-surround evil-numbers evil-nerd-commenter evil-mc evil-matchit evil-lisp-state evil-lion evil-indent-plus evil-iedit-state evil-goggles evil-exchange evil-escape evil-ediff evil-easymotion evil-cleverparens evil-args evil-anzu eval-sexp-fu emr elisp-slime-nav editorconfig dumb-jump dotenv-mode dired-quick-sort diminish devdocs define-word column-enforce-mode clean-aindent-mode centered-cursor-mode auto-highlight-symbol auto-compile aggressive-indent ace-link ace-jump-helm-line)) +'(magic-latex-buffer unicode-fonts ucs-utils font-utils persistent-soft pcache git-gutter-fringe+ fringe-helper git-gutter+ dockerfile-mode docker docker-tramp browse-at-remote xterm-color vterm terminal-here smart-tabs-mode shell-pop multi-term eshell-z eshell-prompt-extras esh-help company-web web-completion-data centaur-tabs yaml-mode yasnippet-snippets lsp-ui lsp-python-ms lsp-pyright lsp-origami origami lsp-latex helm-lsp helm-company helm-c-yasnippet fuzzy flycheck-ycmd flycheck-rtags flycheck-pos-tip pos-tip flycheck-ocaml dap-mode lsp-treemacs bui treemacs cfrs pfuture posframe company-ycmd company-rtags company-reftex company-math company-c-headers company-auctex company-anaconda ccls lsp-mode ht dash-functional auto-yasnippet yasnippet ac-ispell auto-complete neotree insert-shebang helm-gtags ggtags flycheck-bashate fish-mode counsel-gtags counsel swiper company-shell company ycmd request-deferred yapfify sphinx-doc pytest pyenv-mode py-isort poetry pippel pipenv pyvenv pip-requirements org-ref pdf-tools key-chord ivy htmlize tablist mmm-mode math-symbol-lists markdown-toc live-py-mode importmagic epc ctable concurrent deferred helm-rtags rtags helm-pydoc helm-bibtex bibtex-completion biblio parsebib biblio-core google-c-style gh-md disaster cython-mode cpp-auto-include blacken auctex anaconda-mode pythonic utop tuareg caml treemacs-magit smeargle ocp-indent ocamlformat merlin-eldoc merlin magit-svn magit-section magit-gitflow magit-popup helm-gitignore helm-git-grep gitignore-templates gitignore-mode gitconfig-mode gitattributes-mode git-timemachine git-messenger git-link forge markdown-mode ghub closql emacsql-sqlite emacsql treepy evil-magit magit git-commit with-editor transient dune ws-butler writeroom-mode winum which-key volatile-highlights vi-tilde-fringe uuidgen use-package undo-tree treemacs-projectile treemacs-persp treemacs-icons-dired treemacs-evil toc-org symon symbol-overlay string-inflection spaceline-all-the-icons restart-emacs request rainbow-delimiters popwin pcre2el password-generator paradox overseer org-superstar open-junk-file nameless move-text macrostep lorem-ipsum link-hint indent-guide hybrid-mode hungry-delete hl-todo highlight-parentheses highlight-numbers highlight-indentation helm-xref helm-themes helm-swoop helm-purpose helm-projectile helm-org helm-mode-manager helm-make helm-ls-git helm-flx helm-descbinds helm-ag google-translate golden-ratio font-lock+ flycheck-package flycheck-elsa flx-ido fancy-battery eyebrowse expand-region evil-visualstar evil-visual-mark-mode evil-unimpaired evil-tutor evil-textobj-line evil-surround evil-numbers evil-nerd-commenter evil-mc evil-matchit evil-lisp-state evil-lion evil-indent-plus evil-iedit-state evil-goggles evil-exchange evil-escape evil-ediff evil-easymotion evil-cleverparens evil-args evil-anzu eval-sexp-fu emr elisp-slime-nav editorconfig dumb-jump dotenv-mode dired-quick-sort diminish devdocs define-word column-enforce-mode clean-aindent-mode centered-cursor-mode auto-highlight-symbol auto-compile aggressive-indent ace-link ace-jump-helm-line)) '(whitespace-style '(face trailing tabs spaces lines newline empty indentation space-after-tab space-before-tab space-mark tab-mark newline-mark))) (custom-set-faces diff --git a/symlinks.sh b/symlinks.sh index 65d0f92..f46fa58 100755 --- a/symlinks.sh +++ b/symlinks.sh @@ -4,10 +4,11 @@ DIR=$HOME BASE=$(realpath --relative-to=$DIR $PWD) pushd $HOME >> /dev/null -ln -vs $BASE/home/vimrc .vimrc -ln -vs $BASE/home/bashrc .bashrc -ln -vs $BASE/home/latexmkrc .latexmkrc -ln -vs $BASE/home/spacemacs .spacemacs +ln -vs $BASE/home/bashrc .bashrc +ln -vs $BASE/home/clang-format .clang-format +ln -vs $BASE/home/latexmkrc .latexmkrc +ln -vs $BASE/home/spacemacs .spacemacs +ln -vs $BASE/home/vimrc .vimrc popd >> /dev/null # Create ftplugin links