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 #### System configuration
- `OS` Arch - `OS` Arch
- `WM` bspwm, qtile - `WM` bspwm
- `Terminal` alacritty - `Terminal` alacritty
- `Shell` zsh - `Shell` zsh
- `Editor` nvim, vscode - `Editor` nvim, vscode
- `File manager` ranger - `File manager` ranger
- `Browser` firefox, - `Browser` firefox
- `Font` Jatbrains Mono - `Font` Jatbrains Mono
- `Icon font` FontAwesome - `Icon font` FontAwesome
- `Launcher` rofi - `Launcher` rofi

View file

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

View file

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

View file

@ -3,18 +3,19 @@
## == USER keys ## == USER keys
super + {_,shift} Return super + {_,shift} Return
{alacritty, \ {kitty, \
rofi -show drun } rofi -show drun -theme ntenV2}
super + shift + {w,f,e,c,q} super + shift + {w,f,e,c,v,q}
{firefox, \ {google-chrome-stable, \
alacritty --class=ranger -e ranger, \ alacritty --class=ranger -e ranger, \
alacritty --class=nvim -e nvim, \ alacritty --class=nvim -e nvim, \
code, \ code, \
veracrypt, \
xkill } xkill }
super + shift + z super + shift + z
betterlockscreen --off 180 -t "Computer is lokerd" -l betterlockscreen --off 180 -t "Computer is locked" -l
super + {equal, minus, shift+minus} super + {equal, minus, shift+minus}
amixer sset Master {2%+,2%-,toggle} amixer sset Master {2%+,2%-,toggle}
@ -26,10 +27,11 @@ super + {Escape, ctrl + u, ctrl + i}
### == BSPWM keys ### == BSPWM keys
super + q super + q
bspc node -{c,k} bspc node -c
super + control + r super + control + r
bspc wm -r && pkill -USR1 -x sxhkd bspc wm -r \
pkill -USR1 -x sxhkd
### == BSPWM windows ### == BSPWM windows
## Resize window ## Resize window
@ -43,8 +45,10 @@ super + {_,shift + }{h,j,k,l}
# Preselect the direction # Preselect the direction
super + alt + {h,j,k,l} super + alt + {h,j,k,l}
bspc node -p {west,south,north,east} bspc node -p {west,south,north,east}
super + alt + {1-9} super + alt + {1-9}
bspc node -o 0.{1-9} bspc node -o 0.{1-9}
super + alt + {space,0} super + alt + {space,0}
bspc node -p cancel bspc node -p cancel
@ -52,10 +56,11 @@ super + alt + {space,0}
super + {_,shift + }{1-9} super + {_,shift + }{1-9}
bspc {desktop -f,node -d} focused:'^{1-9}' bspc {desktop -f,node -d} focused:'^{1-9}'
## == BSPWM windwo layouts ## == BSPWM window layouts
super + ctrl + {t, s, f} super + shift + {Tab, F11}
bspc node -t {tiled,floating,fullscreen} bspc node -t {floating,fullscreen}
# Change windows layout super + Tab
super + ctrl + {m,x,y,z} bspc node -t tiled
bspc node -g {marked,locked,sticky,private}
# 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 'itchyny/lightline.vim'
Plug 'jiangmiao/auto-pairs' Plug 'jiangmiao/auto-pairs'
Plug 'maxboisvert/vim-simple-complete' Plug 'maxboisvert/vim-simple-complete'
Plug 'pangloss/vim-javascript' Plug 'sheerun/vim-polyglot'
Plug 'airblade/vim-gitgutter'
Plug 'dense-analysis/ale'
"Plug 'editorconfig/editorconfig-vim'
call plug#end() call plug#end()
"== General "== General
@ -29,7 +26,6 @@ set expandtab
set autoindent set autoindent
" Status line " Status line
"set laststatus=0
set noshowmode showcmd set noshowmode showcmd
set ruler set ruler
@ -51,6 +47,12 @@ set incsearch
set ignorecase set ignorecase
set smartcase set smartcase
" Enable mode line
set modeline
" Auto reload file
set autoread
" Buffer " Buffer
set hidden set hidden
@ -66,8 +68,8 @@ set visualbell t_vb=
" == Settings for specific files " == Settings for specific files
autocmd BufWritePre *.py normal m`:%s/\s\+$//e `` autocmd BufWritePre *.py normal m`:%s/\s\+$//e ``
autocmd FileType python,go setlocal expandtab shiftwidth=4 tabstop=4 autocmd FileType python,go,json setlocal expandtab shiftwidth=4 tabstop=4
autocmd FileType html,css,javascript setlocal expandtab shiftwidth=2 tabstop=2 autocmd FileType html,css,javascript,yaml setlocal expandtab shiftwidth=2 tabstop=2
"== Aliases "== Aliases
@ -75,8 +77,12 @@ command! W :w
command! Q :q command! Q :q
command! Wq :wq command! Wq :wq
command! WQ :wq command! WQ :wq
command! Prettier :!prettier % command! Wiki :e ~/doc/index.md
command! Prettier :!prettier --write %
command! ESlint :!eslint % command! ESlint :!eslint %
command! Flake8 :!flake8 %
command! Black :!black %
command! AutoPep8 :!autopep8 --in-place %
"== Plug in configuration "== Plug in configuration
@ -90,36 +96,28 @@ let g:lightline = {
\ [ 'filename', 'filetype' ] ] \ [ '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 "== Mapping
let mapleader="'" let mapleader="'"
noremap <C-s> :w<CR>
" Window " Window
noremap <C-h> :wincmd h<CR> noremap <C-h> :wincmd h<CR>
noremap <C-j> :wincmd j<CR> noremap <C-j> :wincmd j<CR>
noremap <C-k> :wincmd k<CR> noremap <C-k> :wincmd k<CR>
noremap <C-l> :wincmd l<CR> noremap <C-l> :wincmd l<CR>
noremap <A-z> :wincmd K<CR>
noremap <A-x> :wincmd L<CR> " Split
noremap <A-c> :wincmd n<CR> noremap spv :vsp<CR>
noremap sph :sp<CR>
noremap spk :wincmd K<CR>
noremap spl :wincmd L<CR>
noremap spn :wincmd n<CR>
" Tab " Tab
noremap <C-t> :tabnew<CR> noremap tn :tabnew<CR>
noremap <C-w> :tabclose<CR> noremap tc :tabclose<CR>
noremap <A-1> :tabn 1<CR> noremap <A-1> :tabn 1<CR>
noremap <A-2> :tabn 2<CR> noremap <A-2> :tabn 2<CR>
noremap <A-3> :tabn 3<CR> noremap <A-3> :tabn 3<CR>
@ -131,9 +129,9 @@ noremap <A-8> :tabn 8<CR>
noremap <A-9> :tabn 9<CR> noremap <A-9> :tabn 9<CR>
" Buffer " Buffer
noremap <C-b> :bnext<CR> noremap Bn :bnext<CR>
noremap <C-p> :bprev<CR> noremap Bp :bprev<CR>
" Work with system clipboard " Work with system clipboard
noremap <leader>c "*y<CR> noremap <leader>y "*yy<CR>
noremap <leader>v "+p<CR> noremap <leader>p "+p<CR>

View file

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

View file

@ -140,7 +140,7 @@ map gb cd ~/docs/books
map gm cd ~/.dotfiles map gm cd ~/.dotfiles
map gn cd ~/bin map gn cd ~/bin
map gs cd ~/.script map gs cd ~/.script
map gv cd ~/virt map gv cd /media/veracrypt1
map gw cd ~/downl map gw cd ~/downl
# Console # 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 set -g mouse on
setw -g mouse on setw -g mouse on
## 256 color support
set -g default-terminal "screen-256color"
set-option -sa terminal-overrides ",*:Tc"
###== Keybindongs ###== Keybindongs
## HOME/END key support ## 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 End send-key C-e
bind -n Home send-key C-a bind -n Home send-key C-a
bind-key -n Home send Escape "OH"
bind-key -n End send Escape "OF"
## Reload config ## Reload config
bind r source-file ~/.tmux.conf \; display 'Reloaded tmux config' bind r source-file ~/.tmux.conf \; display 'Reloaded tmux config'

View file

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

36
zshrc
View file

@ -1,9 +1,8 @@
export ZSH="$HOME/.oh-my-zsh" export PATH="$HOME/.yarn/bin:$HOME/bin:$HOME/.application:$PATH"
export PATH="$HOME/.yarn/bin:$HOME/bin:$HOME/.local/bin:$GOPATH/bin:$PATH"
source ~/.profile
### Oh my zsh ### ### 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. #CASE_SENSITIVE="true" # Use case-sensitive completion.
#HYPHEN_INSENSITIVE="true" # Case-sensitive completion must be off. #HYPHEN_INSENSITIVE="true" # Case-sensitive completion must be off.
#DISABLE_AUTO_UPDATE="true" # Disable bi-weekly auto-update checks. #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_LS_COLORS="true" # Disable colors in ls.
DISABLE_AUTO_TITLE="true" # Disable auto-setting terminal title. DISABLE_AUTO_TITLE="true" # Disable auto-setting terminal title.
#ENABLE_CORRECTION="true" # Enable command auto-correction. #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 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 source $ZSH/oh-my-zsh.sh
### Variables ### ### Variables
export EDITOR="nvim" export EDITOR="nvim"
export VISUAL="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 cls="clear"
alias mkdir="mkdir -p" alias mkdir="mkdir -p"
alias cp="cp -r" alias cp="cp -r"
alias du="du -sh" alias du="du -sh"
alias df="df -h" alias df="df -h"
# Program
alias vim="nvim" alias vim="nvim"
alias vi="nvim" alias vi="vim"
alias tmux="tmux -2" alias tmux="tmux -2"
# Exit
alias :q="exit" alias :q="exit"
alias q="exit"
# Navigation
alias ..="cd .." alias ..="cd .."
alias ...="cd ../.." alias ...="cd ../.."
alias .3="cd ../../.."
alias .4="cd ../../../.."
alias .5="cd ../../../../.."
alias .6="cd ../../../../../.."