diff --git a/bin/giti b/bin/giti index 43295e8..70b3f03 100755 --- a/bin/giti +++ b/bin/giti @@ -25,14 +25,14 @@ function show() { } case "$1" in - add|a) shift; add "$@" ;; - del|d) shift; del "$@" ;; - mv) shift; edit "$@" ;; - show|s) shift; show ;; - help) echo "add/a - filename add to ignore" - echo "del/d - filename del from ignore" - echo "mv - oldname newname chage file name" - echo "show/s - show ignore file" + add|a) shift; add "$@" ;; + del|d) shift; del "$@" ;; + mv) shift; edit "$@" ;; + show|s) shift; show ;; + help) echo "add/a - [file name] add to ignore" + echo "del/d - [file name] delete from ignore" + echo "mv - [old new] change file name" + echo "show/s - show ignore file" ;; *) echo "Command is not valid" ;; esac diff --git a/bin/ipp b/bin/ipp index 8efadf8..e67d85a 100755 --- a/bin/ipp +++ b/bin/ipp @@ -1,2 +1,2 @@ #!/bin/sh -curl ipinfo.io/ip +curl ifconfig.co diff --git a/config/alacritty.yml b/config/alacritty.yml index 09f685f..190987e 100644 --- a/config/alacritty.yml +++ b/config/alacritty.yml @@ -27,8 +27,14 @@ font: x: 1 y: 0 +cursor: + style: Underline + Underline: + height: 0.5 - 2 + + + scrolling.history: 1000 -cursor.style: Block debug.render_timer: false draw_bold_text_with_bright_colors: false background_opacity: 0.75 diff --git a/config/i3/config b/config/i3/config index 3a36869..de036cf 100644 --- a/config/i3/config +++ b/config/i3/config @@ -20,6 +20,7 @@ set $terminal alacritty set $browser firefox set $filemanager thunar set $codeeditor alacritty -e nvim +set $guicode vscodium ############ Autostart ############ exec --no-startup-id exec setxkbmap "us,ua" ",winkeys" "grp:alt_shift_toggle" -option "ctrl:nocaps" @@ -73,6 +74,7 @@ bindsym $mod+Return exec $terminal bindsym $mod+Shift+w exec $browser bindsym $mod+Shift+f exec $filemanager bindsym $mod+Shift+e exec $codeeditor +bindsym $mod+Shift+c exec $guicode # Toogle polybar bindsym $mod+b exec ~/.script/polybar-toggle diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 947d7b1..831fdc0 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -1,26 +1,23 @@ call plug#begin('~/.vim/plugged') - Plug 'Smirnov-O/nten16.vim' " Color scheme + Plug 'Smirnov-O/nten16.vim' " Color scheme Plug 'itchyny/lightline.vim' " Status line Plug 'airblade/vim-gitgutter' " Git indicator - Plug 'vimwiki/vimwiki' " Wiki in vim - Plug 'ap/vim-css-color' " CSS color preview + Plug 'preservim/nerdtree' " File viewer + Plug 'ap/vim-css-color' " CSS color preview Plug 'mhinz/vim-startify' " Start page - Plug 'voldikss/vim-floaterm' " Terminal floating window - Plug 'kassio/neoterm' " Terminal wrapper - Plug 'editorconfig/editorconfig-vim' " EditorConfig + Plug 'dense-analysis/ale' " Linter + Plug 'editorconfig/editorconfig-vim' " EditorConfig support " Completion & snippets - Plug 'ycm-core/YouCompleteMe' + Plug 'ervandew/supertab' Plug 'jiangmiao/auto-pairs' Plug 'SirVer/ultisnips' " Programing Plug 'metakirby5/codi.vim' - Plug 'sheerun/vim-polyglot' Plug 'plasticboy/vim-markdown', {'for': 'markdown'} Plug 'vim-python/python-syntax', {'for': 'python'} Plug 'fatih/vim-go', {'for': 'go'} - Plug 'nsf/gocode', {'for': 'go'} Plug 'PotatoesMaster/i3-vim-syntax', {'for': 'i3'} call plug#end() @@ -39,8 +36,7 @@ set ruler set showcmd " Mouse -set mouse=a -set mousehide +set mouse=a mousehide set cursorline " Encoding @@ -48,12 +44,10 @@ set encoding=utf-8 set fileencodings=utf-8 " Line wrap -set nowrap -set nolinebreak +set nowrap nolinebreak " Backup file & history -set nobackup -set noswapfile +set nobackup noswapfile set history=100 " Reload file @@ -82,6 +76,35 @@ set spelllang=en_us " Disable sound set visualbell t_vb= + +" == Language configuration + +" Python +autocmd BufWritePre *.py normal m`:%s/\s\+$//e `` +let g:python_higlight_all = 1 +let g:python_highlight_string_formatting = 1 +let g:python_highlight_string_format = 1 +let g:python_highlight_doctests = 1 +let g:python_highlight_func_calls = 1 +let g:python_highlight_class_vars = 1 + +" Markdown +let g:vim_markdown_folding_disabled = 1 +let g:vim_markdown_frontmatter = 1 +let g:markdown_fenced_languages = ['go', 'python', 'bash', 'sh=bash'] + +" Go +let g:go_template_autocreate = 0 +let g:go_highlight_structs = 1 +let g:go_highlight_methods = 1 +let g:go_highlight_functions = 1 +let g:go_highlight_operators = 1 +let g:go_highlight_build_constraints = 1 +let g:go_snippet_engine = "" +let g:go_fmt_command = "goimports" +let g:go_auto_type_info = 1 + + " == Plugins configuration let g:lightline = { \ 'colorscheme': 'nten16', @@ -93,42 +116,12 @@ let g:lightline = { \ [ 'filename', 'filetype' ] ] \ }, } -" Markdown -let g:vim_markdown_folding_disabled = 1 -let g:vim_markdown_frontmatter=1 -let g:markdown_fenced_languages = ['go', 'python', 'bash', 'sh=bash'] - -" VimWiki -let g:vimwiki_list = [{'path': '~/Documents/Notes', 'syntax': 'markdown', 'ext': '.md'}] -"let g:vimwiki_ext2syntax = {".md": "markdown"} -let g:VimWiki_markdown_link_ext = 1 - -" Python -let g:python_higlight_all = 1 - -" Floaterm -let g:floaterm_title = "" -let g:floaterm_wintype = "floating" -let g:floaterm_position = "bottomright" -let g:floaterm_height = 0.4 -let g:floaterm_width = 0.5 -let g:floaterm_autoclose = 2 -nmap :FloatermNew - " UltiSnipts -let g:UltiSnipsExpandTrigger="" -let g:UltiSnipsEditSplit="vertical" -let g:UltiSnipsJumpForwardTrigger="" -let g:UltiSnipsJumpBackwardTrigger="" - -" Go -let g:go_template_autocreate = 0 -let g:go_highlight_structs = 1 -let g:go_highlight_methods = 1 -let g:go_highlight_functions = 1 -let g:go_highlight_operators = 1 -let g:go_highlight_build_constraints = 1 -let g:go_snippet_engine = "" +let g:UltiSnipsExpandTrigger = "" +let g:UltiSnipsEditSplit = "vertical" +let g:UltiSnipsJumpForwardTrigger = "" +let g:UltiSnipsJumpBackwardTrigger = "" +let g:UltiSnipsSnippetDirectories = ["snips"] " Startify let g:startify_custom_header = [ @@ -145,6 +138,9 @@ let g:startify_lists = [ " == Mapping let mapleader="," +" exit from insert mode +im jj + " window(s) nmap :wincmd h nmap :wincmd j diff --git a/config/nvim/UltiSnips/go.snippets b/config/nvim/snips/go.snippets similarity index 69% rename from config/nvim/UltiSnips/go.snippets rename to config/nvim/snips/go.snippets index 6e73674..1ba2c96 100644 --- a/config/nvim/UltiSnips/go.snippets +++ b/config/nvim/snips/go.snippets @@ -1,5 +1,6 @@ -snippet pkg "Package" +snippet pac "Package" package ${1:main} +$0 endsnippet snippet import "Import section" @@ -24,6 +25,20 @@ var ( ) endsnippet +snippet : "Variable" +${1:v} := ${2:value} +endsnippet + +snippet append "Append function" +append(${1:slice}, ${0:value}) +endsnippet + +snippet switch "Switch" +switch ${1:var} { +case ${2:value}: +} +endsnippet + snippet const "Constant declaration" const ${1:name}${2/(.+)/ /}${2:type} = ${0:value} endsnippet @@ -40,6 +55,11 @@ if err != nil { } endsnippet -snippet ;= ";= to :=" -:= $1 +snippet map "Map type" +map[${1:keytype}]${2:valuetupe} +$0 +endsnippet + +snippet ;= ";= to :=" +:= $0 endsnippet diff --git a/config/nvim/UltiSnips/markdown.snippets b/config/nvim/snips/markdown.snippets similarity index 100% rename from config/nvim/UltiSnips/markdown.snippets rename to config/nvim/snips/markdown.snippets diff --git a/config/nvim/UltiSnips/python.snippets b/config/nvim/snips/python.snippets similarity index 100% rename from config/nvim/UltiSnips/python.snippets rename to config/nvim/snips/python.snippets diff --git a/config/nvim/UltiSnips/sh.snippets b/config/nvim/snips/sh.snippets similarity index 100% rename from config/nvim/UltiSnips/sh.snippets rename to config/nvim/snips/sh.snippets diff --git a/config/polybar/scripts/weather.py b/config/polybar/scripts/weather.py index 6e511cd..3b278a0 100755 --- a/config/polybar/scripts/weather.py +++ b/config/polybar/scripts/weather.py @@ -9,11 +9,11 @@ CITY = "Horodnytsya,UA" try: JSON = requests.get(f"http://api.openweathermap.org/data/2.5/weather?q={CITY}&lang=EN&&units=metric&appid={API_KEY}").json() -except Exception as e: print("No connection ") +except Exception as a: print("No connection ") try: - if JSON['weather'][0]['main'] == "Clear": print("", int(JSON["main"]["temp"]),"°С") + if JSON['weather'][0]['main'] == "Clear": print("", int(JSON["main"]["temp"]),"°С") elif JSON['weather'][0]['main'] == "Thunderstorm": print("", int(JSON["main"]["temp"]),"°С") - elif JSON['weather'][0]['main'] == "Drizzle": print("", int(JSON["main"]["temp"]),"°С") + elif JSON['weather'][0]['main'] == "Drizzle": print("", int(JSON["main"]["temp"]),"°С") elif JSON['weather'][0]['main'] == "Rain": print("", int(JSON["main"]["temp"]),"°С") elif JSON['weather'][0]['main'] == "Snow": print("", int(JSON["main"]["temp"]),"°С") elif JSON['weather'][0]['main'] == "Mist": print("", int(JSON["main"]["temp"]),"°С") diff --git a/config/qtile/autostart.sh b/config/qtile/autostart.sh index da9208a..4ee7e08 100755 --- a/config/qtile/autostart.sh +++ b/config/qtile/autostart.sh @@ -1,6 +1,6 @@ #!/bin/sh xautolock -time 5 -locker "betterlockscreen --off 300 -t \"Computer is lockerd\" -l" & setxkbmap "us,ua" ",winkeys" "grp:alt_shift_toggle" -option "ctrl:nocaps" & -/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & nitrogen --restore & -picom --experimental-backends -b & +lxsession & +picom -b & diff --git a/config/qtile/config.py b/config/qtile/config.py index b5fcb31..870c04d 100644 --- a/config/qtile/config.py +++ b/config/qtile/config.py @@ -10,7 +10,7 @@ alt = "mod1" terminal = "alacritty" browser = "firefox" -filemanager = "thunar" +filemanager = f"{terminal} -e ranger" editor = "alacritty -e nvim" color = [ @@ -54,6 +54,10 @@ keys = [ lazy.window.kill(), desc="Kill focused window" ), + Key([mod, "shift"], "Tab", + lazy.window.toggle_floating(), + desc="Toggle floating mode" + ), Key([mod], "h", lazy.layout.left(), desc="Change focus window(left)" @@ -204,10 +208,10 @@ for i, (name, kwargs) in enumerate(group_names, 1): # Window layout(s) layout_theme = { - "border_width": 1, + "border_width": 2, "margin": 2, "border_focus": color[2], - "border_normal": color[1], + "border_normal": color[3], "font": "Jatbrains Mono" } layouts = [ @@ -230,7 +234,7 @@ layouts = [ widget_defaults = dict( font="Jatbrains Mono", fontsize=12, - padding=5, + padding=4, foreground=color[0], background=color[3], ) diff --git a/config/ranger/rc.conf b/config/ranger/rc.conf index b6a7610..5c06393 100644 --- a/config/ranger/rc.conf +++ b/config/ranger/rc.conf @@ -130,12 +130,14 @@ map ? help # Go keys map gh cd ~ -map gc cd ~/Code -map gd cd ~/Documents -map gb cd ~/Documents/Books +map gc cd ~/code +map gd cd ~/docs +map gb cd ~/docs/books map gm cd ~/.dotfiles map gn cd ~/bin -map gz cd ~/.script +map gs cd ~/.script +map gv cd ~/virt +map gw cd ~/downl # Console map : console @@ -194,8 +196,8 @@ map move left=1 map move right=1 map move to=0 map move to=-1 -map move down=1 pages=True -map move up=1 pages=True +map move down=1 pages=True +map move up=1 pages=True map move right=1 map console delete map console touch%space @@ -290,8 +292,8 @@ map zc set collapse_preview! map zd set sort_directories_first! map zh set show_hidden! map set show_hidden! -copymap -copymap +copymap +copymap map zI set flushinput! map zi set preview_images! map zm set mouse_enabled! diff --git a/config/ranger/rifle.conf b/config/ranger/rifle.conf index 9d2dfeb..2231581 100644 --- a/config/ranger/rifle.conf +++ b/config/ranger/rifle.conf @@ -22,11 +22,11 @@ ext x?html?, has seamonkey, X, flag f = seamonkey -- "$@" ext x?html?, has iceweasel, X, flag f = iceweasel -- "$@" ext x?html?, has epiphany, X, flag f = epiphany -- "$@" ext x?html?, has konqueror, X, flag f = konqueror -- "$@" -ext x?html?, has elinks, terminal = elinks "$@" -ext x?html?, has links2, terminal = links2 "$@" -ext x?html?, has links, terminal = links "$@" -ext x?html?, has lynx, terminal = lynx -- "$@" -ext x?html?, has w3m, terminal = w3m "$@" +ext x?html?, has elinks, terminal = elinks "$@" +ext x?html?, has links2, terminal = links2 "$@" +ext x?html?, has links, terminal = links "$@" +ext x?html?, has lynx, terminal = lynx -- "$@" +ext x?html?, has w3m, terminal = w3m "$@" ######### ### Misc @@ -47,11 +47,12 @@ name ^[mM]akefile$ = make ### Scripts ############ ext py = python -- "$1" -ext pl = perl -- "$1" -ext rb = ruby -- "$1" -ext js = node -- "$1" -ext sh = sh -- "$1" -ext php = php -- "$1" +ext pl = perl -- "$1" +ext rb = ruby -- "$1" +ext js = node -- "$1" +ext go = go -- "$1" +ext sh = sh -- "$1" +ext php = php -- "$1" #################### ### Audio without X @@ -169,6 +170,7 @@ mime ^font, has fontforge, X, flag f = fontforge "$@" ############################## ### Flag t fallback terminals ############################## +mime ^ranger/x-terminal-emulator, has alacritty = alacritty -e "$@" mime ^ranger/x-terminal-emulator, has kitty = kitty -- "$@" mime ^ranger/x-terminal-emulator, has xfce4-terminal = xfce4-terminal -x "$@" mime ^ranger/x-terminal-emulator, has terminology = terminology -e "$@" @@ -177,7 +179,6 @@ mime ^ranger/x-terminal-emulator, has konsole = konsole -e "$@" mime ^ranger/x-terminal-emulator, has lxterminal = lxterminal -e "$@" mime ^ranger/x-terminal-emulator, has gnome-terminal = gnome-terminal -- "$@" mime ^ranger/x-terminal-emulator, has sakura = sakura -e "$@" -mime ^ranger/x-terminal-emulator, has alacritty = alacritty -e "$@" mime ^ranger/x-terminal-emulator, has lilyterm = lilyterm -e "$@" mime ^ranger/x-terminal-emulator, has termite = termite -x '"$@"' mime ^ranger/x-terminal-emulator, has yakuake = yakuake -e "$@" @@ -203,7 +204,6 @@ label wallpaper, number 14, mime ^image, has feh, X = feh --bg-fill "$1" label open, has xdg-open = xdg-open -- "$@" label open, has open = open -- "$@" - !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = ask label editor, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = ${VISUAL:-$EDITOR} -- "$@" label pager, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@" diff --git a/zshrc b/zshrc index eb82825..eaab555 100644 --- a/zshrc +++ b/zshrc @@ -1,5 +1,5 @@ export ZSH="$HOME/.oh-my-zsh" -export PATH="$HOME/bin:$HOME/.local/bin:$PATH" +export PATH="$HOME/bin:$HOME/.local/bin:$GOPATH/bin:$PATH" source ~/.profile ### Oh my zsh ### @@ -16,14 +16,19 @@ DISABLE_AUTO_TITLE="true" # Disable auto-setting terminal title. export UPDATE_ZSH_DAYS=7 # Change how often to auto-update. export LANG=en_US.UTF-8 # Set locale -plugins=(pip python golang pass emacs sudo heroku git taskwarrior encode64) +plugins=(pip python golang pass sudo heroku vi-mode git encode64) source $ZSH/oh-my-zsh.sh +### Vim mode ### +VI_MODE_RESET_PROMPT_ON_MODE_CHANGE=true +VI_MODE_SET_CURSOR=true +MODE_INDICATOR="%F{cyan}+%f" + ### Variables ### export EDITOR="nvim" export VISUAL="nvim" -export GOPATH="$HOME/Go" +export GOPATH="$HOME/go" ### Function ### function bgcolor { @@ -33,6 +38,7 @@ function bgcolor { function codi() { local syntax="${1:-python}" nvim -c "let g:startify_disable_at_vimenter = 1 |\ + set bt=nofile ls=0 noru nonu nornu |\ Codi $syntax" "$@" } @@ -52,6 +58,7 @@ alias vim="nvim" alias vi="nvim" alias tmux="tmux -2" alias ipython="ipython --no-banner" +alias ran="ranger" # Exit alias :q="exit"