diff --git a/adamformat/adam.format.cfg b/adamformat/adam.format.cfg index b8ccbfb..fa689aa 100644 --- a/adamformat/adam.format.cfg +++ b/adamformat/adam.format.cfg @@ -26,8 +26,8 @@ indent_relative_single_line_comments=true indent_col1_comment=true indent_access_spec_body=true indent_paren_nl=false -indent_comma_paren=false -indent_bool_paren=false +indent_comma_paren=0 +indent_bool_paren=0 indent_first_bool_expr=false indent_square_nl=false indent_preserve_sql=false @@ -47,7 +47,7 @@ align_on_operator=false align_mix_var_proto=false align_single_line_func=false align_single_line_brace=false -align_nl_cont=false +align_nl_cont=0 align_left_shift=true align_oc_decl_colon=false nl_collapse_empty_body=true @@ -81,7 +81,7 @@ ls_func_split_full=false nl_after_multiline_comment=false eat_blanks_after_open_brace=true eat_blanks_before_close_brace=true -mod_full_brace_if_chain=false +mod_full_brace_if_chain=0 mod_pawn_semicolon=false mod_full_paren_if_bool=false mod_remove_extra_semicolon=false diff --git a/ssh/.gitignore b/ssh/.gitignore new file mode 100644 index 0000000..98b4fd5 --- /dev/null +++ b/ssh/.gitignore @@ -0,0 +1 @@ +ssh-search-domains diff --git a/ssh/epilogue b/ssh/epilogue new file mode 100644 index 0000000..d630445 --- /dev/null +++ b/ssh/epilogue @@ -0,0 +1,8 @@ +Host gitea gitea.* github.com gitlab.com *.github.com *.gitlab.com + User git + + +Host * + IdentityFile ~/.ssh/id_%L${CSHENV_MACHINE_SUFFIX}-%h + +# vim: ft=sshconfig diff --git a/ssh/gen-search.sh b/ssh/gen-search.sh new file mode 100755 index 0000000..a65b93f --- /dev/null +++ b/ssh/gen-search.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +rm -f ~/.ssh/search + +if [ -e ${CSHENV_DIR}/ssh/ssh-search-domains ] +then + domains=`grep "^search" /etc/resolv.conf | cut -c 8- - | cat - ${CSHENV_DIR}/ssh/ssh-search-domains | xargs` +else + domains=`grep "^search" /etc/resolv.conf | cut -c 8- - | xargs` +fi + +if [ -z "${domains}" ] ; then exit 1; fi + +printf "Host *\n\tCanonicalDomains ${domains}\n\tCanonicalizeHostname yes\n# v" > ~/.ssh/search +printf "im:ft=sshconfig" >> ~/.ssh/search + +exit 0 + + # vim: ft=bash diff --git a/ssh/prologue b/ssh/prologue new file mode 100644 index 0000000..0dac0ad --- /dev/null +++ b/ssh/prologue @@ -0,0 +1,9 @@ +# This scans your resolver and then custom-creates a config file +# for your current resolver situation. +# +# That config uses Canonicalization to emulate what your local resolver +# does in these circumstances. +Match exec "~/cshenv/ssh/gen-search.sh" + Include ~/.ssh/search + +# vim: ft=sshconfig diff --git a/startup_hooks/install.sh b/startup_hooks/install.sh index 2867e6a..d5e8fa5 100755 --- a/startup_hooks/install.sh +++ b/startup_hooks/install.sh @@ -3,7 +3,17 @@ # Yeah, my CSHENV Install script is written in Bourne shell. This is because # CSH isn't a great scripting language, but it is a nice interactive shell. -export CSHENV_LOCATION="~/cshenv" +export REALPATH=`realpath $0` +export INSTALLER_LOCATION=`dirname ${REALPATH}` +export CSHENV_LOCATION=`dirname ${INSTALLER_LOCATION}` +export RELATIVE_CSHENV_LOCATION=`realpath --relative-to=${HOME} ${CSHENV_LOCATION}` + +if [ -v CSHENV_DEBUG_INSTALLER ] +then + echo $CSHENV_LOCATION + echo $RELATIVE_CSHENV_LOCATION + exit +fi echo "Checking for ~/.login" if [ ! -e ~/.login ] @@ -36,8 +46,10 @@ then fi echo "Installing vim setup" -ln -s `echo ${CSHENV_LOCATION}`/vim ~/.vim -ln -s ~/.vim/vimrc ~/.vimrc +pushd ~ >& /dev/null +ln -s `echo ${RELATIVE_CSHENV_LOCATION}`/vim .vim +ln -s .vim/vimrc .vimrc +popd >& /dev/null if [ -e ~/.gitconfig ] then @@ -60,3 +72,6 @@ echo " signingKey = \"`hostname` Git\"" >> ~/.gitconfig echo "" >> ~/.gitconfig echo "[commit]" >> ~/.gitconfig echo " gpgSign = true" >> ~/.gitconfig + +echo "Do not forget to add the following line at the top of your ssh config:" +echo "Include ${CSHENV_LOCATION}/ssh/config" diff --git a/tcshrc b/tcshrc index 9be9074..457b67e 100644 --- a/tcshrc +++ b/tcshrc @@ -9,6 +9,8 @@ endif set path=( ${CSHENV_DIR}/bin ${path} ) +setenv CSHENV_MACHINE_SUFFIX + # Figure out what kind of tcsh we are running. if( $?tcsh ) then diff --git a/tcshrc.prompt.final b/tcshrc.prompt.final index da6b5c9..8191a6b 100644 --- a/tcshrc.prompt.final +++ b/tcshrc.prompt.final @@ -150,6 +150,7 @@ endif if( $?CSHENV_DEBUG ) echo "Dynamic color loading processed..." + if( ${prompt_hcolor} != 0 ) then set last_color = ${reference_colors[${prompt_hcolor}]} endif @@ -167,7 +168,6 @@ set medium_battery_level = 50 set strong_battery_level = 75 - while( ${prompt_hcolor} == 0 ) if( $?CSHENV_DEBUG ) then echo colorshuffle @@ -243,9 +243,9 @@ if( $?CSHENV_SHOW_BATTERY_LEVEL ) then else if( ${battery_level} < ${low_battery_level} ) then set battery_color=${red} else if( ${battery_level} < ${weak_battery_level} ) then - set battery_color=${yellow} + set battery_color=${csi}33m else if( ${battery_level} < ${medium_battery_level} ) then - set battery_color=${bright_yellow} + set battery_color=${csi}93m else if( ${battery_level} < ${strong_battery_level} ) then set battery_color=${green} else @@ -342,6 +342,7 @@ if( ! $?CSHENV_DISABLE_PROMPT_NESTING ) then endif endif endif + if( ! $?CSHENV_DISABLE_PROMPT_USER ) then set user_prompt_view="${user_color_seq}${user_prompt}%{${sgr_reset}%}" if( ! $?CSHENV_DISABLE_PROMPT_HOST ) then @@ -355,6 +356,7 @@ if( ! $?CSHENV_DISABLE_PROMPT_HOST ) then endif set host_prompt_view="${host_color_seq}${host_prompt}%{${text_color_seq}%}${host_prompt_tail}" endif + if( ! $?CSHENV_DISABLE_PROMPT_GIT ) then set git_prompt_view="${git_prompt}" endif @@ -362,7 +364,8 @@ if( ! $?CSHENV_DISABLE_PROMPT_PATH ) then set path_prompt_view="%{${path_color_seq}%}${path_prompt}%{${sgr_reset}%}" endif if( ! $?CSHENV_DISABLE_PROMPT_DIRS ) then - set dirs_prompt=`dirs -v | wc -l` + set dir_list=`dirs` + set dirs_prompt="${#dir_list}" if( ${dirs_prompt} > 1 ) then set dirs_prompt_view=" {%{${dirs_color_seq}%}${dirs_prompt}%{${sgr_reset}%}}" endif diff --git a/vim/after/syntax/cpp.vim b/vim/after/syntax/cpp.vim index 8122074..8eb95e2 100644 --- a/vim/after/syntax/cpp.vim +++ b/vim/after/syntax/cpp.vim @@ -38,6 +38,8 @@ syn match cxxCriticalNames "\" syn match cxxCriticalNames "\<[A-Z][A-Za-z0-9_]*CriticalError\>" syn match cxxViolationNames "\<[A-Z][A-Za-z0-9_]*Violation\>" +syn match cxxTagName "\<[a-zA-Z_][A-Za-z0-9_]*_tag\>" + syn match cxxCast "\<\(const\|static\|dynamic\|reinterpret\)_cast\s*\(<\)\@=" @@ -279,5 +281,7 @@ if version >= 508 || !exists("did_cxx_syntax_inits") HiLink cxxStlDangerousFunction Dangerous + HiLink cxxTagName Tag + delcommand HiLink endif diff --git a/vim/colors/adam.vim b/vim/colors/adam.vim index f69630f..91a2a75 100644 --- a/vim/colors/adam.vim +++ b/vim/colors/adam.vim @@ -82,6 +82,8 @@ hi FoldColumn ctermbg=darkgrey ctermfg=white hi cIf0 ctermfg=gray term=none start=[38;2;100;100;100m stop=[0m "hi diffOnly ctermfg=red cterm=bold +hi Tag ctermfg=darkblue + " End of ron above. "set t_Co=8 diff --git a/vim/vimrc b/vim/vimrc index 19b60a4..a1b62f2 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -1,8 +1,8 @@ "ADAM David Alan Martin's updated vimrc "source ~/.vim/default.vim -let g:netrw_special_syntax=1 -set nofoldenable +source ~/.vim/vimrc.disablejunk + syntax on "The adam color scheme has both syntax colors and adam colorscheme now. diff --git a/vim/vimrc.disablejunk b/vim/vimrc.disablejunk new file mode 100644 index 0000000..8188871 --- /dev/null +++ b/vim/vimrc.disablejunk @@ -0,0 +1,18 @@ +" Here's a bunch of junk that Vim has turned on over +" the years, by default, that I've had to fight +" with configuration to get these not to load. +" +" If I ever want these back on, one day, I'll know where +" to find them. + +let g:netrw_special_syntax=1 + +set nofoldenable + +let g:did_load_ftplugin = 1 +let b:did_ftplugin = 1 +let g:did_ftplugin = 1 + +" This never seems to be respected anymore... +set noloadplugins + diff --git a/vim/vimrc.keymaps b/vim/vimrc.keymaps index ad9939f..d3ef5f8 100644 --- a/vim/vimrc.keymaps +++ b/vim/vimrc.keymaps @@ -13,5 +13,5 @@ map :cp map :cn "map _ :1,$!/opt/local/bin/clang-format-mp-3.9 -style=file :1,$!/opt/local/bin/uncrustify -q -lCPP -c ~/adamformat/adam.format.cfg -map _ :1,$!uncrustify -q -lCPP -c ~/adamformat/adam.format.cfg +map _ :1,$!uncrustify -q -lCPP -c ~/cshenv/adamformat/adam.format.cfg map \ :1,$!clang-format-devel -style=file