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

@ -5,12 +5,12 @@
#### System configuration
- `OS` Arch
- `WM` bspwm, qtile
- `WM` bspwm
- `Terminal` alacritty
- `Shell` zsh
- `Editor` nvim, vscode
- `File manager` ranger
- `Browser` firefox,
- `Browser` firefox
- `Font` Jatbrains Mono
- `Icon font` FontAwesome
- `Launcher` rofi

View file

@ -15,11 +15,11 @@ shell=$(basename $SHELL)
manager=$(which apt pacman yay apk xbps-query 2>/dev/null)
manager=${manager##*/}
case "$manager" in
apt) packages="$(dpkg-query -f '${binary:Package}\n' -W | wc -l)";;
pacman) packages="$(pacman -Q | wc -l)";;
yay) packages="$(yay -Q | wc -l)";;
apk) packages="$(apk list --installed | wc -l)";;
xbps-query) packages="$(xbps-query -l | wc -l)";;
apt) packages="$(dpkg-query -f '${binary:Package}\n' -W | wc -l)";;
pacman) packages="$(pacman -Q | wc -l)";;
yay) packages="$(yay -Q | wc -l)";;
apk) packages="$(apk list --installed | wc -l)";;
xbps-query) packages="$(xbps-query -l | wc -l)";;
esac

View file

@ -1,6 +1,6 @@
#!/bin/sh
case "$1" in
"on"|"-on"|"--on"|1) xset led on ;;
"on"|"-on"|"--on"|1) xset led on ;;
"of"|"off"|"-off"|"--off"|0) xset led off ;;
esac

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
@ -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

@ -3,18 +3,19 @@
## == 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";
}

View file

@ -15,13 +15,18 @@ set -g history-limit 1000
set -g mouse on
setw -g mouse on
## 256 color support
set -g default-terminal "screen-256color"
set-option -sa terminal-overrides ",*:Tc"
###== Keybindongs
## HOME/END key support
bind-key -n Home send Escape "OH"
bind-key -n End send Escape "OF"
bind -n End send-key C-e
bind -n Home send-key C-a
bind-key -n Home send Escape "OH"
bind-key -n End send Escape "OF"
## Reload config
bind r source-file ~/.tmux.conf \; display 'Reloaded tmux config'

View file

@ -1,7 +1,7 @@
{
// Apperence
"workbench.colorTheme": "One Dark Pro",
"workbench.iconTheme": "vscode-icons",
"workbench.colorTheme": "Ayu Dark Bordered",
"workbench.iconTheme": "ayu",
"editor.fontFamily": "'Jetbrain Mono', 'FontAwesome5Free', 'Droid Sans Mono', 'monospace', 'Droid Sans Fallback'",
"editor.wordWrap": "off",
"editor.fontSize": 14,
@ -10,13 +10,19 @@
"editor.tabCompletion": "on",
"editor.tabSize": 4,
"editor.formatOnSave": false,
"files.autoSave": "afterDelay",
"workbench.startupEditor": "newUntitledFile",
// Vim
"vim.easymotion": true,
"vim.surround": true,
"vim.useSystemClipboard": true,
"vim.insertModeKeyBindings": [
{"before": ["j", "j"],
"after" : ["<Esc>"]}],
"after" : ["<Esc>"]},
{"before": ["Ctrl", "Shift", "e"],
"commands": ["workbench.view.explorer"]},
],
"vim.normalModeKeyBindings": [
{"before": ["f"],
"after" : ["leader","leader","s"]}
@ -32,8 +38,6 @@
"**/venv": true,
"**/env": true,
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/node_modules": true
@ -42,10 +46,12 @@
// Minimap
"editor.minimap.side": "left",
"editor.minimap.size": "fit",
"editor.minimap.enabled": false,
// Sidebar
"workbench.sideBar.location": "right",
"workbench.activityBar.visible": true,
// File menu
"window.menuBarVisibility": "hidden",
@ -54,6 +60,8 @@
"python.linting.flake8Enabled": true,
"python.linting.enabled": true,
"python.formatting.provider": "autopep8",
// JS
"javascript.updateImportsOnFileMove.enabled": "never",
// Emmet
"emmet.includeLanguages": {
@ -78,6 +86,12 @@
"editor.formatOnSave": true,
"editor.formatOnPaste": true
},
"[javascriptreact]": {
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.tabSize": 2,
"editor.defaultFormatter": "esbenp.prettier-vscode",
},
"[markdown]": {
"editor.wordWrap": "on",
"editor.quickSuggestions": false
@ -88,14 +102,18 @@
},
"[css]": {
"editor.tabSize": 2,
"editor.suggest.insertMode": "replace"
"editor.suggest.insertMode": "replace",
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
},
"[scss]": {
"editor.tabSize": 2,
"editor.suggest.insertMode": "replace"
"editor.suggest.insertMode": "replace",
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"workbench.startupEditor": "newUntitledFile",
"git.autofetch": true,
}

36
zshrc
View file

@ -1,9 +1,8 @@
export ZSH="$HOME/.oh-my-zsh"
export PATH="$HOME/.yarn/bin:$HOME/bin:$HOME/.local/bin:$GOPATH/bin:$PATH"
source ~/.profile
export PATH="$HOME/.yarn/bin:$HOME/bin:$HOME/.application:$PATH"
### Oh my zsh ###
ZSH_THEME="nten" # Set theme.
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="simple" # Set theme.
#CASE_SENSITIVE="true" # Use case-sensitive completion.
#HYPHEN_INSENSITIVE="true" # Case-sensitive completion must be off.
#DISABLE_AUTO_UPDATE="true" # Disable bi-weekly auto-update checks.
@ -12,37 +11,32 @@ DISABLE_UPDATE_PROMPT="true" # Automatically update without prompting.
#DISABLE_LS_COLORS="true" # Disable colors in ls.
DISABLE_AUTO_TITLE="true" # Disable auto-setting terminal title.
#ENABLE_CORRECTION="true" # Enable command auto-correction.
COMPLETION_WAITING_DOTS="true" # Display red dots whilst waiting for completion.
#COMPLETION_WAITING_DOTS="true" # Display red dots whilst waiting for completion.
export UPDATE_ZSH_DAYS=7 # Change how often to auto-update.
export LANG=en_US.UTF-8 # Set locale
plugins=(python pip node npm yarn pass sudo git)
plugins=(yarn)
source $ZSH/oh-my-zsh.sh
### Variables ###
### Variables
export EDITOR="nvim"
export VISUAL="nvim"
### Aliases ###
### Functions
bgcolor() {
convert -size 1x1 xc:"$1" /tmp/bgc.png
feh --bg-tile /tmp/bgc.png}
backup() {
cp $1 $1.bak}
### Aliases
alias cls="clear"
alias mkdir="mkdir -p"
alias cp="cp -r"
alias du="du -sh"
alias df="df -h"
# Program
alias vim="nvim"
alias vi="nvim"
alias vi="vim"
alias tmux="tmux -2"
# Exit
alias :q="exit"
alias q="exit"
# Navigation
alias ..="cd .."
alias ...="cd ../.."
alias .3="cd ../../.."
alias .4="cd ../../../.."
alias .5="cd ../../../../.."
alias .6="cd ../../../../../.."