dotfiles

<-- duh.
Log | Files | Refs | LICENSE

commit bbad1d25b94b981019c132bca5be7dcbbb5a9024
parent f69573fde38330cfb2b3fc2065760f795548ff39
Author: Hayden Hamilton <hayden@haydenvh.com>
Date:   Mon,  9 Mar 2020 00:17:29 +0000

statusline++

Diffstat:
M.config/nvim/init.vim | 6+++++-
M.config/nvim/modules/splits.vim | 15+++++++++++++++
M.config/nvim/modules/statusline.vim | 30++++++++++++++++++++++++++++--
M.config/vimb/config | 2++
M.config/zsh/functions | 23++++++++++++-----------
A.scripts/bin/misc/vimbhist | 3+++
6 files changed, 65 insertions(+), 14 deletions(-)

diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim @@ -141,9 +141,13 @@ ino <Down> <Nop> ino <Left> <Nop> ino <Right> <Nop> +"Registers +nnoremap <leader>yy "*y +inoremap <leader><leader>yy "*y + augroup autocmd "Get rid of shitty indenting - autocmd BufRead * :normal gg=G + autocmd FileType html :normal gg=G "Nowrap autocmd FileType html :setlocal nowrap diff --git a/.config/nvim/modules/splits.vim b/.config/nvim/modules/splits.vim @@ -12,6 +12,21 @@ inoremap <C-k> <C-w>k inoremap <C-l> <C-w>l inoremap <C-c> <C-w>c +function! Netrwmap(filetype) + if a:filetype == 'netrw' + unmap! <c-l> + noremap! <C-l> <C-w>l + endif + + return 0 +endfunction + + +augroup Netrwstop + autocmd WinEnter,BufEnter * let _filetype=&filetype + autocmd WinEnter,BufEnter * let _void=Netrwmap(_filetype) +augroup END + set fillchars+=vert:\ hi VertSplit ctermbg=0 ctermfg=0 hi StatusLine ctermbg=0 ctermfg=0 diff --git a/.config/nvim/modules/statusline.vim b/.config/nvim/modules/statusline.vim @@ -72,8 +72,34 @@ function! Inactivestatus() return s endfunction +function! Netrwstatus() + ""Remimder + let s="%#Filecol#" + let s.=" %y " + let s.="%#Basecol#" + + return s +endfunction + augroup Statusline autocmd! - autocmd WinEnter,BufEnter * setlocal statusline=%!Activestatus() - autocmd WinLeave,BufLeave * setlocal statusline=%!Inactivestatus() + autocmd WinEnter,BufEnter * let _filetype=&filetype + autocmd WinEnter,BufEnter * let &l:statusline=Choosestatus(1, _filetype) + autocmd WinLeave,BufLeave * let &l:statusline=Choosestatus(0, "null") augroup END + +function! Choosestatus(active, filetype) + "Set active or inactive + if a:active == '1' && a:filetype != 'netrw' + let statusline=Activestatus() + else + let statusline=Inactivestatus() + endif + + "Overwrite if netrw + if a:filetype == 'netrw' + let statusline=Netrwstatus() + endif + + return statusline +endfunction diff --git a/.config/vimb/config b/.config/vimb/config @@ -15,6 +15,8 @@ set home-page=http://www.haydenvh.com/h/ set smooth-scrolling=false set webinspector=true +nnoremap vh :sh! vimbhist + shortcut-add sx=https://searx.me/?q=$0 shortcut-add sch=https://searx.ch/?q=$0 shortcut-add bit=https://bitchute.com/search?q=$0 diff --git a/.config/zsh/functions b/.config/zsh/functions @@ -1,24 +1,25 @@ +#!/bin/sh killprog(){ for prog in $(printf "$@") - do - pkill $prog - done + do + pkill $prog + done } 0x0(){ for file in $(printf "$@") - do - name=$(curl -n -F "file=@$file" http://0x0.st) - echo "$file has been hosted at $name" - done + do + name=$(curl -n -F "file=@$file" http://0x0.st) + echo "$file has been hosted at $name" + done } ix(){ for file in $(printf "$@") - do - name=$(curl -n -F "f:1=<-" http://ix.io < $file) - echo "$file has been hosted at $name" - done + do + name=$(curl -n -F "f:1=<-" http://ix.io < $file) + echo "$file has been hosted at $name" + done } pc(){ diff --git a/.scripts/bin/misc/vimbhist b/.scripts/bin/misc/vimbhist @@ -0,0 +1,3 @@ +#!/bin/sh + +tail -n 100 < ~/.config/vimb/history | dmenu -i -p "Select a link:" | awk '{print $1}' | xclip