Browse Source

emacs config stuff

master
Taylor Bockman 4 years ago
parent
commit
f46d5370be
  1. 9
      dotfiles/bash/scripts/cgen.sh
  2. 19
      dotfiles/bash/scripts/cgen_etc/clang_format_template
  3. 11
      dotfiles/emacs.d/init.el

9
dotfiles/bash/scripts/cgen.sh

@ -27,8 +27,8 @@ fi
if [ -z $c_standard ]
then
echo "No C Standard supplied...defaulting to 99"
c_standard="99"
echo "No C Standard supplied...defaulting to 11"
c_standard="11"
fi
mkdir $name
@ -51,8 +51,7 @@ echo "set(CMAKE_RUNTIME_OUTPUT_DIRECTORY \${CMAKE_BINARY_DIR}/bin)" >> $cmake_co
echo "" >> $cmake_config
echo "" >> $cmake_config
echo "# The following lines enable compile_commands.json and dump it in the root of the project" >> $cmake_config
echo "# in order to allow YouCompleteMe to provide completion. You can delete these lines if your" >> $cmake_config
echo "# editor does not need/use \`compile_commands.json\`" >> $cmake_config
echo "# This is needed for clangd and lsp to work" >> $cmake_config
echo "" >> $cmake_config
echo "set(CMAKE_EXPORT_COMPILE_COMMANDS ON)" >> $cmake_config
echo "" >> $cmake_config
@ -62,7 +61,7 @@ echo " \${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json
echo " \${CMAKE_CURRENT_SOURCE_DIR}/compile_commands.json" >> $cmake_config
echo " )" >> $cmake_config
echo "endif()" >> $cmake_config
echo "#-------- END YOUCOMPLETEME SECTION --------#" >> $cmake_config
echo "#-------- END COMPILE_COMMANDS.JSON SECTION --------#" >> $cmake_config
echo "" >> $cmake_config
echo "" >> $cmake_config
echo "file(GLOB SOURCE \${PROJECT_SOURCE_DIR}/src/*.c)" >> $cmake_config

19
dotfiles/bash/scripts/cgen_etc/clang_format_template

@ -1,13 +1,16 @@
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: 'true'
AlignConsecutiveAssignments: 'true'
AlignConsecutiveDeclarations: 'true'
AlignTrailingComments: 'true'
AllowShortBlocksOnASingleLine: 'false'
AllowShortCaseLabelsOnASingleLine: 'false'
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: 'false'
BreakBeforeBraces: Allman
ColumnLimit: '120'
IndentCaseLabels: 'true'
IndentWidth: '4'
Language: Cpp
PointerAlignment: Right
SortIncludes: 'false'
SortIncludes: 'true'
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: 'true'
SpaceInEmptyParentheses: 'false'
UseTab: Never
ColumnLimit: 80

11
dotfiles/emacs.d/init.el

@ -204,14 +204,15 @@ There are two things you can do about this warning:
;; LSP
(use-package lsp-mode
:ensure t
:hook (python-mode . lsp-deferred)
:commands (lsp lsp-deferred))
:ensure t
:hook ((python-mode . lsp-deferred)
(c-mode . lsp-deferred))
:commands (lsp lsp-deferred))
(use-package lsp-ui
:ensure t
:hook (lsp-mode . lsp-ui-mode))
:ensure t
:hook (lsp-mode . lsp-ui-mode))
;;;;; PYTHON ;;;;;;;;;;;;;;;;;;

Loading…
Cancel
Save