diff --git a/.gitignore b/.gitignore index 4801c18..3f6b95c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,7 @@ entropy/mail/.msmtprc entropy/vpn/credentials.txt entropy/vpn/openconnect.txt +tycho/nvim/plugin +pallas/nvim/plugin + **/*.swp diff --git a/pallas/.gitconfig b/pallas/.gitconfig new file mode 100644 index 0000000..7e63165 --- /dev/null +++ b/pallas/.gitconfig @@ -0,0 +1,28 @@ +[user] + name = Felix Suchert + email = dev@felixsuchert.de + signingkey = F8634A1CFF7D61608503A70B24363525EA0E8A99 +[push] + default = simple +[commit] + gpgsign = true + template = ~/.gitcommit_template +[core] + excludesfile = /Users/felix/.global_gitignore + pager = delta +[pull] + rebase = true + +[interactive] + diffFilter = delta --color-only + +[delta] + features = side-by-side line-numbers decorations + whitespace-error-style = 22 reverse + +[delta "decorations"] + commit-decoration-style = bold yellow box ul + file-style = bold yellow ul + file-decoration-style = none +[init] + defaultBranch = main diff --git a/pallas/.global_gitignore b/pallas/.global_gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/pallas/.global_gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/pallas/.vimrc b/pallas/.vimrc new file mode 100644 index 0000000..a2c4a29 --- /dev/null +++ b/pallas/.vimrc @@ -0,0 +1,125 @@ +filetype plugin indent on +syntax on + +" enable autocompletion of ale +let g:ale_completion_enabled = 1 +" disable latex linting from ale as i've got my own plugin for that +let g:ale_linters = {'rust': ['analyzer'], 'tex': []} +let g:ale_fixers = {'c': ['clang-format']} + + +" Initialize plugin system +call plug#begin('~/.vim/plugged') + +" Make sure you use single quotes + +" Shorthand notation; fetches https://github.com/morhetz/gruvbox +Plug 'morhetz/gruvbox' + +" Any valid git URL is allowed +Plug 'https://github.com/scrooloose/nerdcommenter.git' + +" On-demand loading for languages +Plug 'rust-lang/rust.vim', { 'for': 'rust' } +Plug 'cespare/vim-toml', { 'for': 'toml' } +Plug 'keith/swift.vim', { 'for': 'swift' } +" Plug 'neovimhaskell/haskell-vim', { 'for': 'haskell' } + +Plug 'vim-syntastic/syntastic' +Plug 'vim-airline/vim-airline' +Plug 'tpope/vim-fugitive' +Plug 'airblade/vim-gitgutter' +Plug 'justinmk/vim-sneak' +Plug 'lervag/vimtex' +Plug 'editorconfig/editorconfig-vim' +Plug 'LnL7/vim-nix' +Plug 'xevz/vim-squirrel' +Plug 'preservim/nerdtree' + +" Plugin outside ~/.vim/plugged with post-update hook +Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } +Plug 'junegunn/fzf.vim' + +" ale language server client +Plug 'dense-analysis/ale' + +" Initialize plugin system +call plug#end() + +" open fzf files in new tab instead of new buffer +"command! -bang -nargs=? -complete=dir Files + "\ call fzf#vim#files(, {'sink': 'tabedit', 'options': ['--info=inline', '--preview', '~/.vim/plugged/fzf.vim/bin/preview.sh {}']}, 0) + +set laststatus=2 +let g:airline#extensions#tabline#enabled = 1 +"let g:airline_powerline_fonts = 1 + +" window switching by # +let g:airline_section_c = '[%{winnr()}] %t' +nnoremap 1 1w +nnoremap 2 2w +nnoremap 3 3w +nnoremap 4 4w +nnoremap 5 5w +nnoremap 6 6w +nnoremap 7 7w +nnoremap 8 8w +nnoremap 9 9w +nnoremap 0 10w + +" possible setting as alternative for easymotion +" let g:sneak#label = 1 + +set backspace=indent,eol,start + +" map the leader key to , +let mapleader="," + +" Cycling through windows and tabs -- made by Pius :D +" nnoremap j +" nnoremap k +" nnoremap l +" nnoremap h +" nnoremap _ +" nnoremap _ +" nnoremap \| +" nnoremap \| +map h :tabp +map l :tabn +map :bprevious +map :bnext +map f :Files +map bl :Buffers + +" fix auto-completion +set wildmenu " show a completion menu +set wildignorecase +set wildignore=*.o,*~,*.pyc,*.aux,*.bbl,*.blg,*-blx.bib,*.log,*.out,*.run.xml, + \*.toc,*.nav,*.snm " ignore auxiliary files +" set completeopt-=preview + +" automatically reload files changed on disk but not in buffer +set autoread +" hide buffers on switch +set hidden + +" tex configuration +let g:tex_flavor='latex' +" Optics +colorscheme gruvbox +set background=dark " Setting dark mode + +set number +set relativenumber +set tabstop=4 +set shiftwidth=4 +set expandtab + +" keep 5 lines of context above/below the cursor (if possible) +set scrolloff=5 + +" Search +set hlsearch " Highlight all search results +set smartcase " Enable smart-case search +set ignorecase " Always case-insensitive +set incsearch " Searches for strings incrementally diff --git a/pallas/create_home.sh b/pallas/create_home.sh new file mode 100755 index 0000000..e46cfd7 --- /dev/null +++ b/pallas/create_home.sh @@ -0,0 +1,212 @@ +#!/usr/bin/env bash + +printf '\033[33m + + ___ ___ ___ ___ ___ ___ + /\ \ /\ \ /\__\ /\__\ /\ \ /\ \ + /::\ \ /::\ \ /:/ / /:/ / /::\ \ /::\ \ + /:/\:\ \ /:/\:\ \ /:/ / /:/ / /:/\:\ \ /:/\ \ \ + /::\~\:\ \ /::\~\:\ \ /:/ / /:/ / /::\~\:\ \ _\:\~\ \ \ + /:/\:\ \:\__\ /:/\:\ \:\__\ /:/__/ /:/__/ /:/\:\ \:\__\ /\ \:\ \ \__\ + \/__\:\/:/ / \/__\:\/:/ / \:\ \ \:\ \ \/__\:\/:/ / \:\ \:\ \/__/ + \::/ / \::/ / \:\ \ \:\ \ \::/ / \:\ \:\__\ + \/__/ /:/ / \:\ \ \:\ \ /:/ / \:\/:/ / + /:/ / \:\__\ \:\__\ /:/ / \::/ / + \/__/ \/__/ \/__/ \/__/ \/__/ + + +This script will now install the dotfiles and configurations for `pallas`. +\033[39m' + +echo "[note] Please make sure you have a working version of gpg installed (e.g., GPGTools)." +echo "[note] Also, please make sure a private key is installed." +echo "[note] Finally, you should have a working ssh config in place to interact with github and other servers." +read -p "Are you ready to go? [y/n] " ready +if [ $ready != "y" ]; then + exit +fi + +# ~/.macos β€” https://mths.be/macos + +# Close any open System Preferences panes, to prevent them from overriding +# settings we’re about to change +osascript -e 'tell application "System Preferences" to quit' + +# Ask for the administrator password upfront +sudo -v + +# Keep-alive: update existing `sudo` time stamp until `.macos` has finished +while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & + +printf "\033[33m[info] Setting Hostname\033[39m" +# Set computer name (as done via System Preferences β†’ Sharing) +sudo scutil --set ComputerName "pallas" +sudo scutil --set HostName "pallas" +sudo scutil --set LocalHostName "pallas" +sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "pallas" + + +printf "\033[33m[info] Linking config files\033[39m" +ln -s $PWD/.gitconfig ~/.gitconfig +ln -s $PWD/.global_gitignore ~/.global_gitignore +ln -s $PWD/git-commit-template.txt ~/.gitcommit_template + +mkdir -p ~/.config/alacritty +ln -s $PWD/terminal/alacritty.toml ~/.config/alacritty/alacritty.toml +# enable font smoothing in alacritty +defaults write -g AppleFontSmoothing -int 0 + +ln -s $PWD/terminal/wezterm/ ~/.config/wezterm + +touch ~/.hushlogin +# ln -s $PWD/.yabairc ~/.yabairc + + +printf "\033[33m[info] Installing Homebrew\033[39m" +# we need the xcode tools +xcode-select --install +if test ! $(which brew); then + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" +fi + +printf "\033[33m[info] Installing some basic binaries\033[39m" +brew install fish +sudo echo "/usr/local/bin/fish" >> /etc/shells +chsh -s /usr/local/bin/fish + +binaries=( + pass + git + ncdu + tldr + gnu-tar + gnu-sed + neomutt + msmtp + isync + notmuch + borgbackup + helix + rust-analyzer + git-delta + btop + cmake + curl + ffmpeg + flex + bison + fzf + gpgme + hledger + imagemagick + jq + librsvg + llvm + lua + go + mosh + ninja + pdfpc + zola + zellij + yt-dlp + xkcd + wget + unzip + tree + tree-sitter + tmux + sigtop + ripgrep + qrencode + python + pygments + neovim + bitwarden + keepingyouawake + alacritty + wezterm + starship + lsd + bat + arduino + adobe-acrobat-reader + audacity + calibre + discord + docker + dropbox + firefox@nightly + font-hack-nerd-font + font-iosevka + font-iosevka-nerd-font + font-iosevka-term-nerd-font + gimp + gitkraken + gog-galaxy + gstreamer-runtime + imhex + inkscape + keepingyouawake + libreoffice + mactex + magicavoxel + mark-text + neovide + obsidian + openttd + signal + spotify + steam + stolendata-mpv + telegram + temurin + thunderbird + tor-browser + virtualbox + vlc + vscodium + wezterm + wine-stable + zoom + zotero + zsa-wally +) + +brew install ${binaries[@]} + + +printf "\033[33m[info] Cloning password store\033[39m" +git clone git@code.dummyco.de:feliix42/pass.git ~/.password-store + + +printf "\033[33m[info] Setting up neomutt\033[39m" +ln -s $PWD/mail/.mailcap ~/.mailcap +ln -s $PWD/mail/.mbsyncrc ~/.mbsyncrc +ln -s $PWD/mail/.msmtprc ~/.msmtprc +ln -s $PWD/mail/.notmuch-config ~/.notmuch-config +ln -s $PWD/mail/neomutt ~/.config/neomutt + +# TODO: +# fetch? + + +printf "\033[33m[info] Setting up Fish Shell\033[39m" +mkdir -p ~/.config/fish/ +ln -s $PWD/terminal/config.fish ~/.config/fish/config.fish +git clone git@github.com:oh-my-fish/plugin-foreign-env.git ~/.config/fish/plugin-foreign-env + +printf "\033[33m[info] Setting up vim\033[39m" + +curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim +ln -s $PWD/.vimrc ~/.vimrc +vim -c "PlugInstall" + + +printf "\033[33m[info] Setting up nvim\033[39m" +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' +ln -s $PWD/nvim ~/.config/nvim +nvim -c "PlugInstall" + + diff --git a/pallas/git-commit-template.txt b/pallas/git-commit-template.txt new file mode 100644 index 0000000..5547f9d --- /dev/null +++ b/pallas/git-commit-template.txt @@ -0,0 +1,27 @@ + + +# 50 Chars ---->| +# 72 Characters ---->| + +# Type can be +# ✨ feat (new feature) +# πŸ› fix (bug fix) +# πŸ“š docs (changes to documentation) +# 🌹 style (formatting, missing semi colons, etc; no code change) +# πŸ“ refactor (refactoring production code) +# πŸ” test (adding missing tests, refactoring tests; no production code change) +# πŸ’ͺ chore (updating grunt tasks etc; no production code change) +# 🚒 ship (bump a version; release) +# -------------------- +# Remember to +# Separate subject from body with a blank line +# Limit the subject line to 50 characters +# Capitalize the subject line +# Do not end the subject line with a period +# Use the imperative mood in the subject line +# Wrap the body at 72 characters +# Use the body to explain what and why vs. how +# Can use multiple lines with "-" for bullet points in body +# -------------------- +# For more information about this template, check out +# https://gist.github.com/adeekshith/cd4c95a064977cdc6c50 diff --git a/pallas/nvim/init.lua b/pallas/nvim/init.lua new file mode 100644 index 0000000..43b9fa2 --- /dev/null +++ b/pallas/nvim/init.lua @@ -0,0 +1,123 @@ +-- plugin manager +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +-- comma as leader +vim.g.mapleader = "," + +-- load plugins +require('plugins') + +-- load legacy options +vim.cmd([[ + " so ~/.config/nvim/legacy.vim + let $FZF_DEFAULT_COMMAND = 'rg --files --hidden' + let g:tex_flavor='latex' + autocmd FileType hledger setlocal omnifunc=hledger#complete#omnifunc + autocmd FileType ledger setlocal omnifunc=hledger#complete#omnifunc +]]) + +require('completion') +require('lsp-setup') + +-- nvim-treesitter +require('nvim-treesitter.configs').setup { + ensure_installed = { + "c", "lua", "vim", "query", + "gitattributes", "gitcommit", "gitignore", + "json", "markdown", "yaml", "toml", + "make", "nix", "bash", + "php", "html", "css", + "python", "rust", + }, + highlight = { + enable = true, + }, +} + +-- lualine theme +require('lualine').setup { + options = { + theme = 'gruvbox-baby', + -- no separators between lualine elements + -- section_separators = '', + -- component_separators = '' + } +} + +-- to disable the default netrw file browser +-- vim.g.loaded_netrw = 1 +-- vim.g.loaded_netrwPlugin = 1 + +vim.opt.termguicolors = true +require("bufferline").setup{} + +-- settings for neovide +if vim.g.neovide then + vim.o.guifont = "Iosevka Term Medium:h12" +end + +vim.opt.backspace = "indent,eol,start" + +-- fix auto-completion +vim.opt.wildmenu = true +vim.opt.wildignorecase = true +vim.opt.wildignore = "*.o,*~,*.pyc,*.aux,*.bbl,*.blg,*-blx.bib,*.log,*.out,*.run.xml,*.toc,*.nav,*.snm" + +-- BUFFER HANDLING --------------------------------- +-- automatically reload files changed on disk but not in buffer +vim.opt.autoread = true +-- hide buffers on switch +vim.opt.hidden = true + +-- OPTICS & NUMBERING BEHAVIOUR -------------------- +vim.opt.number = true +vim.opt.relativenumber = true +vim.opt.tabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.expandtab = true +-- keep 5 lines of context above/below the cursor (if possible) +vim.opt.scrolloff = 5 + + +-- SEARCH ------------------------------------------ +-- highlight all search results +vim.opt.hlsearch = true +-- enable smart-case search +vim.opt.smartcase = true +-- always case-insensitive +vim.opt.ignorecase = true +-- searches for strings incrementally +vim.opt.incsearch = true + +-- key bindings +-- empty mode string matches n, v, o +vim.keymap.set("", "h", ":tabp", { desc = "Select previous tab" }) +vim.keymap.set("", "l", ":tabn", { desc = "Select next tab" }) +vim.keymap.set("", "", ":bprevious", { desc = "Select previous buffer" }) +vim.keymap.set("", "", ":bnext", { desc = "Select next buffer" }) + +vim.keymap.set("", "f", ":Files", { desc = "Open FZF file finder" }) +vim.keymap.set("", "bl", ":Buffers", { desc = "Open FZF buffer list" }) + +vim.keymap.set("n", "1", "1w", { noremap = true }) +vim.keymap.set("n", "2", "2w", { noremap = true }) +vim.keymap.set("n", "3", "3w", { noremap = true }) +vim.keymap.set("n", "4", "4w", { noremap = true }) +vim.keymap.set("n", "5", "5w", { noremap = true }) +vim.keymap.set("n", "6", "6w", { noremap = true }) +vim.keymap.set("n", "7", "7w", { noremap = true }) +vim.keymap.set("n", "8", "8w", { noremap = true }) +vim.keymap.set("n", "9", "9w", { noremap = true }) +vim.keymap.set("n", "0", "10w", { noremap = true }) + diff --git a/pallas/nvim/lazy-lock.json b/pallas/nvim/lazy-lock.json new file mode 100644 index 0000000..53a8d5c --- /dev/null +++ b/pallas/nvim/lazy-lock.json @@ -0,0 +1,31 @@ +{ + "bufferline.nvim": { "branch": "main", "commit": "2e3c8cc5a57ddd32f1edd2ffd2ccb10c09421f6c" }, + "clangd_extensions.nvim": { "branch": "main", "commit": "8f7b72100883e0e34400d9518d40a03f21e4d0a6" }, + "cmake-tools.nvim": { "branch": "master", "commit": "f1f917b584127b673c25138233cebf1d61a19f35" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "031e6ba70b0ad5eee49fd2120ff7a2e325b17fa7" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "editorconfig-vim": { "branch": "master", "commit": "ba2ce027c5b0e523e658d24657ce3ae3306c9fe0" }, + "fzf": { "branch": "master", "commit": "7bd5884d120c4a746813c8de5af9a3186abe4df0" }, + "fzf.vim": { "branch": "master", "commit": "ec75ffbfd50630bf2b8d444d89487e149bacf7f3" }, + "gruvbox-baby": { "branch": "main", "commit": "bd52e62d8134647090108189e69c8b3cd18bdbbf" }, + "hledger-vim": { "branch": "master", "commit": "f9b4171f0ce2562dd804305a1ed087eaf6a4f028" }, + "lazy.nvim": { "branch": "main", "commit": "1159bdccd8910a0fd0914b24d6c3d186689023d9" }, + "lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" }, + "neoformat": { "branch": "master", "commit": "d9d3311097eacdba9bd7a425b267d304b509e7ea" }, + "nerdcommenter": { "branch": "master", "commit": "3f860f2d981547c18f2c9599e3c358ea488c3be4" }, + "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, + "nvim-lspconfig": { "branch": "master", "commit": "7c4d0f77b8323ff679010706292e5caa4a13d8e6" }, + "nvim-treesitter": { "branch": "master", "commit": "86728435273b63fe71fa64a66c2a6d49e94613a2" }, + "nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" }, + "oil.nvim": { "branch": "master", "commit": "ccab9d5e09e2d0042fbbe5b6bd05e82426247067" }, + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, + "rust.vim": { "branch": "master", "commit": "889b9a7515db477f4cb6808bef1769e53493c578" }, + "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, + "vim-nix": { "branch": "master", "commit": "e25cd0f2e5922f1f4d3cd969f92e35a9a327ffb0" }, + "vim-toml": { "branch": "main", "commit": "d36caa6b1cf508a4df1c691f915572fc02143258" }, + "vim-vsnip": { "branch": "master", "commit": "02a8e79295c9733434aab4e0e2b8c4b7cea9f3a9" }, + "vimtex": { "branch": "master", "commit": "9a5ef1d4ac8e4e06071179ebe8121350fcb97861" } +} diff --git a/pallas/nvim/legacy.vim b/pallas/nvim/legacy.vim new file mode 100644 index 0000000..a2140be --- /dev/null +++ b/pallas/nvim/legacy.vim @@ -0,0 +1,126 @@ +" this is enabled by default in nvim +" filetype plugin indent on +" syntax on + +" enable autocompletion of ale +"let g:ale_completion_enabled = 1 +" disable latex linting from ale as i've got my own plugin for that +"let g:ale_linters = {'rust': ['analyzer'], 'tex': []} +"let g:ale_fixers = {'c': ['clang-format']} + + +"" Initialize plugin system +"call plug#begin(stdpath('data') . '/plugged') + +"" Make sure you use single quotes + +"" Shorthand notation; fetches https://github.com/morhetz/gruvbox +"" Plug 'morhetz/gruvbox' +"Plug 'drewtempelmeyer/palenight.vim' + +"" Any valid git URL is allowed +"Plug 'https://github.com/scrooloose/nerdcommenter.git' + +"" On-demand loading for languages +"Plug 'rust-lang/rust.vim', { 'for': 'rust' } +"Plug 'cespare/vim-toml', { 'for': 'toml' } +"Plug 'keith/swift.vim', { 'for': 'swift' } +"" Plug 'neovimhaskell/haskell-vim', { 'for': 'haskell' } + +"Plug 'vim-syntastic/syntastic' +"Plug 'vim-airline/vim-airline' +"Plug 'tpope/vim-fugitive' +"Plug 'airblade/vim-gitgutter' +"Plug 'justinmk/vim-sneak' +"Plug 'lervag/vimtex' +"Plug 'editorconfig/editorconfig-vim' +"Plug 'LnL7/vim-nix' +"Plug 'xevz/vim-squirrel' +"Plug 'preservim/nerdtree' + +"" Plugin outside ~/.vim/plugged with post-update hook +"Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } +"Plug 'junegunn/fzf.vim' + +"" ale language server client +"Plug 'dense-analysis/ale' + +"" Initialize plugin system +"call plug#end() + +" open fzf files in new tab instead of new buffer +"command! -bang -nargs=? -complete=dir Files + "\ call fzf#vim#files(, {'sink': 'tabedit', 'options': ['--info=inline', '--preview', '~/.vim/plugged/fzf.vim/bin/preview.sh {}']}, 0) + +"set laststatus=2 +"let g:airline#extensions#tabline#enabled = 1 +"let g:airline_powerline_fonts = 1 + +" window switching by # +"let g:airline_section_c = '[%{winnr()}] %t' +"nnoremap 1 1w +"nnoremap 2 2w +"nnoremap 3 3w +"nnoremap 4 4w +"nnoremap 5 5w +"nnoremap 6 6w +"nnoremap 7 7w +"nnoremap 8 8w +"nnoremap 9 9w +"nnoremap 0 10w + +" possible setting as alternative for easymotion +" let g:sneak#label = 1 + +"set backspace=indent,eol,start + +"let $FZF_DEFAULT_COMMAND = 'rg --files --hidden' + +" Cycling through windows and tabs +" nnoremap j +" nnoremap k +" nnoremap l +" nnoremap h +" nnoremap _ +" nnoremap _ +" nnoremap \| +" nnoremap \| +"map h :tabp +"map l :tabn +"map :bprevious +"map :bnext +"map f :Files +"map bl :Buffers + +" fix auto-completion +"set wildmenu " show a completion menu +"set wildignorecase +"set wildignore=*.o,*~,*.pyc,*.aux,*.bbl,*.blg,*-blx.bib,*.log,*.out,*.run.xml, + "\*.toc,*.nav,*.snm " ignore auxiliary files +" set completeopt-=preview + +" automatically reload files changed on disk but not in buffer +"set autoread +" hide buffers on switch +"set hidden + +" tex configuration +"let g:tex_flavor='latex' +" Optics +"colorscheme palenight "gruvbox +"set background=dark " Setting dark mode + +"set number +"set relativenumber +"set tabstop=4 +"set shiftwidth=4 +"set expandtab + +" keep 5 lines of context above/below the cursor (if possible) +"set scrolloff=5 + +"" Search +"set hlsearch " Highlight all search results +"set smartcase " Enable smart-case search +"set ignorecase " Always case-insensitive +"set incsearch " Searches for strings incrementally diff --git a/pallas/nvim/lua/completion.lua b/pallas/nvim/lua/completion.lua new file mode 100644 index 0000000..4be193a --- /dev/null +++ b/pallas/nvim/lua/completion.lua @@ -0,0 +1,68 @@ +-- Set up nvim-cmp. +local cmp = require'cmp' + +cmp.setup({ + snippet = { + expand = function(args) + vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. + end, + }, + window = { + -- completion = cmp.config.window.bordered(), + -- documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }), + [''] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }), + [''] = cmp.mapping(cmp.mapping.select_next_item(), { 'i', 'c' }), + [''] = cmp.mapping(cmp.mapping.select_prev_item(), { 'i', 'c' }), + [''] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }), + [''] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `` mapping. + [''] = cmp.mapping({ + i = cmp.mapping.abort(), + c = cmp.mapping.close(), + }), + [''] = cmp.mapping.confirm({ select = false }), -- Accept currently elected item. Set `select` to `false` to only confirm explicitly selected items. + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'nvim_lsp_signature_help' }, + { name = 'vsnip' }, -- For vsnip users. + }, { + { name = 'buffer' }, + }) +}) + +-- Set configuration for specific filetype. +cmp.setup.filetype('gitcommit', { + sources = cmp.config.sources({ + { name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it. + }, { + { name = 'buffer' }, + }) +}) + +-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). +cmp.setup.cmdline({ '/', '?' }, { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = 'buffer' } + } +}) + +-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). +cmp.setup.cmdline(':', { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = 'path' } + }, { + { name = 'cmdline' } + }) +}) + +-- Set up lspconfig. +--local capabilities = require('cmp_nvim_lsp').default_capabilities() +-- Replace with each lsp server you've enabled. +--require('lspconfig')[''].setup { + --capabilities = capabilities +--} diff --git a/pallas/nvim/lua/lsp-setup.lua b/pallas/nvim/lua/lsp-setup.lua new file mode 100644 index 0000000..384e08f --- /dev/null +++ b/pallas/nvim/lua/lsp-setup.lua @@ -0,0 +1,71 @@ +-- Mappings. +-- See `:help vim.diagnostic.*` for documentation on any of the below functions +local opts = { noremap=true, silent=true } +vim.api.nvim_set_keymap('n', ',e', 'lua vim.diagnostic.open_float()', opts) +vim.api.nvim_set_keymap('n', 'ge', 'lua vim.diagnostic.goto_prev()', opts) +vim.api.nvim_set_keymap('n', 'gE', 'lua vim.diagnostic.goto_next()', opts) +vim.api.nvim_set_keymap('n', ',q', 'lua vim.diagnostic.setloclist()', opts) + +-- Use an on_attach function to only map the following keys +-- after the language server attaches to the current buffer +local on_attach = function(client, bufnr) + -- Enable completion triggered by + vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') + + -- Mappings. + -- See `:help vim.lsp.*` for documentation on any of the below functions + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', 'lua vim.lsp.buf.declaration()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', 'lua vim.lsp.buf.definition()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', 'lua vim.lsp.buf.hover()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi', 'lua vim.lsp.buf.implementation()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 's', 'lua vim.lsp.buf.signature_help()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'i', ',s', 'lua vim.lsp.buf.signature_help()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', ',wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', ',wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', ',wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', ',D', 'lua vim.lsp.buf.type_definition()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', ',rn', 'lua vim.lsp.buf.rename()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', ',qf', 'lua vim.lsp.buf.code_action()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', 'lua vim.lsp.buf.references()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', ',F', 'lua vim.lsp.buf.format { async = true }', opts) +end + +-- Use a loop to conveniently call 'setup' on multiple servers and +-- map buffer local keybindings when the language server attaches +local servers = { 'clangd', 'rust_analyzer', 'nil_ls' } +for _, lsp in pairs(servers) do + require('lspconfig')[lsp].setup { + on_attach = on_attach, + flags = { + -- This will be the default in neovim 0.7+ + debounce_text_changes = 150, + } + } +end + +require('lspconfig').clangd.setup{ + on_attach = on_attach, + cmd = { + "clangd", + "--background-index", + "--pch-storage=memory", + "--clang-tidy", + "--suggest-missing-includes", + "--all-scopes-completion", + "--pretty", + "--header-insertion=never", + "-j=4", + "--inlay-hints", + "--header-insertion-decorators", + }, + filetypes = {"c", "cpp", "objc", "objcpp"}, + -- root_dir = utils.root_pattern("compile_commands.json", "compile_flags.txt", ".git") + init_option = { fallbackFlags = { "-std=c++2a" } } +} + +local capabilities = require('cmp_nvim_lsp').default_capabilities() + +require('lspconfig').pyright.setup { + on_attach = on_attach, + capabilities = capabilities +} diff --git a/pallas/nvim/lua/plugins.lua b/pallas/nvim/lua/plugins.lua new file mode 100644 index 0000000..dac814e --- /dev/null +++ b/pallas/nvim/lua/plugins.lua @@ -0,0 +1,66 @@ +return require('lazy').setup({ + -- theme + -- use {'morhetz/gruvbox', config = function() vim.cmd.colorscheme("gruvbox") end } + {'luisiacc/gruvbox-baby', config = function() + vim.g.gruvbox_baby_transparent_mode = 1 + vim.cmd.colorscheme("gruvbox-baby") + end }, + -- use 'drewtempelmeyer/palenight.vim' + { 'stevedylandev/flexoki-nvim', as = 'flexoki', config = function() vim.cmd.colorscheme("flexoki") end, enabled = false }, + + -- utility plugins + { 'nvim-tree/nvim-web-devicons', lazy = true }, + { "nvim-lua/plenary.nvim", lazy = true }, + + -- UI + { + 'nvim-lualine/lualine.nvim', + dependencies = 'nvim-tree/nvim-web-devicons' + }, + {'akinsho/bufferline.nvim', version = "*", dependencies = 'nvim-tree/nvim-web-devicons' }, + + -- commenting and text formatting + 'scrooloose/nerdcommenter', + 'sbdchd/neoformat', + + -- directory editing + { + 'stevearc/oil.nvim', + dependencies = 'nvim-tree/nvim-web-devicons', + config = function() require('oil').setup() end + }, + + -- fuzzy file finder + { 'junegunn/fzf', build = function() vim.fn['fzf#install'](0) end }, + 'junegunn/fzf.vim', + + -- On-demand loading for languages + { 'rust-lang/rust.vim', ft = "rust" }, + { 'cespare/vim-toml', ft = "toml" }, + -- use 'keith/swift.vim' + -- use 'neovimhaskell/haskell-vim' + { 'Civitasv/cmake-tools.nvim', dependencies = "nvim-lua/plenary.nvim" }, + { 'anekos/hledger-vim' }, + + -- Treesitter + { 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate' }, + + -- LSP plugins + 'neovim/nvim-lspconfig', + 'p00f/clangd_extensions.nvim', + 'hrsh7th/cmp-nvim-lsp', + 'hrsh7th/cmp-buffer', + 'hrsh7th/cmp-path', + 'hrsh7th/cmp-cmdline', + 'hrsh7th/nvim-cmp', + 'hrsh7th/cmp-nvim-lsp-signature-help', + -- snippet engine + 'hrsh7th/vim-vsnip', + + 'tpope/vim-fugitive', + 'lervag/vimtex', + 'editorconfig/editorconfig-vim', + 'LnL7/vim-nix' + + -- 'xevz/vim-squirrel' +}) diff --git a/pallas/terminal/alacritty.toml b/pallas/terminal/alacritty.toml new file mode 100644 index 0000000..d2832db --- /dev/null +++ b/pallas/terminal/alacritty.toml @@ -0,0 +1,133 @@ +live_config_reload = true +working_directory = "None" + +[bell] +animation = "EaseOutExpo" +color = "0xffffff" +duration = 0 + +[colors] +draw_bold_text_with_bright_colors = true + +[colors.bright] +black = "0x666666" +blue = "0x7aa6da" +cyan = "0x54ced6" +green = "0x9ec400" +magenta = "0xb77ee0" +red = "0xff3334" +white = "0xffffff" +yellow = "0xe7c547" + +[colors.normal] +black = "0x000000" +blue = "0x7aa6da" +cyan = "0x70c0ba" +green = "0xb9ca4a" +magenta = "0xc397d8" +red = "0xd54e53" +white = "0xeaeaea" +yellow = "0xe6c547" + +[colors.primary] +background = "0x202020" +foreground = "0xeaeaea" + +[cursor] +style = "Block" +unfocused_hollow = true + +[debug] +log_level = "Warn" +persistent_logging = false +print_events = false +render_timer = false + +[font] +size = 12.0 + +[font.glyph_offset] +x = 0 +y = 0 + +[font.normal] +family = "IosevkaTerm NFM Medium" + +[font.offset] +x = 0 +y = 0 + +[[keyboard.bindings]] +action = "Paste" +key = "Paste" + +[[keyboard.bindings]] +action = "Copy" +key = "Copy" + +[[keyboard.bindings]] +action = "ClearLogNotice" +key = "L" +mods = "Control" + +[[keyboard.bindings]] +chars = "\f" +key = "L" +mods = "Control" + +[[keyboard.bindings]] +action = "ScrollPageUp" +key = "PageUp" +mode = "~Alt" +mods = "Shift" + +[[keyboard.bindings]] +action = "ScrollPageDown" +key = "PageDown" +mode = "~Alt" +mods = "Shift" + +[[keyboard.bindings]] +action = "ScrollToTop" +key = "Home" +mode = "~Alt" +mods = "Shift" + +[[keyboard.bindings]] +action = "ScrollToBottom" +key = "End" +mode = "~Alt" +mods = "Shift" + +[mouse] +hide_when_typing = false + +[[mouse.bindings]] +action = "PasteSelection" +mouse = "Middle" + +[scrolling] +history = 10000 +multiplier = 3 + +[selection] +save_to_clipboard = false +semantic_escape_chars = ",β”‚`|:\"' ()[]{}<>\t" + +[window] +decorations = "full" +dynamic_padding = false +opacity = 1.0 +startup_mode = "Windowed" + +[window.class] +general = "Alacritty" +instance = "Alacritty" + +[window.dimensions] +columns = 0 +lines = 0 + +[window.padding] +x = 0 +y = 0 diff --git a/pallas/terminal/config.fish b/pallas/terminal/config.fish new file mode 100644 index 0000000..f59158d --- /dev/null +++ b/pallas/terminal/config.fish @@ -0,0 +1,63 @@ +# manual locale override + +export LANG="en_US.UTF-8" +export LC_COLLATE="en_US.UTF-8" +export LC_CTYPE="de_DE.UTF-8" +export LC_MESSAGES="en_US.UTF-8" +export LC_MONETARY="de_DE.UTF-8" +export LC_NUMERIC="de_DE.UTF-8" +export LC_TIME="de_DE.UTF-8" +export LC_ALL="en_GB.UTF-8" + +export PATH="/usr/local/opt/gnu-tar/libexec/gnubin:/usr/local/opt/gnu-sed/libexec/gnubin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/Library/TeX/texbin:$HOME/.cargo/bin:$HOME/.local/bin:$HOME/Library/Python/3.8/bin" + +# kitty terminal emulator auto completion +# kitty + complete setup fish | source + +# fancier ls +alias ls="lsd" + +# better vscode +alias code="codium" + +# fsr password store +alias fsrpass="env PASSWORD_STORE_DIR=/Users/felix/fsr/passwords pass" + +## some aliases taken from old zshrc +alias full-update="brew update; brew upgrade; brew cleanup; rustup self update; rustup update" +alias l="lsd -la" +alias calculator="python3 -i -c 'from math import *'" +alias music="screen -dR music cmus" +alias pennmush="telnet mush.pennmush.org 4201" + +## fluff +alias fucking="sudo" + +# mache dinge +alias mache="make" +alias alles="all" +alias sauber="clean" +alias renne="run" + + +# initialize starship +eval (starship init fish) + +## easily share small files via my uberspace +function share + scp -q $argv gibbs:~/html/share/ + echo "https://share.felixsuchert.de/"$argv + echo "https://share.felixsuchert.de/"$argv | pbcopy +end + +# set up GPG pinentry +set -gx GPG_TTY (tty) + +###### Nix Setup ###### +# include this plugin so nix will work +# https://github.com/NixOS/nix/issues/1512 +# https://github.com/oh-my-fish/plugin-foreign-env +set fish_function_path $fish_function_path $HOME/.config/fish/plugin-foreign-env/functions + +# initialize nix +fenv source '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' diff --git a/pallas/terminal/wezterm/wezterm.lua b/pallas/terminal/wezterm/wezterm.lua new file mode 100644 index 0000000..14c803d --- /dev/null +++ b/pallas/terminal/wezterm/wezterm.lua @@ -0,0 +1,58 @@ +-- Import the wezterm module +local wezterm = require 'wezterm' +-- Creates a config object which we will be adding our config to +local config = wezterm.config_builder() + +-- Find them here: https://wezfurlong.org/wezterm/colorschemes/index.html +-- config.color_scheme = 'Ayu Dark (Gogh)' +config.color_scheme = 'GruvboxDarkHard' + +-- Choose your favourite font, make sure it's installed on your machine +config.font = wezterm.font({ family = 'Iosevka Medium' }) +-- And a font size that won't have you squinting +config.font_size = 12 + +-- Slightly transparent and blurred background +config.window_background_opacity = 0.9 +config.macos_window_background_blur = 30 +-- Removes the title bar, leaving only the tab bar. Keeps +-- the ability to resize by dragging the window's edges. +-- On macOS, 'RESIZE|INTEGRATED_BUTTONS' also looks nice if +-- you want to keep the window controls visible and integrate +-- them into the tab bar. +config.window_decorations = 'RESIZE|INTEGRATED_BUTTONS' +-- Sets the font for the window frame (tab bar) +config.window_frame = { + -- Berkeley Mono for me again, though an idea could be to try a + -- serif font here instead of monospace for a nicer look? + font = wezterm.font({ family = 'Iosevka Medium', weight = 'Bold' }), + font_size = 12, +} + +wezterm.on('update-status', function(window) + -- Grab the utf8 character for the "powerline" left facing + -- solid arrow. + local SOLID_LEFT_ARROW = utf8.char(0xe0b2) + + -- Grab the current window's configuration, and from it the + -- palette (this is the combination of your chosen colour scheme + -- including any overrides). + local color_scheme = window:effective_config().resolved_palette + local bg = color_scheme.background + local fg = color_scheme.foreground + + window:set_right_status(wezterm.format({ + -- First, we draw the arrow... + { Background = { Color = 'none' } }, + { Foreground = { Color = bg } }, + { Text = SOLID_LEFT_ARROW }, + -- Then we draw our text + { Background = { Color = bg } }, + { Foreground = { Color = fg } }, + { Text = ' ' .. wezterm.hostname() .. ' ' }, + })) +end) + +-- Returns our config to be evaluated. We must always do this at the bottom of this file +return config +