Browse Source

Fix hiccups in root setup

- Neovim
- X login (fish)
- YouCompleteMe
red-hat-laptop
Kevin Mok 5 years ago
parent
commit
da851bfb23
Signed by: Kevin-Mok GPG Key ID: AEA75288DC135CF5
  1. 2
      dot_config/nvim/init.vim
  2. 32
      dot_config/private_fish/config.fish.tmpl
  3. 54
      dot_vimrc.tmpl
  4. 4
      key_files.tmpl
  5. 4
      txt/todo.md

2
dot_nvim → 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'

32
dot_config/private_fish/config.fish → 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 #

54
dot_vimrc → 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 <F1> :w<CR>:silent !sync-shortcuts<CR>
" map <F2> :silent !scp -P 2222 e1.html e1_style.css kevin@127.0.0.1:/home/kevin/Downloads/e1<CR>
" map <F6> :make -C ~/Documents/resume cv<CR>
" }}} 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 << <Esc><<A
" function keys {{{ "
" function keys [[[ "
map <F3> :wa<CR>
map <F4> :xa<CR>
map <F5> :q!<CR>
@ -248,14 +252,14 @@ map <F7> :AutoSaveToggle<CR>
nnoremap <F9> :e<CR>
nnoremap <F10> :set paste<CR>"+p:set nopaste<CR>
nnoremap <F11> :set paste<CR>"*p:set nopaste<CR>
" }}} function keys "
" ]]] function keys "
map <S-Enter> O<ESC>
" swap text visually
vnoremap <C-P> <Esc>`.``gvP``P
ino <C-A> <C-O>yiW<End>=<C-R>=<C-R>0<CR>
" splits {{{ "
" splits [[[ "
nnoremap <C-Down> <C-W><C-J>
nnoremap <C-Up> <C-W><C-K>
nnoremap <C-Right> <C-W><C-L>
@ -263,9 +267,9 @@ nnoremap <C-Left> <C-W><C-H>
" Maximize height/width.
nnoremap <C-g> <C-W>_
nnoremap <C-w> <C-W>|
" }}} splits "
" ]]] splits "
" leader mappings {{{ "
" leader mappings [[[ "
let mapleader="\<Space>"
" find alias
@ -355,15 +359,15 @@ nnoremap <leader>yg ggyG
" toggle fold
nnoremap <leader>z za
" }}} leader mappings "
" ]]] leader mappings "
" }}} Mappings "
" ]]] Mappings "
" Local Mappings {{{ "
" Local Mappings [[[ "
let maplocalleader="\\"
" tex {{{ "
" tex [[[ "
autocmd Filetype tex inoremap <localleader>bt \bowtie
autocmd Filetype tex inoremap <localleader>c \checkmark
@ -399,7 +403,7 @@ autocmd Filetype tex inoremap <localleader>Z \mathbb{Z}
autocmd Filetype tex inoremap <localleader>wx $w(x)$
autocmd Filetype tex inoremap <localleader>tx $t(x)$
" }}} tex "
" ]]] tex "
autocmd Filetype c inoremap <localleader>uc unsigned char
@ -413,6 +417,6 @@ autocmd Filetype javascript inoremap <localleader>x process.exit()
autocmd Filetype markdown nnoremap <localleader>x 0f[lrx
" nnoremap <localleader>x 0f[lrx
autocmd Filetype go-template inoremap <localleader>e {{ else }}
autocmd Filetype go-template inoremap <localleader>e {{"{{ else }}"}}
" }}} Local Mappings "
" ]]] Local Mappings "

4
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

4
txt/todo.md

@ -1,8 +1,4 @@
# chezmoi
- root
- shortcut script
- fish config template
- nvim setup
- home server
- lab
- template bash file

Loading…
Cancel
Save