Update bspwm. Add CoC plug in vim

This commit is contained in:
Smirnov Olexandr 2021-01-31 14:01:25 +02:00
parent 7a0f05c664
commit 64007489ce
14 changed files with 112 additions and 113 deletions

View file

@ -4,16 +4,16 @@
## == Function
Run() {
if ! pgrep $1
then $@& fi
if ! pgrep $1
then $@& fi
}
## == 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 &
~/.config/bspwm/bar.sh &
Run nitrogen --restore &
~/.script/autolock &
Run ~/.script/autolock &
Run lxsession &
Run picom -b &
@ -30,7 +30,6 @@ bspc config borderless_monocle true
bspc config gapless_monocle true
bspc config single_monocle true
bspc config focus_follows_pointer true
bspc config borderless_monocle true
# Colors
bspc config normal_border_color "#262A2B"
@ -42,13 +41,14 @@ 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=off
bspc rule -a VSCodium desktop='^3' focus=on follow=on
bspc rule -a firefox desktop='^2' focus=on follow=off
bspc rule -a VSCodium 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=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=off
bspc rule -a discord descord='^6' focus=on
bspc rule -a TelegramDesktop descord='^6' focus=off
bspc rule -a Spotify descord='^9' focus=on
bspc rule -a google-tasks-desktop state=floating
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

View file

@ -7,8 +7,8 @@ pseudo-transparency = true
[colors]
background = #262A2B
foreground = #DFDFDF
secondary = #008DCD
alert = #FF6C6B
secondary = #008DCD
alert = #FF6C6B
[bar/bar]
width = 100%
@ -19,7 +19,7 @@ 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 = powermenu windowname
modules-left = windowname
modules-center = bspwm
modules-right = pulseaudio archupd wifi-signal weather memory cpu keyboard time date
tray-position = right

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 MiB

View file

@ -2,52 +2,27 @@
# BSPWM/SXKBD config file
## == USER Applications
super + Return
kitty
super + {_,shift} Return
{alacritty, \
rofi -show drun }
super + shift + w
firefox
super + shift + {w,f,e,c,q}
{firefox, \
alacritty --class=ranger -e ranger, \
alacritty --class=nvim -e nvim, \
subl, \
xkill }
super + shift + f
kitty --class=ranger -e ranger
super + shift + z
betterlockscreen --off 180 -t "Computer is lokerd" -l
super + shift + e
kitty --class=nvim -e nvim
super + shift + c
vscodium
super + shift + d
org.zealdocs.Zeal
super + shift + q
xkill
## == USER volume
super + minus
amixer sset Master 2%-
super + equal
amixer sset Master 2%+
super + shift + minus
amixer sset Master toggle
## == USER Menus
super + shift + Return
rofi -location 2 -show drun
super + Escape
~/.script/dmenu/dmenu-power.sh
super + ctrl + i
~/.script/dmenu/dmenu-pass.sh
super + ctrl + u
~/.script/dmenu/dmenu-config-edit.sh
super + {equal, minus, shift + minus}
amixer sset Master {2%+,2%-,toggle}
super + {Escape, ctrl + u, ctrl + i}
{./.script/dmenu/dmenu-power.sh, \
./.script/dmenu/dmenu-config-edit.sh, \
./.script/dmenu/dmenu-pass.sh }
## == BSPWM keys
super + q
@ -66,35 +41,21 @@ super + ctrl + {h,j,k,l}
super + {_,shift + }{h,j,k,l}
bspc node -{f,s} {west,south,north,east}
# Change focus window
super + {_,shift + }c
bspc node -f {next,prev}.local.!hidden.window
# Preselect the direction
super + alt + {h,j,k,l}
bspc node -p {west,south,north,east}
# Preselect the ratio
super + alt + {1-9}
bspc node -o 0.{1-9}
# Cancel the preselection
super + ctrl + space
super + alt + {space,0}
bspc node -p cancel
## == BSPWM workspace
## Next/Prev workspace
super + bracket{left,right}
bspc desktop -f {prev,next}.local
# Change WP & send window to WP
super + {_,shift + }{1-9}
bspc {desktop -f,node -d} focused:'^{1-9}'
## == BSPWM windwo layouts
# Set window layouts for specific window
super + {t,shift + t,s,f}
bspc node -t {tiled,pseudo_tiled,floating,fullscreen}
super + ctrl + {t, s, f}
bspc node -t {tiled,floating,fullscreen}
# Change windows layout
super + ctrl + {m,x,y,z}

View file

@ -21,10 +21,9 @@ set $browser firefox
set $filemanager alacritty -e ranger
set $codeeditor alacritty -e nvim
set $guicode vscodium
set $documentationreader org.zealdocs.Zeal
############ Autostart ############
exec --no-startup-id exec setxkbmap "us,ua" ",winkeys" "grp:alt_shift_toggle" -option "ctrl:nocaps"
exec_always --no-startup-id exec setxkbmap "us,ua" ",winkeys" "grp:alt_shift_toggle" -option "ctrl:nocaps"
exec_always --no-startup-id exec picom --experimental-backends -b
exec_always --no-startup-id exec $HOME/.config/i3/bar.sh
exec --no-startup-id exec nitrogen --restore

View file

@ -0,0 +1,22 @@
{
// Snippets
"snippets.ultisnips.directories": [
"snips"
],
"snippets.userSnippetsDirectory": "~/.config/nvim",
// Emmet
"emmet.includeLanguages": {
"javascript": "javascriptreact"
},
// Autoload
"coc.preferences.hoverTarget": "float",
"coc.preferences.formatOnSaveFiletypes": [
"css",
"html",
"markdown",
"yaml",
"json",
"javascript",
"pytnon"
]
}

View file

@ -3,32 +3,28 @@ call plug#begin('~/.vim/plugged')
Plug 'itchyny/lightline.vim' " Status line
Plug 'maximbaz/lightline-ale' " ALE in status line
Plug 'airblade/vim-gitgutter' " Git indicator
Plug 'ap/vim-css-color' " HEX/CSS color preview
Plug 'mbbill/undotree' " Git like history
Plug 'ap/vim-css-color' " CSS color preview
Plug 'mhinz/vim-startify' " Start page
Plug 'scrooloose/nerdtree' " File manager
Plug 'dense-analysis/ale' " Linter
Plug 'kassio/neoterm' " Terminal wrapper
Plug 'metakirby5/codi.vim' " Live REPL
Plug 'editorconfig/editorconfig-vim' " EditorConfig support
Plug 'christoomey/vim-tmux-navigator' " Jump from vim to tmux and back
Plug 'Xuyuanp/nerdtree-git-plugin' " NERDTree git status
Plug 'preservim/nerdcommenter' " Code commenter
" NERDTree
Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'}
Plug 'Xuyuanp/nerdtree-git-plugin', {'on': 'NERDTreeToggle'}
" Completion & snippets
Plug 'ervandew/supertab'
Plug 'neoclide/coc.nvim'
Plug 'jiangmiao/auto-pairs'
Plug 'SirVer/ultisnips'
Plug 'mattn/emmet-vim', {'for': ['html', 'javascript']}
" Language support
Plug 'metakirby5/codi.vim', {'on': 'Codi'} " Live REPL
Plug 'othree/yajs.vim', {'for': 'javascript'}
Plug 'maxmellon/vim-jsx-pretty', {'for': 'javascript'}
Plug 'vim-python/python-syntax', {'for': 'python'}
Plug 'cakebaker/scss-syntax.vim', {'for': ['scss', 'sass']}
Plug 'plasticboy/vim-markdown', {'for': 'markdown'}
Plug 'plasticboy/vim-markdown', {'for': 'markdown'}
Plug 'PotatoesMaster/i3-vim-syntax', {'for': 'i3'}
Plug 'kovetskiy/sxhkd-vim', {'for': 'sxhkd'}
call plug#end()
@ -133,17 +129,22 @@ let NERDTreeMinimalUI=1
let NERDTreeShowHidden=0
let g:NERDTreeWinSize = 28
" Emmet
"let g:user_emmet_expandabbr_key='<tab>'
let g:user_emmet_leader_key=','
let g:user_emmet_mode='inv'
" UltiSnipts
let g:UltiSnipsExpandTrigger = "<tab>"
let g:UltiSnipsEditSplit = "vertical"
let g:UltiSnipsJumpForwardTrigger = "<tab>"
let g:UltiSnipsJumpBackwardTrigger = "<C-tab>"
let g:UltiSnipsSnippetDirectories = ["snips"]
" Coc
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
let g:coc_global_config="$HOME/.config/nvim/coc-settings.json"
imap <C-l> <Plug>(coc-snippets-expand)
vmap <C-j> <Plug>(coc-snippets-select)
let g:coc_global_extensions = [ 'coc-snippets',
\ 'coc-emmet',
\ 'coc-html',
\ 'coc-css',
\ 'coc-yaml',
\ 'coc-json',
\ 'coc-tsserver',
\ 'coc-eslint',
\ 'coc-prettier',
\ ]
" Startify
let g:startify_custom_header = [
@ -172,6 +173,10 @@ nmap <A-z> :wincmd K<CR>
nmap <A-x> :wincmd L<CR>
nmap <A-c> :wincmd n<CR>
" C-j/k as up/dwon in menu
inoremap <expr> <C-j> ("\<C-n>")
inoremap <expr> <C-k> ("\<C-p>")
" Tab(s)
noremap <C-Tab> :tabnext<CR>
noremap <C-S-Tab> :tabprev<CR>

View file

@ -2,6 +2,12 @@ priority -50
snippet #! "Shebang"
#!/usr/bin/env python
${1}
endsnippet
snippet ! "Shebang"
#!/bin/python
${1}
endsnippet
snippet ifmain "If __main...."

View file

@ -164,6 +164,7 @@ for i, (name, kwargs) in enumerate(group_names, 1):
keys.append(Key([mod], str(i), lazy.group[name].toscreen()))
keys.append(Key([mod, "shift"], str(i), lazy.window.togroup(name)))
# Window layout(s)
layout_theme = {
"border_width": 2,
@ -188,6 +189,7 @@ layouts = [
# layout.Zoomy(),
]
# Panel
widget_defaults = dict(
font="Jatbrains Mono",
@ -238,13 +240,20 @@ screens = [Screen(top=bar.Bar([
)], 24 # Panel size
))]
# Drag floating layouts
mouse = [
Drag([mod], "Button1", lazy.window.set_position(), start=lazy.window.get_position()),
Drag([mod], "Button3", lazy.window.set_size_floating(), start=lazy.window.get_size()),
Click([mod], "Button2", lazy.window.bring_to_front())
Drag([mod], "Button1",
lazy.window.set_position(),
start=lazy.window.get_position()),
Drag([mod], "Button3",
lazy.window.set_size_floating(),
start=lazy.window.get_size()),
Click([mod], "Button2",
lazy.window.bring_to_front())
]
dgroups_key_binder = None
dgroups_app_rules = []
main = None

View file

@ -1,6 +0,0 @@
#/bin/sh
case "$(xkblayout)" in
"Eng") echo "us" ;;
"Rus") echo "ru" ;;
"Ukr") echo "ua" ;;
esac