16 files changed,
128 insertions(+),
342 deletions(-)
jump to
D
bin/catfetch
··· 1 -#!/bin/sh 2 - 3 -# Kernel version 4 -kernel=$(cat /proc/sys/kernel/osrelease | cut -d '-' -f1) 5 - 6 -# Window manager 7 -[ ! "$wm" ] && [ "$DISPLAY" ] && command -v xprop >/dev/null && { 8 - wmname="$(xprop -id $(xprop -root -notype\ 9 - | awk '$1=="_NET_SUPPORTING_WM_CHECK:"{print $5}') -notype -f _NET_WM_NAME 8t\ 10 - | grep "WM_NAME"\ 11 - | cut -f2 -d \")" 12 -} 13 - 14 -# Shell 15 -shell=$(basename $SHELL) 16 - 17 -# Installed packages 18 -manager=$(which apt pacman yay 2>/dev/null) 19 -manager=${manager##*/} 20 -case "$manager" in 21 - apt) packages="$(dpkg-query -f '${binary:Package}\n' -W | wc -l)" ;; 22 - yay) packages="$(yay -Q | wc -l)" ;; 23 - pacman) packages="$(pacman -Q | wc -l)" ;; 24 -esac 25 - 26 -# Text decorations 27 -bold=$(tput bold) 28 -reset="\e[0m" 29 -blue="\e[36m" 30 - 31 -echo -e " ${blue}${bold} WM ${reset}${wmname}" 32 -echo -e " /\_/\ ${blue}${bold} SHELL ${reset}${shell}" 33 -echo -e " (=^.^=) ${blue}${bold}KERNEL ${reset}${kernel}" 34 -echo -e " (\") (\")_/ ${blue}${bold} PKG ${reset}${packages}"
D
bin/extract
··· 1 -#!/bin/sh 2 -case "$1" in 3 - *.tar.bz2) tar xjf $1 ;; 4 - *.tar.gz) tar xzf $1 ;; 5 - *.bz2) bunzip2 $1 ;; 6 - *.rar) unrar x $1 ;; 7 - *.gz) gunzip $1 ;; 8 - *.tar) tar xf $1 ;; 9 - *.tbz2) tar xjf $1 ;; 10 - *.tgz) tar xzf $1 ;; 11 - *.zip) unzip $1 ;; 12 - *.Z) uncompress $1 ;; 13 - *.7z) 7z x $1 ;; 14 - *.deb) ar x $1 ;; 15 - *.tar.xz) tar xf $1 ;; 16 - *.tar.zst) unzstd $1 ;; 17 - *) echo "'$1' is not a valid file" ;; 18 -esac
M
bin/giti
··· 32 32 case "$1" in 33 33 add|a) shift; add "$@" ;; 34 34 del|d) shift; del "$@" ;; 35 - mv) shift; edit "$@" ;; 35 + mv|m) shift; edit "$@" ;; 36 36 show) shift; show ;; 37 37 help) echo "add|a - [file name] add to ignore." 38 38 echo "del|d - [file name] delete from ignore." 39 - echo "mv - [old] [new] file name for rename." 39 + echo "mv|m - [old] [new] file name for rename." 40 40 echo "show - show ignore file." ;; 41 41 *) echo "Command is not valid. Type 'giti help' for help." ;; 42 42 esac
A
config/lvim/lv-config.lua
··· 1 +--- "lvim" configuration 2 +lvim.format_on_save = false 3 +lvim.lint_on_save = true 4 +lvim.colorscheme = "spacegray" 5 + 6 +lvim.builtin.dashboard.active = true 7 +lvim.builtin.terminal.active = true 8 +lvim.builtin.nvimtree.side = "right" 9 +lvim.builtin.nvimtree.show_icons.git = 0 10 +lvim.builtin.nvimtree.auto_open = 0 11 +lvim.builtin.nvimtree.hide_dotfiles = 0 12 +lvim.builtin.telescope.defaults.layout_config.prompt_position = "top" 13 +lvim.builtin.treesitter.ensure_installed = { "javascript", "jsdoc", "lua", "python" } 14 +lvim.builtin.treesitter.highlight.enabled = true 15 +lvim.builtin.treesitter.indent.disable = { "python" } 16 + 17 +--- keymappings 18 +lvim.leader = "space" 19 +lvim.keys.normal_mode = { 20 + { "<C-s>", "<cmd>w<cr>" }, 21 + { "<C-w>", "<cmd>BufferClose<cr>" }, 22 + -- Navigate split 23 + { "<C-h>", "<cmd>wincmd h<cr>" }, 24 + { "<C-j>", "<cmd>wincmd j<cr>" }, 25 + { "<C-k>", "<cmd>wincmd k<cr>" }, 26 + { "<C-l>", "<cmd>wincmd l<cr>" }, 27 + -- Resize split 28 + { "<A-h>", "<cmd>vert res +2<cr>" }, 29 + { "<A-j>", "<cmd>res -2<cr>" }, 30 + { "<A-k>", "<cmd>res +2<cr>" }, 31 + { "<A-l>", "<cmd>vert res -2<cr>" }, 32 + -- Resize 33 + { "<A-1>", "<cmd>BufferGoto 1<cr>" }, 34 + { "<A-2>", "<cmd>BufferGoto 2<cr>" }, 35 + { "<A-3>", "<cmd>BufferGoto 3<cr>" }, 36 + { "<A-4>", "<cmd>BufferGoto 4<cr>" }, 37 + { "<A-5>", "<cmd>BufferGoto 5<cr>" }, 38 + { "<A-6>", "<cmd>BufferGoto 6<cr>" }, 39 + { "<A-7>", "<cmd>BufferGoto 7<cr>" }, 40 + { "<A-8>", "<cmd>BufferGoto 8<cr>" }, 41 + { "<A-9>", "<cmd>BufferGoto 9<cr>" }, 42 +} 43 + 44 +--- Plugins 45 +lvim.plugins = { 46 +} 47 + 48 +--- LSP 49 +lvim.lang.javascript.lsp.setup.handlers = { 50 + ["textDocument/publishDiagnostics"] = function(_, _, p, client_id, _, config) 51 + if p.diagnostics ~= nil then 52 + local i = 1 53 + while i <= #p.diagnostics do 54 + if p.diagnostics[i].code == 80001 then 55 + table.remove(p.diagnostics, i) 56 + else 57 + i = i + 1 58 + end 59 + end 60 + end 61 + vim.lsp.diagnostic.on_publish_diagnostics(_, _, p, client_id, _, config) 62 + end, 63 +}
D
config/nvim/README.md
··· 1 -# NVIM 2 - 3 -## Install nvim 4 -```bash 5 -# From AUR 6 -yay -S neovim-nightly-bin 7 - 8 -# From pacman 9 -sudo pacman -S neovim 10 -``` 11 - 12 -## Install plugin manager(`vim-plug`) 13 -```bash 14 -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' 15 -``` 16 - 17 -## Install LSP servers 18 -```bash 19 -# Go(gopls) 20 -go get golang.org/x/tools/gopls@latest 21 - 22 -# Efm (linters) 23 -go get github.com/mattn/efm-langserver 24 - 25 -# Python(pyls) 26 -pip install python-language-server 27 - 28 -# JS/TS 29 -nvim +"LspInstall typescript" 30 - 31 -# Lua 32 -nvim +"LspInstall lua" 33 -```
D
config/nvim/init.vim
··· 1 -call plug#begin('~/.vim/plugged') 2 - Plug 'Smirnov-O/nten.vim' 3 - Plug 'hoob3rt/lualine.nvim' 4 - Plug 'romgrk/barbar.nvim' 5 - Plug 'b3nj5m1n/kommentary' 6 - Plug 'jiangmiao/auto-pairs' 7 - Plug 'nvim-lua/plenary.nvim' 8 - Plug 'lewis6991/gitsigns.nvim' 9 - " LSP 10 - Plug 'hrsh7th/nvim-compe' 11 - Plug 'neovim/nvim-lspconfig' 12 - Plug 'kabouzeid/nvim-lspinstall' 13 - " Files 14 - Plug 'junegunn/fzf.vim', {'on': ['Files', 'GFiles']} 15 - " Syntax 16 - Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} 17 - Plug 'sheerun/vim-polyglot' 18 -call plug#end() 19 - 20 -colo codedark 21 -let mapleader=";" 22 - 23 -"== Config 24 -set termguicolors " GUI colors 25 -set nu rnu nocul " Line numbers & cursor line highlight 26 -set nolbr nowrap " Line wrap 27 -set mouse=a mh " Mouse 28 -set history=500 " Set history size 29 -set autoread " Auto read file on change 30 -set hidden " Change buffet without warning 31 -set visualbell t_vb= " Disable sounds 32 -set pumheight=8 " Maximum items in pop up 33 -set modeline " Enable modeline 34 -set nosmd " Disable show mode 35 -set nobk noswf noudf " Swap files 36 -set is ic scs " Search 37 -set spr " Split 38 -set enc=utf-8 fenc=utf-8 " Encoding 39 -set scrolloff=3 " Scroll padding 40 -set list listchars=tab:\|·,trail:~,space:· 41 -set completeopt=menuone,noselect 42 - 43 -"== Netrw file tree 44 -let g:netrw_liststyle = 3 45 -let g:netrw_banner = 0 46 -let g:netrw_dirhistmax = 0 47 - 48 -"== Tab(or spaces) 49 -set ts=4 sw=4 sts=4 50 -set sta et ai 51 - 52 -"== Custom commands 53 -com! Prettier :sil !prettier --no-semi -w % 54 -com! Term :vs|winc L|se nonu nornu|start|term 55 -com! GoFmt :sil !gofmt -w % 56 -com! Black :sil !black % 57 - 58 -"== Filetypes 59 -au FileType go setl noet 60 -au FileType javascript,yaml,json setl et ts=2 sw=2 sts=4 61 -au FileType python setl et ts=4 sw=4 sts=4 ai 62 -autocmd BufReadPost,FileReadPost lua require "lsp_signature".on_attach() 63 - 64 -"== Config's 65 -lua require"config" 66 -so $HOME/.config/nvim/vimscript/barbar.vim 67 -so $HOME/.config/nvim/vimscript/mappings.vim
D
config/nvim/lua/config.lua
··· 1 -require"lspinstall".setup {} 2 -require"lspconfig".gopls.setup {} 3 --- require"lspconfig".pyls.setup {} 4 --- require"lspconfig".rls.setup {} 5 --- require"lspconfig".denols.setup {} 6 --- require"lspconfig".lua.setup{} 7 -require"tsserver" 8 -require"efm" 9 - 10 --- Compe 11 -require'compe'.setup { 12 - enabled = true, 13 - autocomplete = true, 14 - source = { 15 - -- path = true, 16 - buffer = true, 17 - description = true, 18 - nvim_lsp = true 19 - } 20 -} 21 - 22 --- LuaLine 23 -require'lualine'.setup {options={ 24 - theme = "codedark" 25 -}} 26 - 27 --- GitSigns 28 -require'gitsigns'.setup { 29 - signs = { 30 - add = {hl = 'GitSignsAdd', text = '│'}; 31 - change = {hl = 'GitSignsChange', text = '│'}; 32 - delete = {hl = 'GitSignsDelete', text = '_'}; 33 - topdelete = {hl = 'GitSignsDelete', text = '‾'}; 34 - changedelete = {hl = 'GitSignsChange', text = '~'}; 35 - }; 36 - watch_index = {interval = 1000}; 37 - current_line_blame = true, 38 - sign_priority = 6, 39 - update_debounce = 100, 40 - status_formatter = nil, 41 - use_decoration_api = true, 42 - use_internal_diff = true, 43 -} 44 - 45 --- TreeSitter 46 -require'nvim-treesitter.configs'.setup { 47 - ensure_installed = {'javascript', 'typescript', 'jsdoc', 'python', 'go', 'bash'}; 48 - highlight = { 49 - enable=true 50 - }; 51 -}
D
config/nvim/lua/efm.lua
··· 1 --- Python 2 -local flake8 = { 3 - lintCommand = "flake8 --ignore=E501 --stdin-display-name ${INPUT} -", 4 - lintStdin = true, 5 - lintFormats = {"%f:%l:%c: %m"} 6 -} 7 - 8 --- Javascript 9 -local eslint = { 10 - lintCommand = "./node_modules/.bin/eslint -f unix --stdin --stdin-filename ${INPUT}", 11 - lintIgnoreExitCode = true, 12 - lintStdin = true, 13 - lintFormats = {"%f:%l:%c: %m"}, 14 - formatCommand = "./node_modules/.bin/eslint --fix-to-stdout --stdin --stdin-filename=${INPUT}", 15 - formatStdin = true 16 -} 17 - 18 --- GoLang 19 -local golint = { 20 - lintCommand = "golint", 21 - lintIgnoreExitCode = true, 22 - lintFormats = {"%f:%l:%c: %m"}, 23 - lintSource = "golint" 24 -} 25 - 26 --- Setup 27 -require"lspconfig".efm.setup { 28 - init_options = {documentFormatting = false, codeAction = false}, 29 - filetypes = {"python", "javascript", "typescript", "go"}, 30 - settings = { 31 - rootMarkers = {".git/"}, 32 - languages = { 33 - python = {flake8}, 34 - javascript = {eslint}, 35 - typescript = {eslint}, 36 - go = {golint} 37 - }; 38 - }; 39 -}
D
config/nvim/lua/tsserver.lua
··· 1 -local root_pattern = require("lspconfig/util").root_pattern 2 - 3 -require('lspconfig').typescript.setup({ 4 - handlers = { 5 - ["textDocument/publishDiagnostics"] = function(_, _, params, client_id, _, config) 6 - if params.diagnostics ~= nil then 7 - local idx = 1 8 - while idx <= #params.diagnostics do 9 - if params.diagnostics[idx].code == 80001 then 10 - table.remove(params.diagnostics, idx) 11 - else 12 - idx = idx + 1 13 - end 14 - end 15 - end 16 - vim.lsp.diagnostic.on_publish_diagnostics(_, _, params, client_id, _, config) 17 - end, 18 - }, 19 - filetypes = { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" }; 20 - root_dir = root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git"); 21 -})
D
config/nvim/vimscript/barbar.vim
··· 1 -" Settings 2 -let bufferline = get(g:, 'bufferline', {}) 3 -let bufferline.icon_close_tab = '🗴' 4 -let bufferline.icons = v:false 5 - 6 -" Mappings 7 -nno <A-1> :BufferGoto 1<cr> 8 -nno <A-2> :BufferGoto 2<cr> 9 -nno <A-3> :BufferGoto 3<cr> 10 -nno <A-4> :BufferGoto 4<cr> 11 -nno <A-5> :BufferGoto 5<cr> 12 -nno <A-6> :BufferGoto 6<cr> 13 -nno <A-7> :BufferGoto 7<cr> 14 -nno <A-8> :BufferGoto 8<cr> 15 -nno <A-9> :BufferGoto 9<cr> 16 -nno <C-w> :BufferClose<cr> 17 -nno <S-x> :BufferClose!<cr> 18 -nno <leader><right> :BufferMoveNext<cr> 19 -nno <leader><left> :BufferMovePrevious<cr>
D
config/nvim/vimscript/mappings.vim
··· 1 -nno <C-s> :w<cr> 2 -nno <C-p> :GFiles<cr> 3 -nno <C-n> :enew<cr> 4 -nno <leader>; :Files<cr> 5 -nno <space> :noh<cr> 6 - 7 -" Buffer 8 -nno <leader>j :bn<cr> 9 -nno <leader>k :bp<cr> 10 - 11 -" Compe 12 -ino <expr> <tab> pumvisible() ? "\<C-n>" : "\<tab>" 13 -ino <expr> <s-tab> pumvisible() ? "\<C-p>" : "\<tab>" 14 -ino <expr> <cr> compe#confirm('<CR>') 15 -ino <expr> <c-space> compe#complete() 16 -nno sr :lua vim.lsp.buf.rename()<cr> 17 -nno sh :lua vim.lsp.buf.hover()<cr> 18 -nno sd :lua vim.lsp.buf.definition()<cr> 19 -nno sa :lua vim.lsp.buf.code_action()<cr> 20 -nno si :lua vim.lsp.buf.implementation()<cr> 21 - 22 -" Split 23 -nno <C-h> :winc h<cr> 24 -nno <C-j> :winc j<cr> 25 -nno <C-k> :winc k<cr> 26 -nno<C-l> :winc l<cr> 27 - 28 -nno <A-h> :vert res +3<cr> 29 -nno <A-j> :res -3<cr> 30 -nno <A-k> :res +3<cr> 31 -nno <A-l> :vert res -3<cr> 32 - 33 -nno spv :vnew<cr> 34 -nno sph :new<cr> 35 -nno spk :winc K<cr> 36 -nno spl :winc L<cr>
M
vscode/settings.json
··· 1 1 { 2 - "update.showReleaseNotes": false, 3 2 "window.menuBarVisibility": "toggle", 4 3 "workbench.iconTheme": "material-icon-theme", 5 4 "workbench.colorTheme": "GitHub Dark", ··· 8 7 "workbench.startupEditor": "none", 9 8 "workbench.panel.defaultLocation": "left", 10 9 "workbench.activityBar.visible": false, 11 - "explorer.compactFolders": false, 12 - "explorer.confirmDragAndDrop": false, 13 - "explorer.confirmDelete": false, 10 + "update.showReleaseNotes": false, 11 + // Editor 14 12 // "editor.cursorSmoothCaretAnimation": true, 15 13 "editor.fontFamily": "'Jetbrains Mono', monospace", 14 + "editor.inlineSuggest.enabled": true, 16 15 "editor.hover.enabled": true, 17 16 "editor.minimap.enabled": false, 18 17 "editor.suggestSelection": "first", ··· 24 23 "editor.wordWrap": "off", 25 24 "editor.fontSize": 14, 26 25 "editor.tabSize": 4, 27 - "files.insertFinalNewline": true, 28 - "files.trimFinalNewlines": true, 29 - "files.trimTrailingWhitespace": true, 30 - "search.quickOpen.includeHistory": false, 26 + // Files 27 + "explorer.compactFolders": false, 28 + "explorer.confirmDragAndDrop": false, 29 + "explorer.confirmDelete": false, 30 + "files.insertFinalNewline": false, 31 + "files.trimFinalNewlines": false, 32 + "files.trimTrailingWhitespace": false, 33 + "files.exclude": { 34 + "**/node_modules": true, 35 + "**/env": true 36 + }, 37 + // Git 31 38 "gitlens.codeLens.enabled": true, 32 39 "git.autofetch": true, 33 40 "git.confirmSync": false, 34 41 "git.enableSmartCommit": true, 42 + // Vim 43 + "vim.easymotion": true, 44 + "vim.surround": true, 45 + "vim.useSystemClipboard": true, 46 + "vim.hlsearch": true, 47 + "vim.incsearch": true, 48 + "vim.leader": ";", 49 + "vim.normalModeKeyBindings": [ 50 + { 51 + "before": [ 52 + "<space>" 53 + ], 54 + "commands": [ 55 + ":nohl" 56 + ] 57 + }, 58 + ], 59 + "vim.insertModeKeyBindings": [ 60 + { 61 + "before": [ 62 + "j", 63 + "k" 64 + ], 65 + "after": [ 66 + "<esc>" 67 + ] 68 + } 69 + ], 70 + "vim.handleKeys": { 71 + "<C-w>": false, 72 + "<C-b>": false, 73 + "<C-n>": false, 74 + "<C-h>": false 75 + }, 76 + // Expensions 35 77 "extensions.ignoreRecommendations": true, 36 78 "docker.showStartPage": false, 37 79 "prettier.semi": false, 80 + // Languages 38 81 "javascript.suggestionActions.enabled": false, 39 82 "typescript.suggestionActions.enabled": false, 40 - "files.exclude": { 41 - "**/.cache": true, 42 - "**/node_modules": true, 43 - "**/env": true 44 - }, 45 83 "[javascript]": { 46 84 "editor.defaultFormatter": "esbenp.prettier-vscode", 47 85 "editor.tabSize": 2 48 86 }, 49 - "vim.useSystemClipboard": true, 50 - "editor.inlineSuggest.enabled": true, 51 -} 87 + "workbench.editorAssociations": { 88 + "*.ipynb": "jupyter-notebook" 89 + }, 90 + "notebook.cellToolbarLocation": { 91 + "default": "right", 92 + "jupyter-notebook": "left" 93 + } 94 +}
M
zshrc
··· 10 10 export FZF_DEFAULT_COMMAND="fd -t f -t l -E node_modules -E env -E __pycache__" 11 11 12 12 ## Oh my zsh 13 -plugins=(dotenv yarn node) 13 +plugins=(dotenv yarn pip) 14 14 ZSH_THEME="simple" 15 15 source "$HOME/.oh-my-zsh/oh-my-zsh.sh" 16 16 ··· 19 19 20 20 ## Aliases 21 21 alias cls="clear" cp="cp -r" mkdir="mkdir -p" 22 -alias vim="nvim" vi="vim" e="$EDITOR" 22 +alias nvim="lvim" vim="nvim" vi="vim" e="$EDITOR" lv="lvim" 23 23 alias ...="cd ../.." .3="cd ../../.." 24 24 alias gor="go run" gob="go build" gog="go get" goi="go install" 25 25