diff --git a/.mise.toml b/.mise.toml index decd338..b9ffd7c 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,4 +1,3 @@ [tools] node = "24.12.0" pnpm = "11.15.1" -neovim = "0.12.4" diff --git a/.prettierignore b/.prettierignore index b2739ad..f65222f 100644 --- a/.prettierignore +++ b/.prettierignore @@ -6,4 +6,3 @@ node_modules/ target/ pnpm-lock.yaml -cli/nvim/lazy-lock.json diff --git a/README.md b/README.md index 642bf9c..2350ce3 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ brew install mise git clone https://github.com/viqueen/devbox.git cd devbox -# install tools (node, pnpm, neovim) +# install tools (node, pnpm) mise install # install dependencies @@ -26,7 +26,7 @@ pnpm install # optional: workspace-aware prompt ./setup.sh config_prompt -# optional: neovim with lazy.nvim +# optional: vim with an easy-on-the-eyes theme ./setup.sh config_vim ``` @@ -36,11 +36,10 @@ pnpm install Defined in `.mise.toml` and symlinked to `~/.mise.toml` by `config_box`: -| Tool | Purpose | -| ------ | --------------- | -| node | Node.js runtime | -| pnpm | Package manager | -| neovim | Editor | +| Tool | Purpose | +| ---- | --------------- | +| node | Node.js runtime | +| pnpm | Package manager | ### Prompt @@ -59,10 +58,10 @@ Configure orgs via env vars: `VIQUEEN_DEVBOX_PRIMARY_ORG`, `VIQUEEN_DEVBOX_SECON ### Editor -Neovim with [lazy.nvim](https://github.com/folke/lazy.nvim) plugin manager. Config lives in `cli/nvim/` -and is scoped via `NVIM_APPNAME=devbox` (stored at `~/.config/devbox/nvim/`). - -Plugins: edge colorscheme, lualine, nvim-tree, telescope, treesitter, mason + lspconfig. +Plain vim, no plugin manager, no alias. `config_vim` symlinks `cli/.vimrc` to `~/.vimrc`, so +running `vim` anywhere (shell, scripts, `git commit`) picks up the config automatically. Uses +vim's built-in `retrobox` colorscheme (gruvbox-style, muted and dark) — no vendored colors file +to maintain, requires vim 9+. ### Scripts and Binaries @@ -84,7 +83,7 @@ image -h # docker things gitar -h # git things ``` -All scripts source `selfedit.sh` (edit mode via nvim) and `selfdoc.sh` (auto-generated help from `@COMMAND` annotations): +All scripts source `selfedit.sh` (edit mode via vim) and `selfdoc.sh` (auto-generated help from `@COMMAND` annotations): ```bash #! /usr/bin/env bash diff --git a/cli/.devboxrc b/cli/.devboxrc index 92e3a73..885a5ee 100644 --- a/cli/.devboxrc +++ b/cli/.devboxrc @@ -7,8 +7,6 @@ alias move=mv alias maven=mvn alias awsl=awslocal alias cats='pygmentize -g' -alias vim='NVIM_APPNAME=devbox nvim' -alias nvim='NVIM_APPNAME=devbox nvim' export PS1='\u@\h\w' export CLICOLOR=1 @@ -16,7 +14,7 @@ export LSCOLORS=GxFxCxDxBxegedabagaced export BASH_SILENCE_DEPRECATION_WARNING=1 # homebrew -export HOMEBREW_EDITOR="nvim" +export HOMEBREW_EDITOR="vim" # maven export MAVEN_OPTS="-Xms1680m -Xmx2048m -XX:MaxMetaspaceSize=384m" diff --git a/cli/.vimrc b/cli/.vimrc new file mode 100644 index 0000000..fc10c2c --- /dev/null +++ b/cli/.vimrc @@ -0,0 +1,48 @@ +" devbox vim config +set nocompatible + +syntax on +filetype plugin indent on + +set number +set cursorline +set mouse=a +set ignorecase +set smartcase +set hlsearch +set incsearch +set showmatch +set expandtab +set smarttab +set shiftwidth=2 +set tabstop=2 +set autoindent +set smartindent +set wrap +set encoding=utf-8 +set backspace=indent,eol,start +set wildmenu +set ruler +set cmdheight=2 +set laststatus=2 +set autoread +set background=dark +set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*/node_modules,*/target,*/dist,*/build,*/coverage,.git,.hg,.svn,.idea +set list +set listchars=space:· + +if has('termguicolors') + set termguicolors +endif + +" strip trailing whitespace on save +autocmd BufWritePre * :%s/\s\+$//e + +" filetype associations +autocmd BufNewFile,BufRead .eslintrc,.babelrc set filetype=json + +" keymaps +nnoremap ] :m +1 +nnoremap [ :m -2 + +silent! colorscheme retrobox diff --git a/cli/bin/compose b/cli/bin/compose index 133b38e..98a463f 100755 --- a/cli/bin/compose +++ b/cli/bin/compose @@ -32,7 +32,7 @@ function stop() { function profile() { _with_arguments 1 "$@" profile=${1} - nvim "${VIQUEEN_DEVBOX_HOME}"/docker-compose/"${profile}".yml + vim "${VIQUEEN_DEVBOX_HOME}"/docker-compose/"${profile}".yml } # @COMMAND list lists available compose profiles diff --git a/cli/bin/dev b/cli/bin/dev index c0f178b..d748732 100755 --- a/cli/bin/dev +++ b/cli/bin/dev @@ -52,7 +52,7 @@ lc() { # @COMMAND rc opens .devboxrc file for edit rc() { - nvim ${VIQUEEN_DEVBOX_HOME}/cli/.devboxrc + vim ${VIQUEEN_DEVBOX_HOME}/cli/.devboxrc source ${VIQUEEN_DEVBOX_HOME}/cli/.devboxrc } @@ -82,14 +82,9 @@ licenses() { # VIM ####### -# @COMMAND vimr nvim plugin sync -vimr () { - NVIM_APPNAME=devbox nvim --headless "+Lazy! sync" +qa -} - -# @COMMAND vimrc nvim config +# @COMMAND vimrc vim config vimrc() { - nvim ${VIQUEEN_DEVBOX_HOME}/cli/nvim/init.lua + vim ${VIQUEEN_DEVBOX_HOME}/cli/.vimrc } ##### diff --git a/cli/bin/internal b/cli/bin/internal index 6d2f8cd..2db7861 100755 --- a/cli/bin/internal +++ b/cli/bin/internal @@ -9,7 +9,7 @@ edit() { then script=${0} fi - nvim ${script} + vim ${script} chmod +x ${script} } diff --git a/cli/bin/selfedit.sh b/cli/bin/selfedit.sh index 7761a23..d9d5c91 100755 --- a/cli/bin/selfedit.sh +++ b/cli/bin/selfedit.sh @@ -32,7 +32,7 @@ edit() { then script=${0} fi - nvim "${script}" + vim "${script}" chmod +x "${script}" } diff --git a/cli/nvim/init.lua b/cli/nvim/init.lua deleted file mode 100644 index 76687b3..0000000 --- a/cli/nvim/init.lua +++ /dev/null @@ -1,62 +0,0 @@ --- bootstrap lazy.nvim -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", - lazypath, - }) -end -vim.opt.rtp:prepend(lazypath) - --- leader key (before lazy) -vim.g.mapleader = " " - --- options -vim.opt.number = true -vim.opt.cursorline = true -vim.opt.termguicolors = true -vim.opt.mouse = "a" -vim.opt.ignorecase = true -vim.opt.smartcase = true -vim.opt.hlsearch = true -vim.opt.incsearch = true -vim.opt.showmatch = true -vim.opt.expandtab = true -vim.opt.smarttab = true -vim.opt.shiftwidth = 2 -vim.opt.tabstop = 2 -vim.opt.autoindent = true -vim.opt.smartindent = true -vim.opt.wrap = true -vim.opt.encoding = "utf-8" -vim.opt.backspace = "indent,eol,start" -vim.opt.wildmenu = true -vim.opt.ruler = true -vim.opt.cmdheight = 2 -vim.opt.laststatus = 2 -vim.opt.autoread = true -vim.opt.background = "dark" -vim.opt.wildignore:append("*/tmp/*,*.so,*.swp,*.zip,*/node_modules,*/target,*/dist,*/build,*/coverage,.git,.hg,.svn,.idea") -vim.opt.list = true -vim.opt.listchars = { space = "·" } - --- strip trailing whitespace on save -vim.api.nvim_create_autocmd("BufWritePre", { - pattern = "*", - command = [[%s/\s\+$//e]], -}) - --- filetype associations -vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, { - pattern = { ".eslintrc", ".babelrc" }, - command = "set filetype=json", -}) - --- keymaps -vim.keymap.set("n", "]", ":m +1", { silent = true }) -vim.keymap.set("n", "[", ":m -2", { silent = true }) - --- plugins -require("lazy").setup("plugins") diff --git a/cli/nvim/lazy-lock.json b/cli/nvim/lazy-lock.json deleted file mode 100644 index 3f9faff..0000000 --- a/cli/nvim/lazy-lock.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "edge": { "branch": "master", "commit": "7ec78c21bd8f0b2b0b47043bb1e730c561647c72" }, - "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, - "lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "7adc933dabcc7c86ae6b07aff7ee68eac398491f" }, - "mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" }, - "nvim-lspconfig": { "branch": "master", "commit": "98b0b8a52742afc9e2e2078e2e451f91beef1717" }, - "nvim-tree.lua": { "branch": "master", "commit": "4213bd6eabac38b16dd6615002b6243b23cf3bf6" }, - "nvim-treesitter": { "branch": "master", "commit": "cf12346a3414fa1b06af75c79faebe7f76df080a" }, - "nvim-web-devicons": { "branch": "master", "commit": "0ca28b61a04fe7426cefbdd52c2647ef0e335b5f" }, - "plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" }, - "telescope.nvim": { "branch": "master", "commit": "427b576c16792edad01a92b89721d923c19ad60f" } -} diff --git a/cli/nvim/lua/plugins/init.lua b/cli/nvim/lua/plugins/init.lua deleted file mode 100644 index 8905be5..0000000 --- a/cli/nvim/lua/plugins/init.lua +++ /dev/null @@ -1,81 +0,0 @@ -return { - -- colorscheme - { - "sainnhe/edge", - priority = 1000, - config = function() - vim.cmd.colorscheme("edge") - vim.cmd("hi Normal guibg=NONE ctermbg=NONE") - vim.cmd("hi CursorLine cterm=bold") - end, - }, - - -- statusline - { - "nvim-lualine/lualine.nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, - opts = { - options = { theme = "auto" }, - }, - }, - - -- file explorer - { - "nvim-tree/nvim-tree.lua", - dependencies = { "nvim-tree/nvim-web-devicons" }, - keys = { - { "", "NvimTreeToggle" }, - { "r", "NvimTreeFindFile" }, - }, - opts = { - respect_buf_cwd = true, - filters = { custom = { "node_modules", ".git" } }, - renderer = { icons = { show = { git = true, file = true, folder = true } } }, - }, - }, - - -- fuzzy finder (replaces ctrlp) - { - "nvim-telescope/telescope.nvim", - dependencies = { "nvim-lua/plenary.nvim" }, - keys = { - { "", "Telescope find_files" }, - { "fg", "Telescope live_grep" }, - { "fb", "Telescope buffers" }, - }, - }, - - -- syntax highlighting - { - "nvim-treesitter/nvim-treesitter", - branch = "master", - build = ":TSUpdate", - config = function() - require("nvim-treesitter.configs").setup({ - ensure_installed = { - "lua", "json", "yaml", "toml", "bash", - "javascript", "typescript", "tsx", - "go", "java", "kotlin", - "html", "css", "markdown", - }, - highlight = { enable = true }, - indent = { enable = true }, - }) - end, - }, - - -- lsp - { - "neovim/nvim-lspconfig", - dependencies = { - "williamboman/mason.nvim", - "williamboman/mason-lspconfig.nvim", - }, - config = function() - require("mason").setup() - require("mason-lspconfig").setup({ - automatic_installation = true, - }) - end, - }, -} diff --git a/setup.sh b/setup.sh index 9d5cd77..12d48b1 100755 --- a/setup.sh +++ b/setup.sh @@ -21,13 +21,8 @@ function config_box() { } function config_vim() { - mkdir -p "${HOME}/.config" - # remove any prior target (dir or symlink) so ln replaces it rather than - # nesting the link inside an existing directory - rm -rf "${HOME}/.config/devbox" - ln -sfnv "${VIQUEEN_DEVBOX_HOME}"/cli/nvim "${HOME}/.config/devbox" - git config --global core.editor "nvim" - NVIM_APPNAME=devbox nvim --headless "+Lazy! sync" +qa + ln -sfnv "${VIQUEEN_DEVBOX_HOME}"/cli/.vimrc "${HOME}/.vimrc" + git config --global core.editor "vim" } function config_prompt() {