diff options
| author | Mitchell Riedstra <mitch@riedstra.dev> | 2025-12-29 00:19:53 -0500 |
|---|---|---|
| committer | Mitchell Riedstra <mitch@riedstra.dev> | 2025-12-29 00:19:53 -0500 |
| commit | c0d94cdc444c06356c1b64d5a7073ff41dffab81 (patch) | |
| tree | f0713f79fd9943937d78b68fcd2d37246460950a | |
| parent | 0b19dbf19ac79657aa74c68b7f0e32b2525184ae (diff) | |
| download | dotfiles-c0d94cdc444c06356c1b64d5a7073ff41dffab81.tar.gz dotfiles-c0d94cdc444c06356c1b64d5a7073ff41dffab81.tar.xz | |
Tweaks to nvim config. Add notes on compiling for OpenBSD
| -rwxr-xr-x | compile/nvim.sh | 25 | ||||
| -rw-r--r-- | dotfiles/nvim/init.lua | 7 | ||||
| -rwxr-xr-x | install.sh | 2 |
3 files changed, 26 insertions, 8 deletions
diff --git a/compile/nvim.sh b/compile/nvim.sh index de0c4f8..ac669ac 100755 --- a/compile/nvim.sh +++ b/compile/nvim.sh @@ -5,16 +5,31 @@ if [ "$(id -u)" -eq 0 ] ; then fi set -ex nproc=1 -if [ $(uname) = "Darwin" ] ; then - nproc="$(sysctl -n hw.ncpu)" -elif [ $(uname) = "Linux" ] ; then - nproc="$(nproc)" -fi +case "$(uname)" in +Darwin|OpenBSD) nproc="$(sysctl -n hw.ncpu)" ;; +Linux) nproc="$(nproc)" ;; +esac codedir="${CODEDIR:-$HOME/scm}" nvimdir="${codedir}/nvim" + +# On OpenBSD: +# Workaround for OpenBSD's make being called endlessly... +# #!/bin/sh +# exec gmake "$@" +# Call it `make` and place it in your path before the system make. +# Then: +# pkg_add gmake cmake cargo rust clang-tools-extra +# Also in the environment: +# LIBCLANG_PATH=/usr/local/llvm21/lib +# CARGO_TARGET_DIR=$HOME/.cache/cargo-target-dir # /tmp is usually small... +# Then cargo for tree-sitter-cli... +# cargo install tree-sitter-cli +# Also add ~/.cargo/bin to your path when you're done. + if ! [ -d "$nvimdir" ] ; then git clone https://github.com/neovim/neovim "$nvimdir" fi + cd "$nvimdir" git clean -fdx . rm -rf build || echo "" diff --git a/dotfiles/nvim/init.lua b/dotfiles/nvim/init.lua index 8770e83..8d5edb9 100644 --- a/dotfiles/nvim/init.lua +++ b/dotfiles/nvim/init.lua @@ -42,10 +42,13 @@ vim.pack.add({'https://github.com/nvim-telescope/telescope.nvim'}) -- `pacman -S tree-sitter-cli` or similar if you get tons of errors... -- ls ~/.local/share/nvim/site/parser/ -- can also be useful -require'nvim-treesitter'.install { 'bash', 'c', 'cpp', 'go', 'gomod', 'java', 'javascript', 'lua', 'zig' } +require'nvim-treesitter'.install { + 'bash', 'c', 'cpp', 'go', 'gomod', 'java', 'javascript', 'lua', 'zig', + 'markdown' +} vim.api.nvim_create_autocmd('FileType', { - pattern = { 'lua', 'c', 'cpp', 'go', 'gomod', 'sh', 'bash', 'js' }, + pattern = { 'lua', 'c', 'cpp', 'go', 'gomod', 'sh', 'bash', 'js', 'markdown' }, callback = function() vim.treesitter.start() end, }) @@ -38,7 +38,7 @@ done _nvimdir="${confdir}/nvim" if ! [ -d "$_nvimdir" ] ; then - mkdir "$_nvimdir" + mkdir -p "$_nvimdir" fi setLink -s "$(pwd)/dotfiles/nvim/init.lua" -d "$_nvimdir/init.lua" |
