all repos

dotfiles @ 25b4e80

i use rach linux btw
10 files changed, 194 insertions(+), 46 deletions(-)
Addd snippets for vim, update i3 hotkeys
Author: Smirnov Olexandr ss2316544@gmail.com
Committed at: 2021-01-12 16:47:13 +0200
Parent: f7c0cef
M config/i3/config
···
        19
        19
         set $terminal alacritty

      
        20
        20
         set $browser firefox 

      
        21
        21
         set $filemanager thunar

      
        22
        
        -set $guieditor emacs

      
        
        22
        +set $codeeditor alacritty -e nvim

      
        23
        23
         

      
        24
        24
         ############ Autostart ############

      
        
        25
        +exec --no-startup-id exec setxkbmap "us,ua" ",winkeys" "grp:alt_shift_toggle" -option "ctrl:nocaps"

      
        25
        26
         exec --no-startup-id exec picom --experimental-backends -b

      
        
        27
        +exec_always --no-startup-id exec $HOME/.config/i3/bar.sh

      
        26
        28
         exec --no-startup-id exec nitrogen --restore

      
        27
        
        -exec --no-startup-id exec setxkbmap "us,ua" ",winkeys" "grp:alt_shift_toggle" -option "ctrl:nocaps"

      
        28
        
        -exec --no-startup-id exec org.telegram.desktop

      
        29
        29
         exec --no-startup-id exec lxsession

      
        30
        
        -exec_always --no-startup-id exec $HOME/.script/autolock

      
        31
        
        -exec_always --no-startup-id exec $HOME/.config/i3/bar.sh

      
        32
        
        -exec --no-startup-id exec discord

      
        
        30
        +exec --no-startup-id exec $HOME/.script/autolock

      
        
        31
        +#exec --no-startup-id exec org.telegram.desktop

      
        
        32
        +#exec --no-startup-id exec discord

      
        33
        33
         #exec --no-startup-id exec conky

      
        34
        34
         #exec --no-startup-id exec redshift-gtk

      
        35
        35
         

      ···
        42
        42
         # Restart i3wm

      
        43
        43
         bindsym $mod+Control+r restart

      
        44
        44
         

      
        45
        
        -# Reload i3wm

      
        46
        
        -bindsym $mod+Shift+r reload

      
        47
        
        -

      
        48
        45
         # Floating layout

      
        49
        
        -bindsym $mod+Tab floating toggle

      
        
        46
        +bindsym $mod+Shift+Tab floating toggle

      
        50
        47
         

      
        51
        48
         # Tab layout

      
        52
        
        -bindsym $mod+Shift+w layout tabbed

      
        
        49
        +bindsym $mod+Control+w layout tabbed

      
        53
        50
         

      
        54
        51
         # Split layout

      
        55
        
        -bindsym $mod+Shift+e layout toggle split

      
        
        52
        +bindsym $mod+Control+e layout toggle split

      
        56
        53
         

      
        57
        54
         # Splits

      
        58
        
        -bindsym $mod+b split h

      
        59
        
        -bindsym $mod+v split v

      
        
        55
        +#bindsym $mod+b split h

      
        
        56
        +#bindsym $mod+v split v

      
        60
        57
         

      
        61
        58
         # Scratchpad

      
        62
        59
         bindsym $mod+Shift+grave move scratchpad

      ···
        73
        70
         

      
        74
        71
         # Apps

      
        75
        72
         bindsym $mod+Return exec $terminal

      
        76
        
        -bindsym $mod+F2 exec $browser 

      
        77
        
        -bindsym $mod+f exec $filemanager

      
        78
        
        -bindsym $mod+d exec $guieditor

      
        
        73
        +bindsym $mod+Shift+w exec $browser 

      
        
        74
        +bindsym $mod+Shift+f exec $filemanager

      
        
        75
        +bindsym $mod+Shift+e exec $codeeditor

      
        
        76
        +

      
        
        77
        +# Toogle polybar

      
        
        78
        +bindsym $mod+b exec ~/.script/polybar-toggle

      
        79
        79
         

      
        80
        80
         # Sceenshot

      
        81
        
        -bindsym --release Print exec "scrot -s /home/${USER}/$(date +%Y-%m-%d-%H-%M-%S).png"

      
        82
        
        -bindsym --release Shift+Print exec "scrot /home/${USER}/$(date +%Y-%m-%d-%H-%M-%S).png"

      
        
        81
        +bindsym --release Print exec scrot -s /home/${USER}/$(date +%Y-%m-%d-%H-%M-%S).png

      
        
        82
        +bindsym --release Shift+Print exec scrot /home/${USER}/$(date +%Y-%m-%d-%H-%M-%S).png

      
        83
        83
         

      
        84
        84
         # Lockscreen

      
        85
        
        -bindsym $mod+Shift+z exec betterlockscreen --off 180 -t \"Computer is lockerd\" -l

      
        
        85
        +bindsym $mod+Shift+z exec betterlockscreen --off 180 -t "Computer is lockerd" -l

      
        86
        86
         

      
        87
        87
         # Volume

      
        88
        
        -bindsym $mod+plus exec "pactl set-sink-volume alsa_output.pci-0000_00_1b.0.analog-stereo +2%"

      
        89
        
        -bindsym $mod+minus exec "pactl set-sink-volume alsa_output.pci-0000_00_1b.0.analog-stereo  -2%"

      
        90
        
        -bindsym $mod+Shift+minus exec "pactl set-sink-mute alsa_output.pci-0000_00_1b.0.analog-stereo toggle"

      
        
        88
        +bindsym $mod+plus exec "amixer sset Master 2%+"

      
        
        89
        +bindsym $mod+minus exec "amixer sset Master 2%-"

      
        
        90
        +bindsym $mod+Shift+minus exec "amixer sset Master toggle"

      
        91
        91
         

      
        92
        92
         ######### Window preferens ########

      
        93
        93
         assign [class="(?i)telegram|discord"] $ws6

      
        94
        94
         for_window [class="(?i)telegram|discord"] layout tabbed

      
        95
        
        -#focus_on_window_activation focus

      
        
        95
        +focus_on_window_activation focus

      
        96
        96
         

      
        97
        97
         ########## Change focus ###########

      
        98
        98
         bindsym $mod+h focus left

      
A config/nvim/UltiSnips/go.snippets
···
        
        1
        +snippet pkg "Package"

      
        
        2
        +package ${1:main}

      
        
        3
        +endsnippet

      
        
        4
        +

      
        
        5
        +snippet import "Import section"

      
        
        6
        +import (

      
        
        7
        +	${1}

      
        
        8
        +)

      
        
        9
        +endsnippet

      
        
        10
        +

      
        
        11
        +snippet for "For loop"

      
        
        12
        +for ${1:i\:\=1}; ${2:i\<\=10}; ${3:\i\+\+} {

      
        
        13
        +	${4}

      
        
        14
        +}

      
        
        15
        +endsnippet

      
        
        16
        +

      
        
        17
        +snippet var "Variable declaration"

      
        
        18
        +var ${1:name}${2/(.+)/ /}${2:type}${3: = ${0:value}}

      
        
        19
        +endsnippet

      
        
        20
        +

      
        
        21
        +snippet vars "Variables declaration"

      
        
        22
        +var (

      
        
        23
        +	${1:name}${2/(.+)/ /}${2:type}${3: = ${0:value} }

      
        
        24
        +)

      
        
        25
        +endsnippet

      
        
        26
        +

      
        
        27
        +snippet const "Constant declaration"

      
        
        28
        +const ${1:name}${2/(.+)/ /}${2:type} = ${0:value}

      
        
        29
        +endsnippet

      
        
        30
        +

      
        
        31
        +snippet consts "Constants declaration"

      
        
        32
        +const (

      
        
        33
        +	${1:constant}${2/(.+)/ /}${2:type} = ${0:value}

      
        
        34
        +)

      
        
        35
        +endsnippet

      
        
        36
        +

      
        
        37
        +snippet err "Rrror handling"

      
        
        38
        +if err != nil {

      
        
        39
        +	log.${1:Fatal}(err)

      
        
        40
        +}

      
        
        41
        +endsnippet

      
        
        42
        +

      
        
        43
        +snippet ;= ";= to :="

      
        
        44
        +:= $1

      
        
        45
        +endsnippet

      
A config/nvim/UltiSnips/markdown.snippets
···
        
        1
        +priority -50

      
        
        2
        +

      
        
        3
        +snippet `py "Python code block"

      
        
        4
        +```python

      
        
        5
        +${1}

      
        
        6
        +```

      
        
        7
        +endsnippet

      
        
        8
        +

      
        
        9
        +snippet `sh "Bash code block"

      
        
        10
        +```bash

      
        
        11
        +${1}

      
        
        12
        +```

      
        
        13
        +endsnippet

      
        
        14
        +

      
        
        15
        +snippet `go "GO code block"

      
        
        16
        +```go

      
        
        17
        +${1}

      
        
        18
        +```

      
        
        19
        +endsnippet

      
        
        20
        +

      
        
        21
        +snippet // "Comment"

      
        
        22
        +<!-- ${1:${VISUAL}} -->

      
        
        23
        +endsnippet

      
A config/nvim/UltiSnips/python.snippets
···
        
        1
        +priority -50

      
        
        2
        +

      
        
        3
        +snippet #! "Shebang"

      
        
        4
        +#!/usr/bin/env python

      
        
        5
        +endsnippet

      
        
        6
        +

      
        
        7
        +snippet ifmain "If __main...."

      
        
        8
        +if __name__ == "__main__":

      
        
        9
        +	${1:code}

      
        
        10
        +endsnippet

      
A config/nvim/UltiSnips/sh.snippets
···
        
        1
        +snippet !sh "SH Shebang"

      
        
        2
        +#!/bin/sh

      
        
        3
        +${1}

      
        
        4
        +endsnippet

      
        
        5
        +

      
        
        6
        +snippet !bash "BASH Shebang"

      
        
        7
        +#!/bin/bash

      
        
        8
        +${1}

      
        
        9
        +endsnippet

      
        
        10
        +

      
        
        11
        +snippet if "If declaration"

      
        
        12
        +if [ ${1} ]; then

      
        
        13
        +	${2}

      
        
        14
        +fi

      
        
        15
        +endsnippet

      
        
        16
        +

      
        
        17
        +snippet for "For loop"

      
        
        18
        +for (( i=0; i < ${1:10}; i++ )); do

      
        
        19
        +	${2}

      
        
        20
        +done

      
        
        21
        +endsnippet

      
        
        22
        +

      
        
        23
        +snippet while "While loop"

      
        
        24
        +while ${1:true}; do

      
        
        25
        +	${2}

      
        
        26
        +done

      
        
        27
        +endsnippet

      
        
        28
        +

      
        
        29
        +snippet case "Case"

      
        
        30
        +case "${1:$variable}" in

      
        
        31
        +	"${2}") ${3} ;;

      
        
        32
        +esac

      
        
        33
        +endsnippet

      
        
        34
        +

      
        
        35
        +snippet fn "Function declaration"

      
        
        36
        +function ${1:name}(${2}) {

      
        
        37
        +	${3}

      
        
        38
        +}

      
        
        39
        +endsnippet

      
M config/nvim/init.vim
···
        7
        7
             Plug 'ap/vim-css-color'                " CSS color preview  

      
        8
        8
             Plug 'airblade/vim-gitgutter'          " Git indicator

      
        9
        9
             Plug 'preservim/nerdcommenter'         " Code commenter

      
        
        10
        +    Plug 'junegunn/goyo.vim'

      
        
        11
        +    Plug 'voldikss/vim-floaterm'           " Terminal

      
        10
        12
         

      
        11
        13
             " Project/file navigation

      
        12
        14
             Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'}

      ···
        25
        27
             Plug 'vim-python/python-syntax',     {'for': 'python'}

      
        26
        28
             Plug 'alaviss/nim.nvim',             {'for': 'nim'}

      
        27
        29
             Plug 'fatih/vim-go',                 {'for': 'go'}

      
        28
        
        -    "Plug 'nsf/gocode',                  {'for': 'go'}

      
        
        30
        +    Plug 'nsf/gocode',                   {'for': 'go'}

      
        29
        31
             Plug 'PotatoesMaster/i3-vim-syntax', {'for': 'i3'}

      
        30
        32
             Plug 'kovetskiy/sxhkd-vim',          {'for': 'sxhkd'}

      
        31
        33
         call plug#end()

      ···
        101
        103
         

      
        102
        104
         " Markdown

      
        103
        105
         let g:vim_markdown_folding_disabled = 1

      
        
        106
        +let g:vim_markdown_frontmatter=1

      
        104
        107
         let g:markdown_fenced_languages = ['go', 'python', 'bash', 'sh=bash']

      
        105
        108
         let g:ficus_dir = "~/Documents/Notes"

      
        106
        109
         

      ···
        110
        113
         " Python

      
        111
        114
         let g:python_higlight_all = 1

      
        112
        115
         

      
        113
        
        -" YouCompleteMe

      
        114
        
        -let g:ycm_key_list_previous_completion=['<Up>']

      
        
        116
        +" Floaterm

      
        
        117
        +let g:floaterm_title     = ""

      
        
        118
        +let g:floaterm_wintype   = "floating"

      
        
        119
        +let g:floaterm_position  = "bottomright"

      
        
        120
        +let g:floaterm_borderchars = ""

      
        
        121
        +let g:floaterm_height    = 0.4

      
        
        122
        +let g:floaterm_width     = 0.5

      
        
        123
        +let g:floaterm_autoclose = 2

      
        
        124
        +nmap <A-t> :FloatermNew<CR>

      
        115
        125
         

      
        116
        
        -" UltiSnipts

      
        117
        
        -let g:UltiSnipsExpandTrigger="<c-tab>"

      
        118
        
        -let g:UltiSnipsListSnippets="<c-s-tab>"

      
        119
        
        -"let g:UltiSnipsJumpForwardTrigger="<c-j>"

      
        120
        
        -"let g:UltiSnipsJumpBackwardTrigger="<c-k>"

      
        121
        126
         

      
        
        127
        +" UltiSnipts

      
        
        128
        +let g:UltiSnipsExpandTrigger="<C-a>"

      
        
        129
        +let g:UltiSnipsEditSplit="vertical"

      
        
        130
        +let g:UltiSnipsJumpForwardTrigger="<C-a>"

      
        
        131
        +let g:UltiSnipsJumpBackwardTrigger="<C-s>"

      
        122
        132
         

      
        123
        133
         " Go

      
        124
        134
         let g:go_template_autocreate = 0

      ···
        187
        197
         noremap <leader>o :bprev<CR>

      
        188
        198
         

      
        189
        199
         " Plugins

      
        
        200
        +map <leader>gg :Goyo 80%x95% <CR>

      
        190
        201
         map <F9> :TagbarToggle<CR>

      
        191
        202
         map <C-b> :NERDTreeToggle<CR>

      
M config/polybar/config
···
        1
        1
         [settings]

      
        
        2
        +enable-ipc = true

      
        2
        3
         screenchange-reload = true

      
        3
        4
         pseudo-transparency = true

      
        4
        5
         

      ···
        9
        10
         alert = #FF6C6B

      
        10
        11
         

      
        11
        12
         [bar/i3bar]

      
        
        13
        +monitor = ${env:MONITOR_MIDDLE}

      
        12
        14
         width = 100%

      
        13
        15
         height = 24

      
        14
        16
         bottom = true

      
M script/dmenu/dmenu-config-edit.sh
···
        1
        1
         #!/bin/sh

      
        2
        
        -declare options=("i3

      
        
        2
        +declare options=("exit

      
        
        3
        +i3

      
        3
        4
         qtile

      
        4
        5
         berry

      
        5
        6
         openbox

      
        
        7
        +dwm

      
        6
        8
         alacritty

      
        7
        9
         kitty

      
        8
        10
         picom

      ···
        18
        20
         

      
        19
        21
         choice=$(echo -e "${options[@]}"|dmenu -p "Config edit" $@)

      
        20
        22
         case "$choice" in

      
        
        23
        +    exit) exit 0 ;;

      
        21
        24
             i3)

      
        22
        25
                 case "$(echo -e "config\npolybar"|dmenu -p "I3wm" $@)" in

      
        23
        26
         	        config)  choice="$HOME/.config/i3/config"      ;;

      ···
        38
        41
                 esac

      
        39
        42
             ;;

      
        40
        43
             openbox)

      
        41
        
        -        case "$(echo -p "config\nautostart\nmenu\ntint2|dmenu -p "OpenBox" $@")" in

      
        
        44
        +        case "$(echo -e "config\nautostart\nmenu\ntint2"|dmenu -p "OpenBox" $@)" in

      
        42
        45
                     config)    choice="$HOME/.config/openbox/rc.xml"    ;;

      
        43
        46
                     autostart) choice="$HOME/.config/openbox/autostart" ;;

      
        44
        47
                     menu)      choice="$HOME/.config/openbox/menu.xml"  ;;

      
        45
        48
                     tint2)     choice="$HOME/.config/tint2/tint2rc"     ;;

      
        46
        49
                 esac

      
        47
        50
             ;;

      
        
        51
        +    dwm)

      
        
        52
        +        case "$(echo -e "config\nautostart\nbar"|dmenu -p "DWM" $@)" in

      
        
        53
        +            config)    choice="$HOME/.config/dwm/config.def.h " ;;

      
        
        54
        +            autostart) choice="$HOME/.config/dwm/autostart.sh"  ;;

      
        
        55
        +            bar)       choice="$HOME/.script/dwmbar.sh"         ;;

      
        
        56
        +        esac

      
        
        57
        +    ;;

      
        48
        58
             alacritty) choice="$hoME/.config/alacritty.yml"    ;;

      
        49
        59
             kitty)     choice="$HOME/.config/kitty/kitty.conf" ;;

      
        50
        60
         	picom)     choice="$HOME/.config/picom.conf"       ;;

      ···
        56
        66
                 esac

      
        57
        67
             ;;

      
        58
        68
             emacs)

      
        59
        
        -        case "$(echo -e "config.el\ncustom.el\ninit.el\npackages.el"|dmenu -p "Doom emacs" $@)" in

      
        60
        
        -            config.el)   choice="$HOME/.doom.d/config.el"   ;;

      
        61
        
        -            init.el)     choice="$HOME/.doom.d/init.el"     ;;

      
        62
        
        -            custom.el)   choice="$HOME/.doom.d/custom.el"   ;;

      
        63
        
        -            packages.el) choice="$HOME/.doom.d/packages.el" ;;

      
        
        69
        +        case "$(echo -e "config\ncustom\ninit\npackages"|dmenu -p "Doom emacs" $@)" in

      
        
        70
        +            config)   choice="$HOME/.doom.d/config.el"   ;;

      
        
        71
        +            init)     choice="$HOME/.doom.d/init.el"     ;;

      
        
        72
        +            custom)   choice="$HOME/.doom.d/custom.el"   ;;

      
        
        73
        +            packages) choice="$HOME/.doom.d/packages.el" ;;

      
        64
        74
                 esac

      
        65
        75
             ;;

      
        66
        
        -    nvim)     choice="$HOME/.config/nvim/init.vim"         ;;

      
        67
        
        -    tmux)     choice="$HOME/.tmux.conf"                    ;;

      
        68
        
        -    dunst)    choice="$HOME/.config/dunst/dunstrc"         ;;

      
        69
        
        -    zsh)      choice="$HOME/.zshrc"                        ;;

      
        70
        
        -    castero)  choice="$HOME/.config/castero/castero.conf"  ;;

      
        71
        
        -    redshift) choice="$HOME/.config/redshift.conf"         ;;

      
        
        76
        +    nvim)     choice="$HOME/.config/nvim/init.vim"        ;;

      
        
        77
        +    tmux)     choice="$HOME/.tmux.conf"                   ;;

      
        
        78
        +    dunst)    choice="$HOME/.config/dunst/dunstrc"        ;;

      
        
        79
        +    zsh)      choice="$HOME/.zshrc"                       ;;

      
        
        80
        +    castero)  choice="$HOME/.config/castero/castero.conf" ;;

      
        
        81
        +    redshift) choice="$HOME/.config/redshift.conf"        ;;

      
        72
        82
             rofi)

      
        73
        83
                 case "$(echo -e "config\nnten-dmenu"|dmenu -p "Rofi" $@)" in

      
        74
        84
                     config)     choice="$HOME/.config/rofi/config"                 ;;

      
A script/polybar-toggle
···
        
        1
        +#!/bin/sh

      
        
        2
        +if [ $(pgrep polybar) ]

      
        
        3
        +then

      
        
        4
        +    polybar i3bar >/dev/null

      
        
        5
        +    #~/.config/polybar/launch.sh

      
        
        6
        +else

      
        
        7
        +    killall -q polybar

      
        
        8
        +    pkill polybar

      
        
        9
        +fi

      
M zshrc
···
        72
        72
         alias doomupgrade="$HOME/.emacs.d/bin/doom upgrade"

      
        73
        73
         alias doomdoctor="$HOME/.emacs.d/bin/doom doctor"

      
        74
        74
         alias doom="$HOME/.emacs.d/bin/doom"

      
        75
        
        -