Update alacritty, i3, qtile, ranger & add vi-mode in zsh

This commit is contained in:
Smirnov Olexandr 2021-01-18 22:04:54 +02:00
parent 73ebbfbe50
commit ed62788b9e
15 changed files with 132 additions and 95 deletions

View file

@ -29,9 +29,9 @@ case "$1" in
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"
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" ;;

View file

@ -1,2 +1,2 @@
#!/bin/sh
curl ipinfo.io/ip
curl ifconfig.co

View file

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

View file

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

View file

@ -2,25 +2,22 @@ call plug#begin('~/.vim/plugged')
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 '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 <A-t> :FloatermNew<CR>
" UltiSnipts
let g:UltiSnipsExpandTrigger="<C-a>"
let g:UltiSnipsEditSplit="vertical"
let g:UltiSnipsJumpForwardTrigger="<C-a>"
let g:UltiSnipsJumpBackwardTrigger="<C-s>"
" 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 = "<tab>"
let g:UltiSnipsEditSplit = "vertical"
let g:UltiSnipsJumpForwardTrigger = "<tab>"
let g:UltiSnipsJumpBackwardTrigger = "<C-tab>"
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 <esc>
" window(s)
nmap <C-h> :wincmd h<CR>
nmap <C-j> :wincmd j<CR>

View file

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

View file

@ -9,7 +9,7 @@ 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"]),"°С")
elif JSON['weather'][0]['main'] == "Thunderstorm": print("", int(JSON["main"]["temp"]),"°С")

View file

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

View file

@ -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],
)

View file

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

View file

@ -50,6 +50,7 @@ ext py = python -- "$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"
@ -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" -- "$@"

13
zshrc
View file

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