From 60adc97f782f2094cc558a2747faa4c1b49b2cb5 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Thu, 1 Dec 2016 15:13:01 -0600 Subject: [PATCH 1/3] vim and fzf synergy 2.0 --- editor/nvim/config/init.vim | 17 +++++++++++++---- env/sh/aliases | 2 +- os/arch_linux/music.bash | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/editor/nvim/config/init.vim b/editor/nvim/config/init.vim index b0bb1c5..7811482 100644 --- a/editor/nvim/config/init.vim +++ b/editor/nvim/config/init.vim @@ -78,6 +78,7 @@ Plug 'michaeljsmith/vim-indent-object' " adds an indentation level text object Plug 'wellle/targets.vim' " adds some more handy text objects Plug 'ternjs/tern_for_vim', { 'do': 'npm install' } Plug 'mikewest/vimroom' +Plug 'editorconfig/editorconfig-vim' " loads project-specific editor settings let g:vimroom_sidebar_height = 0 Plug 'junegunn/fzf', {'dir': '~/.fzf', 'do': './install --all'} " fuzzy file finding @@ -130,7 +131,7 @@ autocmd BufNewFile,BufReadPost *.txt setl spell textwidth=0 wrapmargin=0 set tabstop=2 set shiftwidth=2 set softtabstop=2 -set noexpandtab +set expandtab set autoindent smartindent set list set nostartofline @@ -342,10 +343,18 @@ vmap Q gq nmap Q gqap " launch fzf for the current git repo -nnoremap :GitFiles +nnoremap :GitFiles -" super fancy buffer switching -nnoremap l :ls:b +" launch fzf for files in the current directory +nnoremap :Files + +" launch fzf for files modified or not in git +nnoremap :GFiles? + +" launch fzf for open buffers (files) +nnoremap l :Buffers + +" switch to previous buffer nnoremap h :b# " use leader j and k to switch buffers as well diff --git a/env/sh/aliases b/env/sh/aliases index 36d85dd..25256e0 100644 --- a/env/sh/aliases +++ b/env/sh/aliases @@ -40,7 +40,7 @@ alias tmnew="tmux new -s" alias tmls="tmux list-sessions" alias tmatt="tmux attach -t" alias tu="tmux attach -t utils || tmux new -s utils" -alias tdf="tmux attach -t df || tmux new -s utils -c \"$DOTFILES_PATH\"" +alias tdf="tmux attach -t df || tmux new -s df -c \"$DOTFILES_PATH\"" # git aliases alias gs="git status" diff --git a/os/arch_linux/music.bash b/os/arch_linux/music.bash index 6b7c8ce..41278bd 100755 --- a/os/arch_linux/music.bash +++ b/os/arch_linux/music.bash @@ -5,5 +5,5 @@ source $DIR/variables.bash pacaur -S \ mopidy mopidy-spotify mopidy-gmusic \ - ncmpcpp mpd \ + ncmpcpp mpd mpc \ --noconfirm --noedit From 5b17f9fc5a4fc3de5d24bce1ef7374c62874d3e0 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Thu, 1 Dec 2016 16:03:52 -0600 Subject: [PATCH 2/3] fix a bad vim config line --- editor/nvim/config/init.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/nvim/config/init.vim b/editor/nvim/config/init.vim index 7811482..38bdc40 100644 --- a/editor/nvim/config/init.vim +++ b/editor/nvim/config/init.vim @@ -349,7 +349,7 @@ nnoremap :GitFiles nnoremap :Files " launch fzf for files modified or not in git -nnoremap :GFiles? +nnoremap :GFiles? " launch fzf for open buffers (files) nnoremap l :Buffers From 7b677545223e667f253eb005065e904af117c2df Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Thu, 8 Dec 2016 12:35:29 -0600 Subject: [PATCH 3/3] new lock system --- env/wm/sxhkdrc | 6 +++--- env/x/screensaver/lock.sh | 9 +++++++++ env/x/screensaver/setup.sh | 5 +++++ os/arch_linux/3-utils.bash | 1 + variables.bash | 1 + 5 files changed, 19 insertions(+), 3 deletions(-) create mode 100755 env/x/screensaver/lock.sh create mode 100755 env/x/screensaver/setup.sh diff --git a/env/wm/sxhkdrc b/env/wm/sxhkdrc index 7fe9e1b..46c8e1c 100755 --- a/env/wm/sxhkdrc +++ b/env/wm/sxhkdrc @@ -153,8 +153,8 @@ super + shift + t compton-trans -c -o 100 # swap sxhkx config with an alternate file and reload the new one -super + shift + alt + ctrl + r - if [ -e ~/.config/sxhkd/altsxhkdrc ]; then mv ~/.config/sxhkd/sxhkdrc ~/.config/sxhkd/origsxhkdrc && mv ~/.config/sxhkd/altsxhkdrc ~/.config/sxhkd/sxhkdrc && pkill -USR1 -x sxhkd; fi +# super + shift + alt + ctrl + r +# if [ -e ~/.config/sxhkd/altsxhkdrc ]; then mv ~/.config/sxhkd/sxhkdrc ~/.config/sxhkd/origsxhkdrc && mv ~/.config/sxhkd/altsxhkdrc ~/.config/sxhkd/sxhkdrc && pkill -USR1 -x sxhkd; fi # spawn a terminal super + Return @@ -170,7 +170,7 @@ super + space # lock the desktop super + ctrl + shift + l - slock + $SHELL -c '$DOTFILES_PATH/env/x/screensaver/lock.sh' # spawn gui file explorer super + e diff --git a/env/x/screensaver/lock.sh b/env/x/screensaver/lock.sh new file mode 100755 index 0000000..a72de64 --- /dev/null +++ b/env/x/screensaver/lock.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env sh + +source "$DOTFILES_PATH/variables.bash" + +scrot "$IMG_PATH/.lock/.lock-bg-img.png" +convert "$IMG_PATH/.lock/.lock-bg-img.png" -blur 0x12 "$IMG_PATH/.lock/.lock-bg-img_blurred.png" +rm "$IMG_PATH/.lock/.lock-bg-img.png" +# xscreensaver-command --lock +i3lock -i "$IMG_PATH/.lock/.lock-bg-img_blurred.png" diff --git a/env/x/screensaver/setup.sh b/env/x/screensaver/setup.sh new file mode 100755 index 0000000..6fb8e9d --- /dev/null +++ b/env/x/screensaver/setup.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +source "$DOTFILES_PATH/variables.bash" + +mkdir -p "$IMG_PATH/.lock" diff --git a/os/arch_linux/3-utils.bash b/os/arch_linux/3-utils.bash index 032f498..429f523 100755 --- a/os/arch_linux/3-utils.bash +++ b/os/arch_linux/3-utils.bash @@ -51,6 +51,7 @@ pacaur -S \ qt5-webengine \ ruby \ xorg-xbacklight \ + i3lock-blur \ --noconfirm --noedit # sudo ln -s /usr/bin/google-chrome-unstable /usr/bin/chrome diff --git a/variables.bash b/variables.bash index a92bb06..21dc3bc 100755 --- a/variables.bash +++ b/variables.bash @@ -22,6 +22,7 @@ export BLACKLISTED_BAR_MODULES="" # than a little bit ashamed # TODO: use /tmp ? export REPOSITORY_PATH="$NICE_HOME/code/open-source" +export IMG_PATH="$NICE_HOME/img" # the width of the border around the bspwm windows export BORDER_WIDTH=0