From 5c2b55f13c6bb7812793bac979727cc7bcc4e4f3 Mon Sep 17 00:00:00 2001 From: Smirnov Alexandr Date: Tue, 2 Mar 2021 21:01:44 +0200 Subject: [PATCH] Add vim-suround in nvim config --- bin/catfetch | 8 +++----- config/bspwm/bspwmrc | 2 -- config/nvim/init.vim | 45 +++++++++++------------------------------ config/openbox/menu.xml | 4 ++-- rcrc | 4 ++-- tmux.conf | 3 ++- vscode/settings.json | 7 +++---- zshrc | 39 +++++++---------------------------- 8 files changed, 31 insertions(+), 81 deletions(-) diff --git a/bin/catfetch b/bin/catfetch index a4fab9f..57d072e 100755 --- a/bin/catfetch +++ b/bin/catfetch @@ -15,11 +15,9 @@ shell=$(basename $SHELL) manager=$(which apt pacman yay apk xbps-query 2>/dev/null) manager=${manager##*/} case "$manager" in - apt) packages="$(dpkg-query -f '${binary:Package}\n' -W | wc -l)";; - pacman) packages="$(pacman -Q | wc -l)";; - yay) packages="$(yay -Q | wc -l)";; - apk) packages="$(apk list --installed | wc -l)";; - xbps-query) packages="$(xbps-query -l | wc -l)";; + apt) packages="$(dpkg-query -f '${binary:Package}\n' -W | wc -l)";; + yay) packages="$(yay -Q | wc -l)";; + pacman) packages="$(pacman -Q | wc -l)";; esac diff --git a/config/bspwm/bspwmrc b/config/bspwm/bspwmrc index c9760ab..9186074 100755 --- a/config/bspwm/bspwmrc +++ b/config/bspwm/bspwmrc @@ -6,11 +6,9 @@ Run() { } ###== 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 ~/.script/autolock & Run lxsession & Run picom -b & diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 9cba0d4..b3edcf2 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -1,10 +1,9 @@ call plug#begin('~/.vim/plugged') Plug 'Smirnov-O/nten16.vim' - Plug 'itchyny/lightline.vim' Plug 'jiangmiao/auto-pairs' Plug 'maxboisvert/vim-simple-complete' Plug 'sheerun/vim-polyglot' - Plug 'ap/vim-css-color' + Plug 'tpope/vim-surround' call plug#end() "== General @@ -27,9 +26,13 @@ set expandtab set autoindent " Status line -set noshowmode showcmd +set laststatus=0 +set showmode showcmd set ruler +" Scroll +set scrolloff=3 + " Mouse set mouse=a set mousehide @@ -41,7 +44,7 @@ set fileencodings=utf-8 " Backup file & history set nobackup noswapfile -set history=100 +set history=500 " Search set incsearch @@ -51,20 +54,12 @@ set smartcase " Enable mode line set modeline -" File explorer -let g:netrw_banner = 0 -let g:netrw_browse_split = 2 -let g:netrw_winsize = 15 - " Auto reload file set autoread " Buffer set hidden -" Spell checker -set nospell spelllang=en_us - " Space/tab indicator set list listchars=tab:\|·,trail:~,extends:>,precedes:<,space:· @@ -72,16 +67,15 @@ set list listchars=tab:\|·,trail:~,extends:>,precedes:<,space:· set visualbell t_vb= "== Settings for specific files -autocmd BufWritePre *.py normal m`:%s/\s\+$//e `` +autocmd BufWritePre *.py normal m`:%s/\s\+$//e ` autocmd FileType python,go,json setlocal expandtab shiftwidth=4 tabstop=4 autocmd FileType html,css,javascript,javascriptreact,yaml setlocal expandtab shiftwidth=2 tabstop=2 + "== Aliases command! W :w -command! Q :q -command! Wq :wq command! WQ :wq -command! Term :vsplit | vertical resize 45 | terminal +command! Wq :wq command! Wiki :e ~/doc/index.md command! Prettier :!prettier --write % command! ESlint :!eslint % @@ -90,26 +84,12 @@ command! Black :!black % command! AutoPep8 :!autopep8 --in-place % -"== Plug in configuration -let g:lightline = { -\ 'colorscheme': 'nten16', -\ 'active': { -\ 'left': [ [ 'mode', 'paste' ], -\ [ 'readonly', 'modified' ] ], -\ 'right': [ [ 'lineinfo' ], -\ [ 'percent' ], -\ [ 'filename', 'filetype' ] ] } -\ } - "== Mapping let mapleader="'" " Alternative keys noremap :w noremap :tabnew -noremap :tabnew -noremap ww :Wiki -noremap e :Ve " Window noremap :wincmd h @@ -122,7 +102,6 @@ noremap spv :vsp noremap sph :sp noremap spk :wincmd K noremap spl :wincmd L -noremap spn :wincmd n " Tab noremap tn :tabnew @@ -138,8 +117,8 @@ noremap :tabn 8 noremap :tabn 9 " Buffer -noremap Bn :bnext -noremap Bp :bprev +noremap j :bnext +noremap k :bprev " Work with system clipboard noremap y "*yy diff --git a/config/openbox/menu.xml b/config/openbox/menu.xml index 1decf0c..a65dc9f 100644 --- a/config/openbox/menu.xml +++ b/config/openbox/menu.xml @@ -70,9 +70,9 @@ kitty -e ranger - + - Thunar + pcmanfm diff --git a/rcrc b/rcrc index 5cba0cb..bde8a61 100644 --- a/rcrc +++ b/rcrc @@ -1,2 +1,2 @@ -EXCLUDES="README.md screen.png" -UNDOTTED="bin" +EXCLUDES="README.md nten.tar.gz screen.png" +UNDOTTED="bin vscode" diff --git a/tmux.conf b/tmux.conf index 60bb3b8..625d360 100644 --- a/tmux.conf +++ b/tmux.conf @@ -29,7 +29,8 @@ bind-key -n End send Escape "OF" ## Reload config -bind r source-file ~/.tmux.conf \; display 'Reloaded tmux config' +bind r source-file ~/.tmux.conf \; + display 'Reloaded tmux config' ## Vim keys for change/resize window bind -r h select-pane -L diff --git a/vscode/settings.json b/vscode/settings.json index 09d781e..504dd56 100644 --- a/vscode/settings.json +++ b/vscode/settings.json @@ -10,7 +10,6 @@ "editor.tabCompletion": "on", "editor.tabSize": 4, "editor.formatOnSave": false, - "files.autoSave": "afterDelay", "workbench.startupEditor": "newUntitledFile", // Vim @@ -19,13 +18,13 @@ "vim.useSystemClipboard": true, "vim.insertModeKeyBindings": [ {"before": ["j", "j"], - "after" : [""]}, + "after" : [""]}, {"before": ["Ctrl", "Shift", "e"], - "commands": ["workbench.view.explorer"]}, + "commands": ["workbench.view.explorer"]}, ], "vim.normalModeKeyBindings": [ {"before": ["f"], - "after" : ["leader","leader","s"]} + "after" : ["leader","leader","s"]} ], // Terminal diff --git a/zshrc b/zshrc index 4d6ef34..e572ebe 100644 --- a/zshrc +++ b/zshrc @@ -1,46 +1,21 @@ -export PATH="$HOME/.yarn/bin:$HOME/bin:$HOME/.application:$HOME/.local/bin:$PATH" +export PATH="$HOME/.yarn/bin:$HOME/bin:$HOME/.applications:$HOME/.local/bin:$PATH" -### Oh my zsh ### +### Oh my zsh export ZSH="$HOME/.oh-my-zsh" -ZSH_THEME="simple" # Set theme. -#CASE_SENSITIVE="true" # Use case-sensitive completion. -#HYPHEN_INSENSITIVE="true" # Case-sensitive completion must be off. -#DISABLE_AUTO_UPDATE="true" # Disable bi-weekly auto-update checks. -DISABLE_UPDATE_PROMPT="true" # Automatically update without prompting. -#DISABLE_MAGIC_FUNCTIONS="true" # If pasting URL and other text is messed up. -#DISABLE_LS_COLORS="true" # Disable colors in ls. -DISABLE_AUTO_TITLE="true" # Disable auto-setting terminal title. -#ENABLE_CORRECTION="true" # Enable command auto-correction. -#COMPLETION_WAITING_DOTS="true" # Display red dots whilst waiting for completion. -export UPDATE_ZSH_DAYS=7 # Change how often to auto-update. - +ZSH_THEME="simple" +DISABLE_UPDATE_PROMPT="true" +DISABLE_AUTO_TITLE="true" plugins=(yarn nvm) source $ZSH/oh-my-zsh.sh -### Variables -export EDITOR="nvim" -export VISUAL="nvim" - -### 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 mkdir="mkdir -p" alias cp="cp -r" -alias du="du -sh" +alias du="du -h" alias vim="nvim" alias vi="vim" -alias tl="tmuxp load" -alias d="docker" -alias wiki="vi +Wiki" +alias rgf="rg --files|rg" alias tmux="tmux -2" alias :q="exit" -alias ..="cd .." alias ...="cd ../.."