diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-03-07 23:40:57 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-03-07 23:40:57 +0100 |
| commit | bb31dbfd4e788f0efcbb0e6ab8264a12116aa672 (patch) | |
| tree | bd09360c4e348c91f76af2f0bed7427c1fdc8b9b | |
| parent | f4309c69498ae23959de904d38d23f6f8d667c09 (diff) | |
| download | dotfiles-bb31dbfd4e788f0efcbb0e6ab8264a12116aa672.tar.gz dotfiles-bb31dbfd4e788f0efcbb0e6ab8264a12116aa672.tar.bz2 dotfiles-bb31dbfd4e788f0efcbb0e6ab8264a12116aa672.zip | |
xmonad brightness handling
| -rw-r--r-- | .vimrc | 13 | ||||
| -rw-r--r-- | grep.vim | 18 | ||||
| -rwxr-xr-x | install.sh | 7 | ||||
| -rw-r--r-- | xmonad.hs | 7 |
4 files changed, 33 insertions, 12 deletions
@@ -106,26 +106,27 @@ nnoremap <leader>l :ls<CR> " file manipulation with leader nnoremap <leader>w :w<CR> nnoremap <leader>x :x<CR> - " open vimrc in split nnoremap <leader>rc :vsplit $MYVIMRC<cr> " source vimrc nnoremap <leader>src :source $MYVIMRC<cr> - " file toggle nnoremap <leader>z zi - " create c function body from prototype nnoremap gcf A<BS><CR>{<CR><CR>}<ESC> - " put semicolon at the end of line nnoremap <leader>; mqA;<ESC>`q +" grep +" nnoremap <leader>gw :silent grep -R <cword> .<CR>:copen<CR> +" nnoremap <leader>gW :silent execute "grep! -R " . shellescape(expand("<cWORD>")) . " ."<CR>:copen<CR> +" nnoremap <leader>gn :cnext<CR> +" nnoremap <leader>gp :cprevious<CR> + + " remove trailing white space on save autocmd BufWritePre * %s/\s\+$//e - " initialise buf for fold toggle autocmd BufReadPre * :normal zMzi - " real tab in c file for school projects autocmd Filetype c setlocal noexpandtab diff --git a/grep.vim b/grep.vim new file mode 100644 index 0000000..3b80fa1 --- /dev/null +++ b/grep.vim @@ -0,0 +1,18 @@ +nnoremap <leader>g :set operatorfunc=<SID>GrepOp<CR>g@ +vnoremap <leader>g :<C-u>call <SID>GrepOp(visualmode())<CR> + +function! s:GrepOp(type) + let saved = @@ + + if a:type ==# 'v' + execute "normal! `<v`>y" + elseif a:type ==# 'char' + execute "normal! `[v`]y" + else + return + endif + + silent execute "grep! -R " . shellescape(@@) . " ." + copen + let @@ = saved +endfunction @@ -10,6 +10,8 @@ # Creating links ln -sf $DOTDIR/.zshrc $HOME/.zshrc ln -sf $DOTDIR/.vimrc $HOME/.vimrc +[ ! -d $HOME/.vim/plugin ] && mkdir -p $HOME/.vim/plugin +ln -sf $DOTDIR/grep.vim $HOME/.vim/plugin/grep.vim [ ! -d $HOME/.xmonad ] && mkdir $HOME/.xmonad ln -sf $DOTDIR/xmonad.hs $HOME/.xmonad/xmonad.hs @@ -26,8 +28,11 @@ ln -sf $DOTDIR/redshift.conf $HOME/.config/redshift.conf ################ # vim Plug -curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ +PLUGFILE=$HOME/.vim/autoload/plug.vim +if [ ! -f $PLUGFILE ]; then +curl -fLo $PLUGFILE --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim +fi vim -c "PlugInstall" -c "qa" # zsh pluggins @@ -27,9 +27,6 @@ myStartupHook = do myKeys = [ ("<XF86AudioRaiseVolume>", spawn "pulseaudio-ctl up") , ("<XF86AudioLowerVolume>", spawn "pulseaudio-ctl down") , ("<XF86AudioMute>", spawn "pulseaudio-ctl mute") + , ("<XF86MonBrightnessUp>", spawn "xbacklight -inc 5") + , ("<XF86MonBrightnessDown>", spawn "xbacklight -dec 5") ] - -- , ("<XF86AudioPlay>", spawn "playerctl play-pause") - -- , ("<XF86AudioPrev>", spawn "playerctl previous") - -- , ("<XF86AudioNext>", spawn "playerctl next") - -- , ("<XF86MonBrightnessUp>", spawn "lux -a 5%") - -- , ("<XF86MonBrightnessDown>", spawn "lux -s 5%") |
