diff --git a/bin/arch-upd b/bin/arch-upd index c518df8..e8b0edf 100755 --- a/bin/arch-upd +++ b/bin/arch-upd @@ -1,4 +1,4 @@ #!/bin/sh sudo pacman -Syyuu --noconfirm yay -Sua --noconfirm -sudo pacman -Rs $(pacman -Qdtq) --noconfirm \ No newline at end of file +sudo pacman -Rs $(pacman -Qdtq) --noconfirm diff --git a/bin/catfetch b/bin/catfetch deleted file mode 100755 index 66d7bed..0000000 --- a/bin/catfetch +++ /dev/null @@ -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}" diff --git a/bin/extract b/bin/extract deleted file mode 100755 index b7c3663..0000000 --- a/bin/extract +++ /dev/null @@ -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 diff --git a/bin/giti b/bin/giti index 1a9b2ee..806d32a 100755 --- a/bin/giti +++ b/bin/giti @@ -32,11 +32,11 @@ function show() { 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 diff --git a/bin/ipp b/bin/ipp deleted file mode 100755 index 9159866..0000000 --- a/bin/ipp +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -curl ifconfig.co diff --git a/config/bspwm/README.md b/config/bspwm/README.md index 0a64c33..97dee62 100644 --- a/config/bspwm/README.md +++ b/config/bspwm/README.md @@ -1,6 +1,6 @@ # BSPWM -[](screen.png) +[](./screen.png) -------------- ### Install diff --git a/config/lvim/lv-config.lua b/config/lvim/lv-config.lua new file mode 100644 index 0000000..58f06a7 --- /dev/null +++ b/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 = { + { "", "w" }, + { "", "BufferClose" }, + -- Navigate split + { "", "wincmd h" }, + { "", "wincmd j" }, + { "", "wincmd k" }, + { "", "wincmd l" }, + -- Resize split + { "", "vert res +2" }, + { "", "res -2" }, + { "", "res +2" }, + { "", "vert res -2" }, + -- Resize + { "", "BufferGoto 1" }, + { "", "BufferGoto 2" }, + { "", "BufferGoto 3" }, + { "", "BufferGoto 4" }, + { "", "BufferGoto 5" }, + { "", "BufferGoto 6" }, + { "", "BufferGoto 7" }, + { "", "BufferGoto 8" }, + { "", "BufferGoto 9" }, +} + +--- 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, +} diff --git a/config/nvim/README.md b/config/nvim/README.md deleted file mode 100644 index 1e33db3..0000000 --- a/config/nvim/README.md +++ /dev/null @@ -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" -``` diff --git a/config/nvim/init.vim b/config/nvim/init.vim deleted file mode 100644 index 32b1585..0000000 --- a/config/nvim/init.vim +++ /dev/null @@ -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 diff --git a/config/nvim/lua/config.lua b/config/nvim/lua/config.lua deleted file mode 100644 index 173356c..0000000 --- a/config/nvim/lua/config.lua +++ /dev/null @@ -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 - }; -} diff --git a/config/nvim/lua/efm.lua b/config/nvim/lua/efm.lua deleted file mode 100644 index dddd2d0..0000000 --- a/config/nvim/lua/efm.lua +++ /dev/null @@ -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} - }; - }; -} diff --git a/config/nvim/lua/tsserver.lua b/config/nvim/lua/tsserver.lua deleted file mode 100644 index 5c42e55..0000000 --- a/config/nvim/lua/tsserver.lua +++ /dev/null @@ -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"); -}) diff --git a/config/nvim/vimscript/barbar.vim b/config/nvim/vimscript/barbar.vim deleted file mode 100644 index 88a4be8..0000000 --- a/config/nvim/vimscript/barbar.vim +++ /dev/null @@ -1,19 +0,0 @@ -" Settings -let bufferline = get(g:, 'bufferline', {}) -let bufferline.icon_close_tab = '🗴' -let bufferline.icons = v:false - -" Mappings -nno :BufferGoto 1 -nno :BufferGoto 2 -nno :BufferGoto 3 -nno :BufferGoto 4 -nno :BufferGoto 5 -nno :BufferGoto 6 -nno :BufferGoto 7 -nno :BufferGoto 8 -nno :BufferGoto 9 -nno :BufferClose -nno :BufferClose! -nno :BufferMoveNext -nno :BufferMovePrevious diff --git a/config/nvim/vimscript/mappings.vim b/config/nvim/vimscript/mappings.vim deleted file mode 100644 index b27dd25..0000000 --- a/config/nvim/vimscript/mappings.vim +++ /dev/null @@ -1,36 +0,0 @@ -nno :w -nno :GFiles -nno :enew -nno ; :Files -nno :noh - -" Buffer -nno j :bn -nno k :bp - -" Compe -ino pumvisible() ? "\" : "\" -ino pumvisible() ? "\" : "\" -ino compe#confirm('') -ino compe#complete() -nno sr :lua vim.lsp.buf.rename() -nno sh :lua vim.lsp.buf.hover() -nno sd :lua vim.lsp.buf.definition() -nno sa :lua vim.lsp.buf.code_action() -nno si :lua vim.lsp.buf.implementation() - -" Split -nno :winc h -nno :winc j -nno :winc k -nno :winc l - -nno :vert res +3 -nno :res -3 -nno :res +3 -nno :vert res -3 - -nno spv :vnew -nno sph :new -nno spk :winc K -nno spl :winc L diff --git a/vscode/settings.json b/vscode/settings.json index 4365404..305b3bb 100644 --- a/vscode/settings.json +++ b/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.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.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": [ + "" + ], + "commands": [ + ":nohl" + ] + }, + ], + "vim.insertModeKeyBindings": [ + { + "before": [ + "j", + "k" + ], + "after": [ + "" + ] + } + ], + "vim.handleKeys": { + "": false, + "": false, + "": false, + "": 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" + } +} \ No newline at end of file diff --git a/zshrc b/zshrc index 6df0b1e..50e45f9 100644 --- a/zshrc +++ b/zshrc @@ -10,7 +10,7 @@ export EDITOR="nvim" 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"