diff --git a/.bash_after b/.bash_after index b784655..967f16e 100644 --- a/.bash_after +++ b/.bash_after @@ -5,8 +5,8 @@ # ~/.bash_aliases, instead of adding them to ~/.bashrc directly. # See /usr/share/doc/bash-doc/examples in the bash-doc package. -if [ -f ~/.bash_aliases ]; then - . ~/.bash_aliases +if [ -f "$HOME/.bash_aliases" ]; then + . "$HOME/.bash_aliases" fi # Preferred editor for local and remote sessions @@ -38,7 +38,7 @@ export FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS \ --color='marker:#fc9867,spinner:#bcef8a,header:#fc9867'" # Set up Broot -source /home/schneider/.config/broot/launcher/bash/br +source $HOME/.config/broot/launcher/bash/br # Options for Multiwfn and xTB export OMP_STACKSIZE=200M @@ -48,7 +48,7 @@ export OMP_STACKSIZE=200M . "$HOME/.cargo/env" # Set up Haskell environment -[ -f "/home/schneider/.ghcup/env" ] && source "/home/schneider/.ghcup/env" +[ -f "$HOME/.ghcup/env" ] && source "$HOME/.ghcup/env" # Correct errors in previous console commands eval "$(thefuck --alias)" @@ -56,5 +56,8 @@ eval "$(thefuck --alias)" # Generated for envman. Do not edit. [ -s "$HOME/.config/envman/load.sh" ] && source "$HOME/.config/envman/load.sh" +# Set up fnm environment +eval "$(fnm env --use-on-cd --version-file-strategy=recursive)" + # Last thing of this file, starship eval "$(starship init zsh)" diff --git a/.bash_before b/.bash_before index 6071e0d..00fa8fe 100644 --- a/.bash_before +++ b/.bash_before @@ -8,9 +8,12 @@ if ! command -v pyenv &> /dev/null; then fi eval "$(pyenv init -)" +# juliaup configuration +export PATH=$HOME/.juliaup/bin:$PATH + # You might have to change your $PATH. # We update $PATH first, as code down the road relies on it. -export PATH=~/.local/bin:$PATH +export PATH=$HOME/.local/bin:$PATH # Alda binaries export PATH=/opt/alda:$PATH @@ -34,12 +37,8 @@ export PATH=$Multiwfnpath:$PATH export GOPATH="$HOME/.go" export PATH="$GOPATH/bin:/opt/go/bin:$PATH" -# fnm -export PATH=/home/schneider/.fnm:$PATH -eval "$(fnm env --use-on-cd)" - -# npm installed packages -export PATH=~/.npm-global/bin:$PATH +# fnm/npm installed packages +export PATH=$HOME/.fnm:$PATH # Before anything else, start tmux if command -v tmux &> /dev/null && [ -z "$TMUX" ] && diff --git a/.bash_completion/poetry b/.bash_completion/poetry index 712e0cf..d415f94 100644 --- a/.bash_completion/poetry +++ b/.bash_completion/poetry @@ -197,4 +197,4 @@ _poetry_596bbf7c262849f4_complete() } complete -o default -F _poetry_596bbf7c262849f4_complete poetry -complete -o default -F _poetry_596bbf7c262849f4_complete /home/schneider/.local/share/pypoetry/venv/bin/poetry +complete -o default -F _poetry_596bbf7c262849f4_complete ~/.local/share/pypoetry/venv/bin/poetry diff --git a/.bashrc b/.bashrc index cd8461a..92b1588 100644 --- a/.bashrc +++ b/.bashrc @@ -6,21 +6,10 @@ # Things shared between bash and zsh that should come before. # This includes changes to $PATH. -if [ -f ~/.bash_before ]; then - . ~/.bash_before +if [ -f "$HOME/.bash_before" ]; then + . "$HOME/.bash_before" fi -# >>> juliaup initialize >>> - -# !! Contents within this block are managed by juliaup !! - -case ":$PATH:" in *:/home/schneider/.juliaup/bin:*) ;; *) - export PATH=/home/schneider/.juliaup/bin${PATH:+:${PATH}} - ;; -esac - -# <<< juliaup initialize <<< - # If not running interactively, don't do anything [ -z "$PS1" ] && return @@ -96,18 +85,13 @@ esac #fi # Completions -source ~/.bash_completion/alacritty -source ~/.bash_completion/poetry - -# Completions for fzf -source /usr/share/doc/fzf/examples/key-bindings.bash -source /usr/share/doc/fzf/examples/completion.bash +source $HOME/.bash_completion/alacritty # Smarter cd command eval "$(zoxide init bash)" # Things shared between bash and zsh that should come after. # This includes almost all exports and aliases. -if [ -f ~/.bash_after ]; then - . ~/.bash_after -fi +if [ -f "$HOME/.bash_after" ]; then + . "$HOME/.bash_after" +fi \ No newline at end of file diff --git a/.config/Code/User/settings.json b/.config/Code/User/settings.json index 4886202..fdfd689 100644 --- a/.config/Code/User/settings.json +++ b/.config/Code/User/settings.json @@ -1,97 +1,98 @@ { - "editor.defaultFormatter": "esbenp.prettier-vscode", - "editor.fontFamily": "'JetBrainsMono Nerd Font', 'Droid Sans Mono', 'monospace', monospace", - "editor.fontLigatures": true, - "editor.formatOnPaste": true, - "editor.formatOnSave": true, - "editor.formatOnSaveMode": "modificationsIfAvailable", - "editor.formatOnType": true, - "editor.inlineSuggest.enabled": true, - "editor.lineNumbers": "relative", - "editor.minimap.renderCharacters": false, - "editor.minimap.showSlider": "always", - "editor.minimap.size": "fill", - "editor.wordWrap": "off", - "prettier.tabWidth": 4, - "workbench.colorTheme": "One Monokai", - "github.copilot.enable": { - "*": true, - "markdown": true, - "plaintext": true, - "yaml": true - }, - "go.toolsManagement.autoUpdate": true, - "python.analysis.typeCheckingMode": "strict", - "python.formatting.provider": "black", - "python.linting.mypyEnabled": true, - "python.linting.prospectorEnabled": true, - "python.testing.pytestEnabled": true, - "julia.NumThreads": 6, - "julia.enableCrashReporter": true, - "julia.enableTelemetry": true, - "julia.symbolCacheDownload": true, - "terminal.integrated.commandsToSkipShell": ["language-julia.interrupt"], - "html.format.indentHandlebars": true, - "html.format.indentInnerHtml": true, - "html.format.templating": true, - "latex-workshop.bibtex-fields.sort.enabled": true, - "latex-workshop.bibtex-format.sort.enabled": true, - "latex-workshop.bibtex-format.trailingComma": true, - "latex-workshop.latex.autoBuild.run": "never", - "latex-workshop.latex.autoClean.run": "onFailed", - "latex-workshop.linting.chktex.enabled": true, - "latex-workshop.linting.delay": 1000, - "latex-workshop.texcount.autorun": "onSave", - "ltex.additionalRules.enablePickyRules": true, - "ltex.additionalRules.motherTongue": "pt-BR", - "ltex.completionEnabled": true, - "quarto.mathjax.theme": "dark", - "quarto.render.previewType": "external", - "quarto.render.renderOnSave": true, - "svelte.enable-ts-plugin": true, - "svelte.plugin.svelte.defaultScriptLanguage": "ts", - "svelte.plugin.svelte.format.config.singleQuote": true, - "svelte.plugin.svelte.format.config.svelteStrictMode": true, - "svelte.plugin.svelte.note-new-transformation": false, - "svelte.plugin.svelte.useNewTransformation": true, - "tailwindCSS.emmetCompletions": true, - "tailwindCSS.includeLanguages": { - "svelte": "html" - }, - "files.associations": { - "*.css": "tailwindcss" - }, - "[rust]": { - "editor.defaultFormatter": "rust-lang.rust-analyzer" - }, - "[go]": { - "editor.defaultFormatter": "golang.go" - }, - "[go.mod]": { - "editor.defaultFormatter": "golang.go" - }, - "[go.sum]": { - "editor.defaultFormatter": "golang.go" - }, - "[python]": { - "editor.defaultFormatter": "ms-python.python" - }, - "[julia]": { - "editor.defaultFormatter": "julialang.language-julia" - }, - "[latex]": { - "editor.defaultFormatter": "James-Yu.latex-workshop" - }, - "[bibtex]": { - "editor.defaultFormatter": "James-Yu.latex-workshop" - }, - "[markdown]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[html]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[svelte]": { - "editor.defaultFormatter": "svelte.svelte-vscode" - } -} + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.fontFamily": "'JetBrainsMono Nerd Font', 'Droid Sans Mono', 'monospace', monospace", + "editor.fontLigatures": true, + "editor.formatOnPaste": true, + "editor.formatOnSave": true, + "editor.formatOnSaveMode": "modificationsIfAvailable", + "editor.formatOnType": true, + "editor.inlineSuggest.enabled": true, + "editor.lineNumbers": "relative", + "editor.minimap.renderCharacters": false, + "editor.minimap.showSlider": "always", + "editor.minimap.size": "fill", + "editor.wordWrap": "off", + "prettier.tabWidth": 4, + "workbench.colorTheme": "One Monokai", + "github.copilot.enable": { + "*": true, + "markdown": true, + "plaintext": true, + "yaml": true + }, + "go.toolsManagement.autoUpdate": true, + "python.analysis.typeCheckingMode": "strict", + "python.formatting.provider": "black", + "python.linting.mypyEnabled": true, + "python.testing.pytestEnabled": true, + "julia.NumThreads": 6, + "julia.enableCrashReporter": true, + "julia.enableTelemetry": true, + "julia.symbolCacheDownload": true, + "terminal.integrated.commandsToSkipShell": [ + "language-julia.interrupt" + ], + "html.format.indentHandlebars": true, + "html.format.indentInnerHtml": true, + "html.format.templating": true, + "latex-workshop.bibtex-fields.sort.enabled": true, + "latex-workshop.bibtex-format.sort.enabled": true, + "latex-workshop.bibtex-format.trailingComma": true, + "latex-workshop.latex.autoBuild.run": "never", + "latex-workshop.latex.autoClean.run": "onFailed", + "latex-workshop.linting.chktex.enabled": true, + "latex-workshop.linting.delay": 1000, + "latex-workshop.texcount.autorun": "onSave", + "ltex.additionalRules.enablePickyRules": true, + "ltex.additionalRules.motherTongue": "pt-BR", + "ltex.completionEnabled": true, + "quarto.mathjax.theme": "dark", + "quarto.render.previewType": "external", + "quarto.render.renderOnSave": true, + "svelte.enable-ts-plugin": true, + "svelte.plugin.svelte.defaultScriptLanguage": "ts", + "svelte.plugin.svelte.format.config.singleQuote": true, + "svelte.plugin.svelte.format.config.svelteStrictMode": true, + "svelte.plugin.svelte.note-new-transformation": false, + "svelte.plugin.svelte.useNewTransformation": true, + "tailwindCSS.emmetCompletions": true, + "tailwindCSS.includeLanguages": { + "svelte": "html" + }, + "files.associations": { + "*.css": "tailwindcss" + }, + "[rust]": { + "editor.defaultFormatter": "rust-lang.rust-analyzer" + }, + "[go]": { + "editor.defaultFormatter": "golang.go" + }, + "[go.mod]": { + "editor.defaultFormatter": "golang.go" + }, + "[go.sum]": { + "editor.defaultFormatter": "golang.go" + }, + "[python]": { + "editor.defaultFormatter": "ms-python.python" + }, + "[julia]": { + "editor.defaultFormatter": "julialang.language-julia" + }, + "[latex]": { + "editor.defaultFormatter": "James-Yu.latex-workshop" + }, + "[bibtex]": { + "editor.defaultFormatter": "James-Yu.latex-workshop" + }, + "[markdown]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[html]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[svelte]": { + "editor.defaultFormatter": "svelte.svelte-vscode" + } +} \ No newline at end of file diff --git a/.gitconfig b/.gitconfig index 0191079..1cebf14 100644 --- a/.gitconfig +++ b/.gitconfig @@ -27,7 +27,7 @@ status = auto [init] defaultBranch = main - templateDir = /home/schneider/.git-templates/git-secrets + templateDir = ~/.git-templates/git-secrets [alias] ignore = "!gi() { curl -sL https://www.gitignore.io/api/$@ ;}; gi" [credential "https://github.com"] diff --git a/.vimrc b/.vimrc index 219cc9d..38fd906 100644 --- a/.vimrc +++ b/.vimrc @@ -103,9 +103,6 @@ let g:markdown_fenced_languages = [ \ 'vimscript=vim', \ ] -" Syntax highlighting for Prolog -let g:filetype_pl="prolog" - " Four indents, space between redirects, indented case statements, simplified. let g:shfmt_extra_args = '-i 4 -sr -ci -s' @@ -333,101 +330,13 @@ let g:ale_echo_msg_warning_str = 'W' let g:ale_echo_msg_format = '[%linter%] %s [%severity%]' -" TODO: transfer some or most of those installs to install.sh -" Install the latest rust-analyzer if missing. -if !executable('rust-analyzer') - execute '!mkdir -p ' . '~/.local/bin' - execute '!curl -L - \ https://github.com/rust-analyzer/rust-analyzer/releases/latest/download/rust-analyzer-x86_64-unknown-linux-gnu.gz - \ | gunzip -c - > ~/.local/bin/rust-analyzer' - execute '!chmod +x ~/.local/bin/rust-analyzer' -end - -" Optional static typing for Python -if !executable('mypy') - execute '!pip install -U mypy' -end - -" Static type checker for Python -if !executable('pyright') - execute '!pip install -U pyright' -end - -" Performant type-checking for python -if !executable('pyre') - execute '!pip install -U pyre-check' -end - -" Check the style and quality of some python code. -" It glues together pycodestyle, pyflakes, mccabe, and third-party plugins. -if !executable('flake8') - execute '!pip install -U flake8' -end - -" Provide information about type and location of classes, methods and more -if !executable('prospector') - execute '!pip install -U prospector' -end - -" Bandit is a tool designed to find common security issues in Python code -if !executable('bandit') - execute '!pip install -U bandit' -end - -" Find dead Python code -if !executable('vulture') - execute '!pip install -U vulture' -end - -" JavaScript Style Guide, with linter & automatic code fixer -if !executable('standard') - execute '!npm install -g standard' -end - -" A JSON parser and validator with a CLI -if !executable('jsonlint') - execute '!npm install jsonlint -g' -end - -" Style checker and lint tool for Markdown -if !executable('markdownlint') - execute '!npm install -g markdownlint-cli' -end - -" Natural language linter for text and markdown -if !executable('textlint') - execute '!npm install -g textlint' -end - -" A linter for prose -if !executable('proselint') - execute '!pip install -U proselint' -end - -" Naive linter for English prose -if !executable('write-good') - execute '!npm install -g write-good' -end - -" Catch insensitive, inconsiderate writing -if !executable('alex') - execute '!npm install -g alex' -end - -" A Spell Checker for Code! -if !executable('cspell') - execute '!npm install -g cspell' -end - " Fixers. -" TODO: add more let g:ale_fixers = { \ 'rust': ['rustfmt', 'remove_trailing_lines', 'trim_whitespace'], \ '*': ['remove_trailing_lines', 'trim_whitespace'], \ } " Linters. -" TODO: add more let g:ale_linters = { \ 'rust': ['analyzer'], \ } @@ -501,7 +410,6 @@ call plug#begin(data_dir . '/plugged') Plug 'dense-analysis/ale' " Asynchronous lint engine Plug 'metakirby5/codi.vim' " Interactive coding scratchpad Plug 'github/copilot.vim' " GitHub copilot - Plug 'prettier/vim-prettier', { 'do': 'npm install' } " Format with Prettier " }}} " {{{ Personal Wiki Plug 'vimwiki/vimwiki' diff --git a/.zsh_functions/_poetry b/.zsh_functions/_poetry index 4272a11..46e7412 100644 --- a/.zsh_functions/_poetry +++ b/.zsh_functions/_poetry @@ -192,4 +192,4 @@ _poetry_596bbf7c262849f4_complete() } _poetry_596bbf7c262849f4_complete "$@" -compdef _poetry_596bbf7c262849f4_complete /home/schneider/.local/share/pypoetry/venv/bin/poetry +compdef _poetry_596bbf7c262849f4_complete ~/.local/share/pypoetry/venv/bin/poetry diff --git a/.zshrc b/.zshrc index bc1dc1b..9620659 100644 --- a/.zshrc +++ b/.zshrc @@ -1,18 +1,9 @@ # Things shared between bash and zsh that should come before. # This includes changes to $PATH. -if [ -f ~/.bash_before ]; then - . ~/.bash_before +if [ -f "$HOME/.bash_before" ]; then + . "$HOME/.bash_before" fi -# >>> juliaup initialize >>> - -# !! Contents within this block are managed by juliaup !! - -path=('/home/schneider/.juliaup/bin' $path) -export PATH - -# <<< juliaup initialize <<< - # Path to your oh-my-zsh installation. export ZSH="$HOME/.oh-my-zsh" @@ -87,6 +78,7 @@ plugins=( git gh golang + fnm npm python pyenv @@ -123,15 +115,11 @@ source $ZSH/oh-my-zsh.sh # Completions fpath+=${ZDOTDIR:-~}/.zsh_functions -# Completions for fzf -source /usr/share/doc/fzf/examples/key-bindings.zsh -source /usr/share/doc/fzf/examples/completion.zsh - # Smarter cd command eval "$(zoxide init zsh)" # Things shared between bash and zsh that should come after. # This includes almost all exports and aliases. -if [ -f ~/.bash_after ]; then - . ~/.bash_after +if [ -f "$HOME/.bash_after" ]; then + . "$HOME/.bash_after" fi diff --git a/install.sh b/install.sh index e8c2b07..3b28360 100644 --- a/install.sh +++ b/install.sh @@ -90,7 +90,7 @@ fi echo echo -if [[ ! -d ~/.oh-my-zsh ]]; then +if [[ ! -d "$HOME/.oh-my-zsh" ]]; then info "Installing oh-my-zsh...\n" sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" else @@ -129,12 +129,26 @@ else success "zsh-syntax-highlighting is already installed\n" fi -# TODO: add node/npm/fnm +install "fnm" 'curl -fsSL https://fnm.vercel.app/install | bash' install "ghcup" "curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh" install "poetry" 'curl -sSL https://install.python-poetry.org | python3 -' -install "texlab" "cargo install texlab" install "tsc" "npm install -g typescript@latest" +# Language servers +install "awk-language-server" "npm install -g \"awk-language-server@>=0.5.2\"" +install "bash-language-server" "npm install -g bash-language-server" +install "pylsp" "pip install -U 'python-lsp-server[all]'" +install "rust-analyzer" "rustup component add rust-analyzer" +install "svelteserver" "npm install -g svelte-language-server" +install "taplo" "cargo install taplo-cli --features lsp" +install "texlab" "cargo install texlab" +install "typescript-language-server" "npm install -g typescript typescript-language-server" +install "vscode-css-language-server" "npm install -g vscode-langservers-extracted" # works with SCSS too +install "vscode-html-language-server" "npm install -g vscode-langservers-extracted" +install "vscode-json-language-server" "npm install -g vscode-langservers-extracted" +install "yaml-language-server" "npm install -g yaml-language-server" +julia -e "using Pkg; Pkg.add(\"LanguageServer\")" + install "broot" 'cargo install broot && broot --install' install "chktex" "sudo apt install chktex -y" install "delta" 'cargo install git-delta' @@ -192,8 +206,6 @@ code "https://github.com/sharkdp/fd/releases\n\n" info "vivid:\n" code "https://github.com/sharkdp/vivid/releases\n\n" -# TODO: add a Prolog interpreter (scryer-prolog) - echo echo