From da851bfb2366840ec48c35e984bc95bc2c715ebf Mon Sep 17 00:00:00 2001 From: Kevin Mok Date: Fri, 26 Apr 2019 01:32:31 -0400 Subject: [PATCH] Fix hiccups in root setup - Neovim - X login (fish) - YouCompleteMe --- dot_nvim => dot_config/nvim/init.vim | 2 +- .../{config.fish => config.fish.tmpl} | 32 ++++++----- dot_vimrc => dot_vimrc.tmpl | 54 ++++++++++--------- key_files.tmpl | 4 +- txt/todo.md | 4 -- 5 files changed, 51 insertions(+), 45 deletions(-) rename dot_nvim => dot_config/nvim/init.vim (76%) rename dot_config/private_fish/{config.fish => config.fish.tmpl} (82%) rename dot_vimrc => dot_vimrc.tmpl (94%) diff --git a/dot_nvim b/dot_config/nvim/init.vim similarity index 76% rename from dot_nvim rename to dot_config/nvim/init.vim index 91309c3..48942b3 100644 --- a/dot_nvim +++ b/dot_config/nvim/init.vim @@ -2,5 +2,5 @@ set runtimepath^=~/.vim runtimepath+=~/.vim/after let &packpath = &runtimepath source ~/.vimrc -let g:python_host_prog = '/usr/lib/python2.7' +let g:python_host_prog = '/usr/lib/python3.7' " let g:python3_host_prog = '/usr/lib/python3.5.zip' diff --git a/dot_config/private_fish/config.fish b/dot_config/private_fish/config.fish.tmpl similarity index 82% rename from dot_config/private_fish/config.fish rename to dot_config/private_fish/config.fish.tmpl index 5dafe93..03bea10 100644 --- a/dot_config/private_fish/config.fish +++ b/dot_config/private_fish/config.fish.tmpl @@ -1,15 +1,19 @@ -# login to X {{{ # +# vim: fdm=marker ft=fish.go-template +# login to X [[[ # + +{{ if eq .chezmoi.username "kevin" }} if status is-login if test -z "$DISPLAY" -a $XDG_VTNR = 1 exec startx -- -keeptty end end set -x GPG_TTY (tty) +{{ end }} -# }}} login to X # +# ]]] login to X # -# fish-specific {{{ # +# fish-specific [[[ # fish_vi_key_bindings set -x EDITOR nvim @@ -30,14 +34,14 @@ for fxn in (find $fish_fxn_dir -name '*.fish') source $fxn end abbr rf "chezmoi apply && source ~/.config/fish/config.fish" -abbr rfs "sync-shortcuts && chezmoi apply && source /home/kevin/.config/fish/key_abbr.fish > /dev/null" +abbr rfs "sync-shortcuts && chezmoi apply && source ~/.config/fish/key_abbr.fish > /dev/null" abbr xf "fish_config" abbr f. "cd .." abbr f.. "cd ../.." -# }}} fish-specific # +# ]]] fish-specific # -# universal var's {{{ # +# universal var's [[[ # # spv set -U spv_dir "/home/kevin/coding/spotify-lib-vis" @@ -52,14 +56,16 @@ set -xU XSET_RATE 90 set -xU XSET_DELAY 200 # causes xmodmap to have issues when opening terminal sometimes # xmodmap ~/.Xmodmap && xset r rate $XSET_DELAY $XSET_RATE +{{ if and (eq .chezmoi.fullHostname "x1-carbon") (not (eq .chezmoi.username "root")) }} xset r rate $XSET_DELAY $XSET_RATE +{{ end }} # set -U BROWSER "chromium" set -U BROWSER "firefox" -# }}} universal var's # +# ]]] universal var's # -# fxn abbr's {{{ # +# fxn abbr's [[[ # abbr ag "grep-aliases" abbr bq "benq-brightness" @@ -68,7 +74,7 @@ abbr cpe "copy echo" abbr cpp "copy echo (pwd)" abbr cff "create-fish-function" abbr ev "evince-silent" -# git {{{ # +# git [[[ # abbr gcamp "git-amend-push" abbr gdf "git-diff-files" @@ -76,7 +82,7 @@ abbr gpsmt "git-push-multiple" abbr gremotes "git-mult-remotes" abbr grmb "git-delete-branch" -# }}} git # +# ]]] git # abbr hs "scan-history" abbr hst "$EDITOR ~/.local/share/fish/fish_history" abbr mt "math" @@ -86,11 +92,11 @@ abbr rs "redshift-set" abbr ut "unix-timestamp" abbr uzr "unzip-rm" -# }}} fxn abbr's # +# ]]] fxn abbr's # abbr hm "cd $mfs_dir && hugo serve -D --disableFastRender" -# school {{{ # +# school [[[ # # 309 # abbr r0t "./revert-e3-json restaurants" @@ -108,4 +114,4 @@ abbr r6 "run-a4 h e" # abbr r6s "run-a3 s c o" # abbr g6 "source $fish_fxn_dir/369/a3/gdb-a3-break.fish && gdb-a3-break c c" -# }}} school # +# ]]] school # diff --git a/dot_vimrc b/dot_vimrc.tmpl similarity index 94% rename from dot_vimrc rename to dot_vimrc.tmpl index 0fb5e12..98ff0c0 100644 --- a/dot_vimrc +++ b/dot_vimrc.tmpl @@ -1,4 +1,6 @@ -" set x=y {{{ " +" vim: fdm=marker ft=vim.go-template + +" set x=y [[[ " set autoindent set autoread @@ -34,18 +36,18 @@ filetype indent on syntax on au CursorHold * checktime -" cursor indicator {{{ " +" cursor indicator [[[ " " set listchars=tab:\|\ " set list " set cursorcolumn " set cursorline -" }}} cursor indicator " +" ]]] cursor indicator " -" }}} set x=y " +" ]]] set x=y " -" commands for file types {{{ " +" commands for file types [[[ " autocmd BufNewFile,BufRead .* set syntax=sh autocmd FileType *css,htmldjango,html,javascript,json,markdown,tex,text,yaml set tabstop=2 shiftwidth=2 @@ -68,18 +70,18 @@ autocmd VimEnter *.tex VimtexCompile autocmd VimLeave *.tex !tex-clean %:p autocmd BufNewFile,BufRead *.tmpl set tw=0 sw=2 ft=go-template fmr=[[[,]]] -" " auto-reload vimrc {{{ " +" " auto-reload vimrc [[[ " " augroup myvimrc " au! " au BufWritePost .vimrc,_vimrc,vimrc,.gvimrc,_gvimrc,gvimrc so $MYVIMRC | if has('gui_running') | so $MYGVIMRC | endif " augroup END -" " }}} auto-reload vimrc " +" " ]]] auto-reload vimrc " -" }}} commands for file types " +" ]]] commands for file types " -" commands for specific files {{{ " +" commands for specific files [[[ " autocmd BufNewFile,BufRead watson*.fish set tabstop=2 shiftwidth=2 expandtab autocmd BufRead commit-msg.txt set filetype=gitcommit tw=72 @@ -90,9 +92,9 @@ autocmd BufNewFile,BufRead key_* map :w:silent !sync-shortcuts " map :silent !scp -P 2222 e1.html e1_style.css kevin@127.0.0.1:/home/kevin/Downloads/e1 " map :make -C ~/Documents/resume cv -" }}} commands for specific files " +" ]]] commands for specific files " -" vim-plug {{{ +" vim-plug [[[ " plug auto-install if empty(glob('~/.vim/autoload/plug.vim')) silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs @@ -139,6 +141,7 @@ Plug 'lervag/vimtex' " \ 'continuous' : 0, " \} +{{ if not (eq .chezmoi.username "root") }} " auto-completion for various languages Plug 'Valloric/YouCompleteMe' let g:ycm_filetype_blacklist = { @@ -151,6 +154,7 @@ let g:ycm_filetype_blacklist = { \ 'infolog': 1, \ 'mail': 1 \} +{{ end }} " wrote short bits of text that expand into whatever you want " demo: https://www.youtube.com/watch?v=Zik6u0klD40 @@ -226,9 +230,9 @@ Plug 'djoshea/vim-autoread' " Plug 'mustache/vim-mustache-handlebars' " Plug 'trapd00r/vim-syntax-vidir-ls' Plug 'calviken/vim-gdscript3' -" }}} vim-plug " +" ]]] vim-plug " -" Mappings {{{ " +" Mappings [[[ " call plug#end() " colorscheme gotham256 @@ -238,7 +242,7 @@ nnoremap > >> nnoremap < << inoremap << < :wa map :xa map :q! @@ -248,14 +252,14 @@ map :AutoSaveToggle nnoremap :e nnoremap :set paste"+p:set nopaste nnoremap :set paste"*p:set nopaste -" }}} function keys " +" ]]] function keys " map O " swap text visually vnoremap `.``gvP``P ino yiW==0 -" splits {{{ " +" splits [[[ " nnoremap nnoremap nnoremap @@ -263,9 +267,9 @@ nnoremap " Maximize height/width. nnoremap _ nnoremap | -" }}} splits " +" ]]] splits " -" leader mappings {{{ " +" leader mappings [[[ " let mapleader="\" " find alias @@ -355,15 +359,15 @@ nnoremap yg ggyG " toggle fold nnoremap z za -" }}} leader mappings " +" ]]] leader mappings " -" }}} Mappings " +" ]]] Mappings " -" Local Mappings {{{ " +" Local Mappings [[[ " let maplocalleader="\\" -" tex {{{ " +" tex [[[ " autocmd Filetype tex inoremap bt \bowtie autocmd Filetype tex inoremap c \checkmark @@ -399,7 +403,7 @@ autocmd Filetype tex inoremap Z \mathbb{Z} autocmd Filetype tex inoremap wx $w(x)$ autocmd Filetype tex inoremap tx $t(x)$ -" }}} tex " +" ]]] tex " autocmd Filetype c inoremap uc unsigned char @@ -413,6 +417,6 @@ autocmd Filetype javascript inoremap x process.exit() autocmd Filetype markdown nnoremap x 0f[lrx " nnoremap x 0f[lrx -autocmd Filetype go-template inoremap e {{ else }} +autocmd Filetype go-template inoremap e {{"{{ else }}"}} -" }}} Local Mappings " +" ]]] Local Mappings " diff --git a/key_files.tmpl b/key_files.tmpl index 2189a5b..7093c10 100644 --- a/key_files.tmpl +++ b/key_files.tmpl @@ -12,8 +12,8 @@ r {{ .chezmoi.homedir }}/linux-config/dot_config/ranger/rc.conf sr {{ .chezmoi.homedir }}/{{ .chezmoi.os }}-config/configs/ranger/shortcuts.conf ss {{ .chezmoi.homedir }}/.shortcuts u {{ .chezmoi.homedir }}/.Xresources -v {{ .chezmoi.homedir }}/linux-config/dot_vimrc -x ~/{{ .chezmoi.os }}-config/dot_config/private_fish/config.fish +v {{ .chezmoi.homedir }}/linux-config/dot_vimrc.tmpl +x ~/{{ .chezmoi.os }}-config/dot_config/private_fish/config.fish.tmpl y {{ .chezmoi.homedir }}/.zshrc z {{ .chezmoi.homedir }}/{{ .chezmoi.os }}-config/aliases/zsh_aliases diff --git a/txt/todo.md b/txt/todo.md index 496acf0..81d7958 100644 --- a/txt/todo.md +++ b/txt/todo.md @@ -1,8 +1,4 @@ # chezmoi -- root - - shortcut script - - fish config template -- nvim setup - home server - lab - template bash file