From: Daniel Liu Date: Sun, 1 Aug 2021 02:26:42 +0000 (-0400) Subject: vimrc clean + snippets X-Git-Url: https://git.danieliu.xyz/?a=commitdiff_plain;h=HEAD;p=dotfiles.git vimrc clean + snippets --- diff --git a/.config/picom/picom.conf b/.config/picom/picom.conf index fc1cccd..9b46313 100644 --- a/.config/picom/picom.conf +++ b/.config/picom/picom.conf @@ -23,8 +23,8 @@ frame-opacity = 0.7; inactive-opacity-override = false; focus-exclude = [ "class_g = 'Cairo-clock'" ]; opacity-rule = [ - "85:class_g = 'St'", - "85:class_g = 'Zathura'" + "90:class_g = 'St'", + "90:class_g = 'Zathura'" ]; # Background-Blurring diff --git a/.config/shell/commonprofile b/.config/shell/commonprofile index 54666b9..01ed52c 100644 --- a/.config/shell/commonprofile +++ b/.config/shell/commonprofile @@ -1,5 +1,5 @@ -export PATH=$HOME/.local/bin:$HOME/Scripts:$HOME/Scripts/dmenu:$HOME/Scripts/statusbar:$HOME/Scripts/acpi:$PATH +export PATH=$HOME/.local/bin:$HOME/Scripts:$HOME/Scripts/dmenu:$HOME/Scripts/statusbar:$HOME/Scripts/acpi:$HOME/.cache/go/bin:$PATH export NINEIT_USERNAME=pinosaur export XDG_CONFIG_HOME=$HOME/.config @@ -29,6 +29,8 @@ export LESS_TERMCAP_ue=$'\e[0m' export ZDOTDIR="$HOME/.config/zsh" +export GOPATH="$HOME/.cache/go" + export LF_ICONS="\ di=:\ fi=:\ diff --git a/.config/shell/commonrc b/.config/shell/commonrc index a529887..c364a63 100644 --- a/.config/shell/commonrc +++ b/.config/shell/commonrc @@ -2,6 +2,8 @@ # alias alias ls='ls --color=auto' alias grep='grep --color=auto' +alias trree='tree -C' + alias cp='cp -i' alias dotfiles='git --git-dir=$HOME/.dotfiles --work-tree=$HOME' alias suckless-clean='make clean && rm -rf config.h && git reset --hard home/master' diff --git a/.vim/mysnippets/cpp.snippets b/.vim/mysnippets/cpp.snippets index 8d5468c..11cd87f 100644 --- a/.vim/mysnippets/cpp.snippets +++ b/.vim/mysnippets/cpp.snippets @@ -1,10 +1,10 @@ snippet guard "header guard" w -#ifndef $1 -#define $1 +#ifndef __$1_H__ +#define __$1_H__ $0 -#endif // $1 +#endif // __$1_H__ endsnippet snippet cpp "cpp extern" w @@ -18,3 +18,13 @@ $0 } #endif endsnippet + +snippet class "Class" w +class $1 +{ +private: +public: + $1(); + ~$1(); +}; +endsnippet diff --git a/.vim/mysnippets/html.snippets b/.vim/mysnippets/html.snippets index 2cea21b..1246a49 100644 --- a/.vim/mysnippets/html.snippets +++ b/.vim/mysnippets/html.snippets @@ -16,24 +16,8 @@ snippet html "html template" w endsnippet -# snippet `<(.+)` "tag" rw -# <> -# endsnippet - -snippet p "p tag" w -

$0

-endsnippet - -snippet div "div tag" w -
$0
-endsnippet - -snippet a "a tag" w -$0 -endsnippet - -snippet code "code tag" w -$0 +snippet `<(.+)` "tag" rw +`!p snip.rv = "<{0}>".format(match.group(1))`$1`!p snip.rv = "".format(match.group(1))` endsnippet snippet img "img tag" w diff --git a/.vim/mysnippets/vhdl.snippets b/.vim/mysnippets/vhdl.snippets deleted file mode 100644 index 843b408..0000000 --- a/.vim/mysnippets/vhdl.snippets +++ /dev/null @@ -1,8 +0,0 @@ - -snippet entity "Entity" w -Entity $1 is port -( - $0 -) -end Entity; -endsnippet diff --git a/.vimrc b/.vimrc index 33cea78..cecf819 100644 --- a/.vimrc +++ b/.vimrc @@ -39,13 +39,22 @@ let g:netrw_liststyle = 3 let g:netrw_banner = 0 let g:netrw_winsize = 25 +" file finding +set path=** +set wildmenu + " spell check setlocal spell set spelllang=en_us set spellcapcheck= -" accept first spell check fix -map z 1z= +" use s as prefix for spell check related commands +map s +map sf 1z= +map sn ]s +map sN [s +map sa zg +map sd zw " folding set foldmethod=manual @@ -67,10 +76,6 @@ cmap w!! w !sudo tee > /dev/null % map e :e:echo "current file reloaded" map E :e!:echo "current file force reloaded" -" highlighting (will get rid of this sometime prob) -au BufRead,BufNewFile *.svelte set filetype=svelte -au! Syntax svelte source ~/.vim/syntax/svelte.vim - " statusline function! StatusModeColor() if (mode() =~# '\v(n|no)') @@ -84,17 +89,19 @@ function! StatusModeColor() else hi StatusLine cterm=None gui=None ctermfg=black ctermbg=DarkGrey endif - - return '' endfunction function! StatusModifiedColor() - if getbufinfo(1)[0].changed + if &mod hi User1 cterm=None gui=None ctermfg=Black ctermbg=Magenta else hi User1 cterm=None gui=None ctermfg=White ctermbg=Black endif +endfunction +function! ReloadBar() + call StatusModeColor() + call StatusModifiedColor() return '' endfunction @@ -102,14 +109,12 @@ function! BufCount() return printf("%d/%d", bufnr("%"), len(getbufinfo({'buflisted':1}))) endfunction -call StatusModeColor() -call StatusModifiedColor() -autocmd BufWritePost call StatusModifiedColor() +autocmd BufEnter * call ReloadBar() +autocmd BufWritePost call ReloadBar() set laststatus=2 set statusline= -set statusline+=%{StatusModeColor()} -set statusline+=%{StatusModifiedColor()} +set statusline+=%{ReloadBar()} set statusline+=%1*\ | set statusline+=%0*\ vim\ \[%{mode()}\] set statusline+=\[%{BufCount()}\] @@ -134,6 +139,13 @@ augroup templates autocmd BufNewFile *.xml 0r ~/.vim/templates/skeleton.xml augroup END +" highlighting (will get rid of this sometime prob) +au BufRead,BufNewFile *.svelte set filetype=svelte +au! Syntax svelte source ~/.vim/syntax/svelte.vim + +au BufRead,BufNewFile *.shader set filetype=glsl +au! Syntax svelte source ~/.vim/syntax/glsl.vim + " vim plug " this blob auto installs vim plug if it isnt already fun! s:VimPlugSetup() @@ -154,9 +166,7 @@ Plug 'tpope/vim-commentary' Plug 'ap/vim-buftabline' Plug 'lervag/vimtex', { 'for': 'tex' } Plug 'PietroPate/vim-tex-conceal', { 'for': 'tex' } -" Plug 'jiangmiao/auto-pairs' -" Plug 'rlue/vim-barbaric' -" Plug 'junegunn/fzf' +Plug 'takac/vim-hardtime' call plug#end() @@ -188,21 +198,17 @@ let g:tex_conceal='abdmgs' let g:vimtex_compiler_latexmk = { \'build_dir': '/home/pinosaur/.cache/latexaux/', + \'options': [ + \ '-shell-escape', + \], \} - " \'options': [ - " \ '-shell-escape', - " \], - -" vim-barbaric -" let g:barbaric_ime = 'ibus' -" set ttimeoutlen=0 " buftabline let g:buftabline_show = 1 -" fzf -" let g:fzf_layout = { 'down': '40%' } -" let g:fzf_layout = { 'window': '-tabnew' } +" hardtime +let g:hardtime_default_on = 1 +let g:hardtime_maxcount = 2 " Run after plugins autocmd FileType * set formatoptions-=o @@ -245,3 +251,4 @@ hi lineNr ctermfg=DarkGrey hi Folded ctermfg=0 hi Pmenu ctermfg=0 ctermbg=7 hi PmenuSel ctermfg=0 ctermbg=6 +