all repos

dotfiles @ 4c57b36f1bf1fec857282005b17c64935c63fb80

my dotfiles
16 files changed, 128 insertions(+), 342 deletions(-)
Transition from my neovim config to LunarVim
Author: Smirnov-O ss2316544@gmail.com
Committed at: 2021-08-01 19:31:06 +0300
Parent: e3fa73c
M bin/arch-upd

@@ -1,4 +1,4 @@

#!/bin/sh sudo pacman -Syyuu --noconfirm yay -Sua --noconfirm -sudo pacman -Rs $(pacman -Qdtq) --noconfirm+sudo pacman -Rs $(pacman -Qdtq) --noconfirm
D bin/catfetch

@@ -1,34 +0,0 @@

-#!/bin/sh - -# Kernel version -kernel=$(cat /proc/sys/kernel/osrelease | cut -d '-' -f1) - -# Window manager -[ ! "$wm" ] && [ "$DISPLAY" ] && command -v xprop >/dev/null && { - wmname="$(xprop -id $(xprop -root -notype\ - | awk '$1=="_NET_SUPPORTING_WM_CHECK:"{print $5}') -notype -f _NET_WM_NAME 8t\ - | grep "WM_NAME"\ - | cut -f2 -d \")" -} - -# Shell -shell=$(basename $SHELL) - -# Installed packages -manager=$(which apt pacman yay 2>/dev/null) -manager=${manager##*/} -case "$manager" in - apt) packages="$(dpkg-query -f '${binary:Package}\n' -W | wc -l)" ;; - yay) packages="$(yay -Q | wc -l)" ;; - pacman) packages="$(pacman -Q | wc -l)" ;; -esac - -# Text decorations -bold=$(tput bold) -reset="\e[0m" -blue="\e[36m" - -echo -e " ${blue}${bold} WM ${reset}${wmname}" -echo -e " /\_/\ ${blue}${bold} SHELL ${reset}${shell}" -echo -e " (=^.^=) ${blue}${bold}KERNEL ${reset}${kernel}" -echo -e " (\") (\")_/ ${blue}${bold} PKG ${reset}${packages}"
D bin/extract

@@ -1,18 +0,0 @@

-#!/bin/sh -case "$1" in - *.tar.bz2) tar xjf $1 ;; - *.tar.gz) tar xzf $1 ;; - *.bz2) bunzip2 $1 ;; - *.rar) unrar x $1 ;; - *.gz) gunzip $1 ;; - *.tar) tar xf $1 ;; - *.tbz2) tar xjf $1 ;; - *.tgz) tar xzf $1 ;; - *.zip) unzip $1 ;; - *.Z) uncompress $1 ;; - *.7z) 7z x $1 ;; - *.deb) ar x $1 ;; - *.tar.xz) tar xf $1 ;; - *.tar.zst) unzstd $1 ;; - *) echo "'$1' is not a valid file" ;; -esac
M bin/giti

@@ -32,11 +32,11 @@

case "$1" in add|a) shift; add "$@" ;; del|d) shift; del "$@" ;; - mv) shift; edit "$@" ;; + mv|m) shift; edit "$@" ;; show) shift; show ;; help) echo "add|a - [file name] add to ignore." echo "del|d - [file name] delete from ignore." - echo "mv - [old] [new] file name for rename." + echo "mv|m - [old] [new] file name for rename." echo "show - show ignore file." ;; *) echo "Command is not valid. Type 'giti help' for help." ;; esac
D bin/ipp

@@ -1,2 +0,0 @@

-#!/bin/sh -curl ifconfig.co
M config/bspwm/README.md

@@ -1,6 +1,6 @@

# BSPWM -[](screen.png) +[](./screen.png) -------------- ### Install
A config/lvim/lv-config.lua

@@ -0,0 +1,63 @@

+--- "lvim" configuration +lvim.format_on_save = false +lvim.lint_on_save = true +lvim.colorscheme = "spacegray" + +lvim.builtin.dashboard.active = true +lvim.builtin.terminal.active = true +lvim.builtin.nvimtree.side = "right" +lvim.builtin.nvimtree.show_icons.git = 0 +lvim.builtin.nvimtree.auto_open = 0 +lvim.builtin.nvimtree.hide_dotfiles = 0 +lvim.builtin.telescope.defaults.layout_config.prompt_position = "top" +lvim.builtin.treesitter.ensure_installed = { "javascript", "jsdoc", "lua", "python" } +lvim.builtin.treesitter.highlight.enabled = true +lvim.builtin.treesitter.indent.disable = { "python" } + +--- keymappings +lvim.leader = "space" +lvim.keys.normal_mode = { + { "<C-s>", "<cmd>w<cr>" }, + { "<C-w>", "<cmd>BufferClose<cr>" }, + -- Navigate split + { "<C-h>", "<cmd>wincmd h<cr>" }, + { "<C-j>", "<cmd>wincmd j<cr>" }, + { "<C-k>", "<cmd>wincmd k<cr>" }, + { "<C-l>", "<cmd>wincmd l<cr>" }, + -- Resize split + { "<A-h>", "<cmd>vert res +2<cr>" }, + { "<A-j>", "<cmd>res -2<cr>" }, + { "<A-k>", "<cmd>res +2<cr>" }, + { "<A-l>", "<cmd>vert res -2<cr>" }, + -- Resize + { "<A-1>", "<cmd>BufferGoto 1<cr>" }, + { "<A-2>", "<cmd>BufferGoto 2<cr>" }, + { "<A-3>", "<cmd>BufferGoto 3<cr>" }, + { "<A-4>", "<cmd>BufferGoto 4<cr>" }, + { "<A-5>", "<cmd>BufferGoto 5<cr>" }, + { "<A-6>", "<cmd>BufferGoto 6<cr>" }, + { "<A-7>", "<cmd>BufferGoto 7<cr>" }, + { "<A-8>", "<cmd>BufferGoto 8<cr>" }, + { "<A-9>", "<cmd>BufferGoto 9<cr>" }, +} + +--- Plugins +lvim.plugins = { +} + +--- LSP +lvim.lang.javascript.lsp.setup.handlers = { + ["textDocument/publishDiagnostics"] = function(_, _, p, client_id, _, config) + if p.diagnostics ~= nil then + local i = 1 + while i <= #p.diagnostics do + if p.diagnostics[i].code == 80001 then + table.remove(p.diagnostics, i) + else + i = i + 1 + end + end + end + vim.lsp.diagnostic.on_publish_diagnostics(_, _, p, client_id, _, config) + end, +}
D config/nvim/README.md

@@ -1,33 +0,0 @@

-# NVIM - -## Install nvim -```bash -# From AUR -yay -S neovim-nightly-bin - -# From pacman -sudo pacman -S neovim -``` - -## Install plugin manager(`vim-plug`) -```bash -sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' -``` - -## Install LSP servers -```bash -# Go(gopls) -go get golang.org/x/tools/gopls@latest - -# Efm (linters) -go get github.com/mattn/efm-langserver - -# Python(pyls) -pip install python-language-server - -# JS/TS -nvim +"LspInstall typescript" - -# Lua -nvim +"LspInstall lua" -```
D config/nvim/init.vim

@@ -1,67 +0,0 @@

-call plug#begin('~/.vim/plugged') - Plug 'Smirnov-O/nten.vim' - Plug 'hoob3rt/lualine.nvim' - Plug 'romgrk/barbar.nvim' - Plug 'b3nj5m1n/kommentary' - Plug 'jiangmiao/auto-pairs' - Plug 'nvim-lua/plenary.nvim' - Plug 'lewis6991/gitsigns.nvim' - " LSP - Plug 'hrsh7th/nvim-compe' - Plug 'neovim/nvim-lspconfig' - Plug 'kabouzeid/nvim-lspinstall' - " Files - Plug 'junegunn/fzf.vim', {'on': ['Files', 'GFiles']} - " Syntax - Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} - Plug 'sheerun/vim-polyglot' -call plug#end() - -colo codedark -let mapleader=";" - -"== Config -set termguicolors " GUI colors -set nu rnu nocul " Line numbers & cursor line highlight -set nolbr nowrap " Line wrap -set mouse=a mh " Mouse -set history=500 " Set history size -set autoread " Auto read file on change -set hidden " Change buffet without warning -set visualbell t_vb= " Disable sounds -set pumheight=8 " Maximum items in pop up -set modeline " Enable modeline -set nosmd " Disable show mode -set nobk noswf noudf " Swap files -set is ic scs " Search -set spr " Split -set enc=utf-8 fenc=utf-8 " Encoding -set scrolloff=3 " Scroll padding -set list listchars=tab:\|·,trail:~,space:· -set completeopt=menuone,noselect - -"== Netrw file tree -let g:netrw_liststyle = 3 -let g:netrw_banner = 0 -let g:netrw_dirhistmax = 0 - -"== Tab(or spaces) -set ts=4 sw=4 sts=4 -set sta et ai - -"== Custom commands -com! Prettier :sil !prettier --no-semi -w % -com! Term :vs|winc L|se nonu nornu|start|term -com! GoFmt :sil !gofmt -w % -com! Black :sil !black % - -"== Filetypes -au FileType go setl noet -au FileType javascript,yaml,json setl et ts=2 sw=2 sts=4 -au FileType python setl et ts=4 sw=4 sts=4 ai -autocmd BufReadPost,FileReadPost lua require "lsp_signature".on_attach() - -"== Config's -lua require"config" -so $HOME/.config/nvim/vimscript/barbar.vim -so $HOME/.config/nvim/vimscript/mappings.vim
D config/nvim/lua/config.lua

@@ -1,51 +0,0 @@

-require"lspinstall".setup {} -require"lspconfig".gopls.setup {} --- require"lspconfig".pyls.setup {} --- require"lspconfig".rls.setup {} --- require"lspconfig".denols.setup {} --- require"lspconfig".lua.setup{} -require"tsserver" -require"efm" - --- Compe -require'compe'.setup { - enabled = true, - autocomplete = true, - source = { - -- path = true, - buffer = true, - description = true, - nvim_lsp = true - } -} - --- LuaLine -require'lualine'.setup {options={ - theme = "codedark" -}} - --- GitSigns -require'gitsigns'.setup { - signs = { - add = {hl = 'GitSignsAdd', text = '│'}; - change = {hl = 'GitSignsChange', text = '│'}; - delete = {hl = 'GitSignsDelete', text = '_'}; - topdelete = {hl = 'GitSignsDelete', text = '‾'}; - changedelete = {hl = 'GitSignsChange', text = '~'}; - }; - watch_index = {interval = 1000}; - current_line_blame = true, - sign_priority = 6, - update_debounce = 100, - status_formatter = nil, - use_decoration_api = true, - use_internal_diff = true, -} - --- TreeSitter -require'nvim-treesitter.configs'.setup { - ensure_installed = {'javascript', 'typescript', 'jsdoc', 'python', 'go', 'bash'}; - highlight = { - enable=true - }; -}
D config/nvim/lua/efm.lua

@@ -1,39 +0,0 @@

--- Python -local flake8 = { - lintCommand = "flake8 --ignore=E501 --stdin-display-name ${INPUT} -", - lintStdin = true, - lintFormats = {"%f:%l:%c: %m"} -} - --- Javascript -local eslint = { - lintCommand = "./node_modules/.bin/eslint -f unix --stdin --stdin-filename ${INPUT}", - lintIgnoreExitCode = true, - lintStdin = true, - lintFormats = {"%f:%l:%c: %m"}, - formatCommand = "./node_modules/.bin/eslint --fix-to-stdout --stdin --stdin-filename=${INPUT}", - formatStdin = true -} - --- GoLang -local golint = { - lintCommand = "golint", - lintIgnoreExitCode = true, - lintFormats = {"%f:%l:%c: %m"}, - lintSource = "golint" -} - --- Setup -require"lspconfig".efm.setup { - init_options = {documentFormatting = false, codeAction = false}, - filetypes = {"python", "javascript", "typescript", "go"}, - settings = { - rootMarkers = {".git/"}, - languages = { - python = {flake8}, - javascript = {eslint}, - typescript = {eslint}, - go = {golint} - }; - }; -}
D config/nvim/lua/tsserver.lua

@@ -1,21 +0,0 @@

-local root_pattern = require("lspconfig/util").root_pattern - -require('lspconfig').typescript.setup({ - handlers = { - ["textDocument/publishDiagnostics"] = function(_, _, params, client_id, _, config) - if params.diagnostics ~= nil then - local idx = 1 - while idx <= #params.diagnostics do - if params.diagnostics[idx].code == 80001 then - table.remove(params.diagnostics, idx) - else - idx = idx + 1 - end - end - end - vim.lsp.diagnostic.on_publish_diagnostics(_, _, params, client_id, _, config) - end, - }, - filetypes = { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" }; - root_dir = root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git"); -})
D config/nvim/vimscript/barbar.vim

@@ -1,19 +0,0 @@

-" Settings -let bufferline = get(g:, 'bufferline', {}) -let bufferline.icon_close_tab = '🗴' -let bufferline.icons = v:false - -" Mappings -nno <A-1> :BufferGoto 1<cr> -nno <A-2> :BufferGoto 2<cr> -nno <A-3> :BufferGoto 3<cr> -nno <A-4> :BufferGoto 4<cr> -nno <A-5> :BufferGoto 5<cr> -nno <A-6> :BufferGoto 6<cr> -nno <A-7> :BufferGoto 7<cr> -nno <A-8> :BufferGoto 8<cr> -nno <A-9> :BufferGoto 9<cr> -nno <C-w> :BufferClose<cr> -nno <S-x> :BufferClose!<cr> -nno <leader><right> :BufferMoveNext<cr> -nno <leader><left> :BufferMovePrevious<cr>
D config/nvim/vimscript/mappings.vim

@@ -1,36 +0,0 @@

-nno <C-s> :w<cr> -nno <C-p> :GFiles<cr> -nno <C-n> :enew<cr> -nno <leader>; :Files<cr> -nno <space> :noh<cr> - -" Buffer -nno <leader>j :bn<cr> -nno <leader>k :bp<cr> - -" Compe -ino <expr> <tab> pumvisible() ? "\<C-n>" : "\<tab>" -ino <expr> <s-tab> pumvisible() ? "\<C-p>" : "\<tab>" -ino <expr> <cr> compe#confirm('<CR>') -ino <expr> <c-space> compe#complete() -nno sr :lua vim.lsp.buf.rename()<cr> -nno sh :lua vim.lsp.buf.hover()<cr> -nno sd :lua vim.lsp.buf.definition()<cr> -nno sa :lua vim.lsp.buf.code_action()<cr> -nno si :lua vim.lsp.buf.implementation()<cr> - -" Split -nno <C-h> :winc h<cr> -nno <C-j> :winc j<cr> -nno <C-k> :winc k<cr> -nno<C-l> :winc l<cr> - -nno <A-h> :vert res +3<cr> -nno <A-j> :res -3<cr> -nno <A-k> :res +3<cr> -nno <A-l> :vert res -3<cr> - -nno spv :vnew<cr> -nno sph :new<cr> -nno spk :winc K<cr> -nno spl :winc L<cr>
M vscode/settings.json

@@ -1,5 +1,4 @@

{ - "update.showReleaseNotes": false, "window.menuBarVisibility": "toggle", "workbench.iconTheme": "material-icon-theme", "workbench.colorTheme": "GitHub Dark",

@@ -8,11 +7,11 @@ "workbench.editor.untitled.hint": "hidden",

"workbench.startupEditor": "none", "workbench.panel.defaultLocation": "left", "workbench.activityBar.visible": false, - "explorer.compactFolders": false, - "explorer.confirmDragAndDrop": false, - "explorer.confirmDelete": false, + "update.showReleaseNotes": false, + // Editor // "editor.cursorSmoothCaretAnimation": true, "editor.fontFamily": "'Jetbrains Mono', monospace", + "editor.inlineSuggest.enabled": true, "editor.hover.enabled": true, "editor.minimap.enabled": false, "editor.suggestSelection": "first",

@@ -24,28 +23,72 @@ "editor.tabCompletion": "on",

"editor.wordWrap": "off", "editor.fontSize": 14, "editor.tabSize": 4, - "files.insertFinalNewline": true, - "files.trimFinalNewlines": true, - "files.trimTrailingWhitespace": true, - "search.quickOpen.includeHistory": false, + // Files + "explorer.compactFolders": false, + "explorer.confirmDragAndDrop": false, + "explorer.confirmDelete": false, + "files.insertFinalNewline": false, + "files.trimFinalNewlines": false, + "files.trimTrailingWhitespace": false, + "files.exclude": { + "**/node_modules": true, + "**/env": true + }, + // Git "gitlens.codeLens.enabled": true, "git.autofetch": true, "git.confirmSync": false, "git.enableSmartCommit": true, + // Vim + "vim.easymotion": true, + "vim.surround": true, + "vim.useSystemClipboard": true, + "vim.hlsearch": true, + "vim.incsearch": true, + "vim.leader": ";", + "vim.normalModeKeyBindings": [ + { + "before": [ + "<space>" + ], + "commands": [ + ":nohl" + ] + }, + ], + "vim.insertModeKeyBindings": [ + { + "before": [ + "j", + "k" + ], + "after": [ + "<esc>" + ] + } + ], + "vim.handleKeys": { + "<C-w>": false, + "<C-b>": false, + "<C-n>": false, + "<C-h>": false + }, + // Expensions "extensions.ignoreRecommendations": true, "docker.showStartPage": false, "prettier.semi": false, + // Languages "javascript.suggestionActions.enabled": false, "typescript.suggestionActions.enabled": false, - "files.exclude": { - "**/.cache": true, - "**/node_modules": true, - "**/env": true - }, "[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.tabSize": 2 }, - "vim.useSystemClipboard": true, - "editor.inlineSuggest.enabled": true, -} + "workbench.editorAssociations": { + "*.ipynb": "jupyter-notebook" + }, + "notebook.cellToolbarLocation": { + "default": "right", + "jupyter-notebook": "left" + } +}
M zshrc

@@ -10,7 +10,7 @@ ## FzF

export FZF_DEFAULT_COMMAND="fd -t f -t l -E node_modules -E env -E __pycache__" ## Oh my zsh -plugins=(dotenv yarn node) +plugins=(dotenv yarn pip) ZSH_THEME="simple" source "$HOME/.oh-my-zsh/oh-my-zsh.sh"

@@ -19,7 +19,7 @@ eval $(fnm env)

## Aliases alias cls="clear" cp="cp -r" mkdir="mkdir -p" -alias vim="nvim" vi="vim" e="$EDITOR" +alias nvim="lvim" vim="nvim" vi="vim" e="$EDITOR" lv="lvim" alias ...="cd ../.." .3="cd ../../.." alias gor="go run" gob="go build" gog="go get" goi="go install"