Update zsh, bspwm, nvim, vscode, tmux. Add fish

This commit is contained in:
Smirnov Olexandr 2021-02-20 21:29:02 +02:00
parent 1f5249ea78
commit 53d009b671
14 changed files with 236 additions and 115 deletions

View file

@ -2,28 +2,28 @@
# Smirnov-O <ss2316544@gmail.com>
# BSPWM config file
## == Function
###== Function
Run() {
if ! pgrep $1
then $@& fi
}
## == Autostart
###== Autostart
Run setxkbmap "us,ua" ",winkeys" "grp:alt_shift_toggle" -option "ctrl:nocaps" &
Run feh --randomize --bg-scale ~/Pictures/wallp &
Run sxhkd -c ./.config/bspwm/sxhkd &
Run sxhkd -c ~/.config/bspwm/sxhkd &
~/.config/bspwm/bar.sh &
Run ~/.script/autolock &
Run lxsession &
Run picom -b &
## == BSPWM
###== BSPWM
# Workspaces
bspc monitor -d 1 2 3 4 5 6 7 8 9
# General
bspc config border_width 2
bspc config window_gap 8
bspc config window_gap 4
bspc config split_ratio 0.50
bspc config borderless_monocle true
bspc config gapless_monocle true
@ -38,16 +38,17 @@ bspc config presel_feedback_color "#51AFEF"
bspc config urgent_border_color "#FF6C6B"
# Rules
bspc rule -a Alacritty desktop='^1' focus=on follow=on
bspc rule -a kitty desktop='^1' focus=on follow=on
bspc rule -a firefox desktop='^2' focus=on follow=off
bspc rule -a Code desktop='^3' focus=on follow=off
bspc rule -a Sublime_text desktop='^3' focus=on follow=on
bspc rule -a '*:nvim' desktop='^3' focus=on follow=on
bspc rule -a '*:ranger' desktop='^4' focus=on follow=off
bspc rule -a Thunar desktop='^4' focus=on follow=on
bspc rule -a Joplin desktop='^5' focus=on follow=off
bspc rule -a discord descord='^6' focus=off follow=off
bspc rule -a telegram-desktop descord='^6' focus=off follow=off
bspc rule -a Spotify descord='^9' focus=on follow=on
bspc rule -a google-tasks-desktop state=floating
bspc rule -a Alacritty desktop='^1' focus=on follow=on
bspc rule -a kitty desktop='^1' focus=on follow=on
bspc rule -a firefox desktop='^2' focus=on follow=on
bspc rule -a Google-chrome desktop='^2' focus=on follow=on
bspc rule -a Code desktop='^3' focus=on follow=on
bspc rule -a '*:nvim' desktop='^3' focus=on follow=on
bspc rule -a '*:ranger' desktop='^4' focus=on follow=off
bspc rule -a Thunar desktop='^4' focus=on follow=off
bspc rule -a Joplin desktop='^5' focus=on follow=off
bspc rule -a discord desktop='^6' focus=on follow=off
bspc rule -a telegram-desktop desktop='^6' focus=off follow=off
bspc rule -a KeePassXC desktop='^7' focus=on follow=off
bspc rule -a Spotify desktop='^9' focus=on follow=on
bspc rule -a google-tasks-desktop state=floating

View file

@ -1,3 +1,5 @@
# vim: ft=dosini
[settings]
enable-ipc = true
format-padding = 1
@ -19,9 +21,9 @@ foreground = ${colors.foreground}
wm-restack = bspwm
font-0 = Iosevka Nerd Font:style=Medium:size=8;3
font-1 = FontAwesome5Free:style=Solid:size=7.5;2.5
modules-left = windowname
modules-center = bspwm
modules-right = pulseaudio archupd wifi-signal weather memory cpu keyboard time date
modules-left = bspwm
modules-center = windowname
modules-right = keyboard pulseaudio weather wifi-signal archupd time
tray-position = right
tray-padding = 0
@ -47,7 +49,7 @@ label-empty-padding = 2
[module/pulseaudio]
type = internal/pulseaudio
interval = 2
format-volume = <ramp-volume> <label-volume>
format-volume = <ramp-volume> <label-volume>
label-volume = %percentage%%
label-volume-foreground = ${root.foreground}
label-muted = 
@ -63,6 +65,12 @@ type = custom/script
exec = ~/.config/polybar/scripts/updates-pacman-aur.sh
interval = 60
[module/wifi-signal]
type = custom/script
label =  %output:%%
exec = ~/.config/polybar/scripts/wifi-signal.sh
interval = 3
[module/keyboard]
type = internal/xkeyboard
format-prefix = ""

View file

@ -1,20 +1,21 @@
# Smirnov-O <ss2316544@gmail.com>
# BSPWM/SXKBD config file
## == USER keys
## == USER keys
super + {_,shift} Return
{alacritty, \
rofi -show drun }
{kitty, \
rofi -show drun -theme ntenV2}
super + shift + {w,f,e,c,q}
{firefox, \
alacritty --class=ranger -e ranger, \
alacritty --class=nvim -e nvim, \
code, \
xkill }
super + shift + {w,f,e,c,v,q}
{google-chrome-stable, \
alacritty --class=ranger -e ranger, \
alacritty --class=nvim -e nvim, \
code, \
veracrypt, \
xkill }
super + shift + z
betterlockscreen --off 180 -t "Computer is lokerd" -l
betterlockscreen --off 180 -t "Computer is locked" -l
super + {equal, minus, shift+minus}
amixer sset Master {2%+,2%-,toggle}
@ -26,10 +27,11 @@ super + {Escape, ctrl + u, ctrl + i}
### == BSPWM keys
super + q
bspc node -{c,k}
bspc node -c
super + control + r
bspc wm -r && pkill -USR1 -x sxhkd
bspc wm -r \
pkill -USR1 -x sxhkd
### == BSPWM windows
## Resize window
@ -43,8 +45,10 @@ super + {_,shift + }{h,j,k,l}
# Preselect the direction
super + alt + {h,j,k,l}
bspc node -p {west,south,north,east}
super + alt + {1-9}
bspc node -o 0.{1-9}
super + alt + {space,0}
bspc node -p cancel
@ -52,10 +56,11 @@ super + alt + {space,0}
super + {_,shift + }{1-9}
bspc {desktop -f,node -d} focused:'^{1-9}'
## == BSPWM windwo layouts
super + ctrl + {t, s, f}
bspc node -t {tiled,floating,fullscreen}
## == BSPWM window layouts
super + shift + {Tab, F11}
bspc node -t {floating,fullscreen}
# Change windows layout
super + ctrl + {m,x,y,z}
bspc node -g {marked,locked,sticky,private}
super + Tab
bspc node -t tiled
# vim: ft=sxhkdrc

68
config/fish/config.fish Normal file
View file

@ -0,0 +1,68 @@
set -U fish_user_paths $HOME/bin $HOME/.yarn/bin $HOME/.applications $fish_user_paths
set fish_greeting
## Variables
set EDITOR "nvim"
set VISUAL "nvim"
## Key bindings
function fish_user_key_bindings
fish_default_key_bindings
# fish_vi_key_bindings
end
## Colors
set fish_color_normal brwhite
set fish_color_autosuggestion '#DDDDDD'
set fish_color_command brcyan
set fish_color_error '#ff6c6b'
set fish_color_param brwhite
## Functions
function backup --argument filename
cp $filename $filename.bak
end
function targz-this-folder --argument filename
tar -czf $filename.tar.gz .
end
function zip-this-folder --argument filename
zip -r $filename.zip .
end
function set-wallpaper --argument filename
feh --bg-scale $filename
end
function set-random-wallpaper
feh --randomize --bg-scale ~/Pictures/wallp
end
## Plugins
fundle plugin 'matchai/spacefish' # Prompt theme
fundle plugin 'justinmayer/virtualfish' # Python venv support
fundle plugin 'FabioAntunes/fish-nvm' # NVM status
fundle plugin 'edc/bass' # Required for fish-nvm
fundle plugin 'jorgebucaran/autopair.fish' # Brackets closer
fundle init
## Aliases
alias cls="clear"
alias mkdir="mkdir -p"
alias cp="cp -r"
alias du="du -sh"
alias df="df -h"
alias neovim='nvim'
alias vim="nvim"
alias vi="vim"
alias tmux="tmux -2"
alias :q="exit"
alias q="exit"
alias ..="cd .."
alias ...="cd ../.."

View file

@ -3,10 +3,7 @@ call plug#begin('~/.vim/plugged')
Plug 'itchyny/lightline.vim'
Plug 'jiangmiao/auto-pairs'
Plug 'maxboisvert/vim-simple-complete'
Plug 'pangloss/vim-javascript'
Plug 'airblade/vim-gitgutter'
Plug 'dense-analysis/ale'
"Plug 'editorconfig/editorconfig-vim'
Plug 'sheerun/vim-polyglot'
call plug#end()
"== General
@ -29,7 +26,6 @@ set expandtab
set autoindent
" Status line
"set laststatus=0
set noshowmode showcmd
set ruler
@ -51,6 +47,12 @@ set incsearch
set ignorecase
set smartcase
" Enable mode line
set modeline
" Auto reload file
set autoread
" Buffer
set hidden
@ -66,8 +68,8 @@ set visualbell t_vb=
" == Settings for specific files
autocmd BufWritePre *.py normal m`:%s/\s\+$//e ``
autocmd FileType python,go setlocal expandtab shiftwidth=4 tabstop=4
autocmd FileType html,css,javascript setlocal expandtab shiftwidth=2 tabstop=2
autocmd FileType python,go,json setlocal expandtab shiftwidth=4 tabstop=4
autocmd FileType html,css,javascript,yaml setlocal expandtab shiftwidth=2 tabstop=2
"== Aliases
@ -75,8 +77,12 @@ command! W :w
command! Q :q
command! Wq :wq
command! WQ :wq
command! Prettier :!prettier %
command! Wiki :e ~/doc/index.md
command! Prettier :!prettier --write %
command! ESlint :!eslint %
command! Flake8 :!flake8 %
command! Black :!black %
command! AutoPep8 :!autopep8 --in-place %
"== Plug in configuration
@ -90,36 +96,28 @@ let g:lightline = {
\ [ 'filename', 'filetype' ] ]
\ }, }
let g:ale_disable_lsp = 1
let g:ale_sign_error = '> '
let g:ale_sign_warning = '- '
let g:ale_echo_msg_format = '%severity%: %s'
let g:ale_linter = {
\ 'javascript': 'eslint',
\ 'python': 'flake8'
\ }
let g:ale_fix_on_save = 1
let g:ale_fixers = {
\ 'javascript': 'prettier',
\ 'python': 'black'
\ }
"== Mapping
let mapleader="'"
noremap <C-s> :w<CR>
" Window
noremap <C-h> :wincmd h<CR>
noremap <C-j> :wincmd j<CR>
noremap <C-k> :wincmd k<CR>
noremap <C-l> :wincmd l<CR>
noremap <A-z> :wincmd K<CR>
noremap <A-x> :wincmd L<CR>
noremap <A-c> :wincmd n<CR>
" Split
noremap spv :vsp<CR>
noremap sph :sp<CR>
noremap spk :wincmd K<CR>
noremap spl :wincmd L<CR>
noremap spn :wincmd n<CR>
" Tab
noremap <C-t> :tabnew<CR>
noremap <C-w> :tabclose<CR>
noremap tn :tabnew<CR>
noremap tc :tabclose<CR>
noremap <A-1> :tabn 1<CR>
noremap <A-2> :tabn 2<CR>
noremap <A-3> :tabn 3<CR>
@ -131,9 +129,9 @@ noremap <A-8> :tabn 8<CR>
noremap <A-9> :tabn 9<CR>
" Buffer
noremap <C-b> :bnext<CR>
noremap <C-p> :bprev<CR>
noremap Bn :bnext<CR>
noremap Bp :bprev<CR>
" Work with system clipboard
noremap <leader>c "*y<CR>
noremap <leader>v "+p<CR>
noremap <leader>y "*yy<CR>
noremap <leader>p "+p<CR>

View file

@ -1,3 +1,5 @@
# vim: ft=dosini
[settings]
enable-ipc = true
screenchange-reload = true

View file

@ -140,7 +140,7 @@ map gb cd ~/docs/books
map gm cd ~/.dotfiles
map gn cd ~/bin
map gs cd ~/.script
map gv cd ~/virt
map gv cd /media/veracrypt1
map gw cd ~/downl
# Console

View file

@ -0,0 +1,22 @@
configuration {
width: 25;
lines: 13;
columns: 2;
font: "RobotoCondensed 12";
bw: 2;
location: 1;
padding: 3;
yoffset: 27;
xoffset: 3;
show-icons: true;
icon-theme: "Paper";
drun-display-format: "{name}";
case-sensitive: false;
cycle: false;
auto-select: false;
line-padding: 6;
separator-style: "solid";
hide-scrollbar: true;
color-normal: "#262A2B,#abb2bf,#262A2B,#008DCD,#262A2B";
color-window: "#262A2B,#1F2324,#58676C";
}