diff --git a/home/dot_gitconfig.tmpl b/home/dot_gitconfig.tmpl index fb8909f..77392cc 100644 --- a/home/dot_gitconfig.tmpl +++ b/home/dot_gitconfig.tmpl @@ -4,7 +4,7 @@ name = {{ .name }} email = {{ .email_personal }} [core] - editor = hx + editor = nvim pager = delta [interactive] diffFilter = delta --color-only diff --git a/home/dot_zshenv.tmpl b/home/dot_zshenv.tmpl index 1b82d07..9c7505d 100644 --- a/home/dot_zshenv.tmpl +++ b/home/dot_zshenv.tmpl @@ -4,8 +4,8 @@ if [[ "$OSTYPE" == darwin* ]]; then fi # Editors -export EDITOR='hx' -export VISUAL='hx' +export EDITOR='nvim' +export VISUAL='nvim' export PAGER='less' # Language diff --git a/home/dot_zshrc.tmpl b/home/dot_zshrc.tmpl index af8810b..62b5740 100644 --- a/home/dot_zshrc.tmpl +++ b/home/dot_zshrc.tmpl @@ -59,12 +59,7 @@ for fp in $srcs; do fi done -alias i="ipython3" -alias devlog="cd ~/projects/personal/devlog && hx logs/$(date '+%Y-%m-%d').gmi && cd -" - -{{ if eq .chezmoi.hostname "rattusrattus" -}} -alias colima_start="colima start --memory 8 --vm-type vz --mount-type virtiofs --dns 8.8.8.8 --dns 8.8.4.4" -{{- end }} +alias devlog="cd ~/projects/personal/devlog && nvim logs/$(date '+%Y-%m-%d').gmi && cd -" {{- if eq .chezmoi.hostname "devterm" }} function battery() { @@ -101,20 +96,20 @@ function brightness_min { # ttyscheme {{- end -}} -{{ if eq .hosttype "work" -}} +{{ if eq .hosttype "work" "personal" -}} eval "$(/opt/homebrew/bin/brew shellenv)" -{{ end }} eval "$(direnv hook zsh)" eval "$(jj util completion zsh)" +export NVM_DIR="$HOME/.nvm" +[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" +[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" +{{ end }} function reldate() { date -v "${1}" "+%Y-%m-%d" } -function _zkhx() { - hx --hsplit tasks.xit ${1} -} - [ "$TERM" = "xterm-kitty" ] && alias ssh="TERM=xterm ssh" alias strip_jira="sed 's/\[\{0,1\}[a-zA-Z]*-[0-9]*\]\{0,1\}//g'" +alias hx="echo 'oops! you meant nvim, right?'" diff --git a/home/encrypted_work_packages.age b/home/encrypted_work_packages.age index f8a540c..6426f5e 100644 --- a/home/encrypted_work_packages.age +++ b/home/encrypted_work_packages.age @@ -1,16 +1,19 @@ -----BEGIN AGE ENCRYPTED FILE----- -YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBXQ0tGTHh2cm9Dd3RyVjk1 -RGw0a2U1dDNhTGxIVVBNOUxIeThuRllBWnc0Cm5wSFd1RTAyaUptaHk3Y05VYkcy -REtiWFdkWkE3NDFHVjZmdk5yMWd5c0UKLS0tIFVySXI4bmFiQ3B6K0ZYQUNpK1VW -WWs2QmsxajNWNXdNdW1WN0tqYVltQzAKRt8AYM34DDCutguPZeS2yN9oJ5FCCGCz -PFmV+aLrqn14Mf8TrsuZvxdMx8th2CAkueZCblvBOQzj+FwETeXW/XTmy0y8Wy7N -F5yNzQfLOig9rW0qyK82sWEglunFM2u6g1rqCul9fZwuhvGOa1vSGYfnHNFwlIIl -fPZ8h4HEWOf75p0qakt0mA+KrbAKmvrTFVmPvBcqaVfImka5e+PYNXeJ9lw8Rl8M -5pka+BKBSmDYtfhN8Y9i9UhPbv+UfDULNURCsWT9isx8tAeYmIJPdJ6+VoKHlt1R -gXgg08268d0X+ZFWIKJyluFNLBt35YSFNeNMKGe1DcTzop+VWxjVgS7uSRQj2Sti -jym2L8m7bfieFvo37IG+wrIC0J1i4tqxIIZqPSYCrM45h5D2pkPT+8IQGnO+PUXu -DbYypym6ndbD5VLY/etETIIYxWBkcHeOVGBEy5d2BR627ii0AW8gxU5pWHW3IZcn -Diwi5tnq5TD27eIYd4U6DxqneIwmWJvnxfZ3EpUqgAAhg/Wc3ZiTz7SMf9QO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Wzkc1hbQuMSlhbaa8 +uJTADuYbNTDMc/CkLo/Ynbmpng+E4YMEv/9xukryFWTpJcDQjJAWi64pMztvSLC+ +6gfXAIGCo5eLMqEIawFp+UYU+4SH -----END AGE ENCRYPTED FILE----- diff --git a/home/private_dot_config/nvim/dot_luarc.json b/home/private_dot_config/nvim/dot_luarc.json new file mode 100644 index 0000000..1e1765c --- /dev/null +++ b/home/private_dot_config/nvim/dot_luarc.json @@ -0,0 +1,5 @@ +{ + "diagnostics.globals": [ + "vim" + ] +} \ No newline at end of file diff --git a/home/private_dot_config/nvim/init.lua b/home/private_dot_config/nvim/init.lua new file mode 100644 index 0000000..9d1054c --- /dev/null +++ b/home/private_dot_config/nvim/init.lua @@ -0,0 +1,20 @@ +-- Bootstrap lazy.nvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end +end +vim.opt.rtp:prepend(lazypath) + +-- order matters here! +require("vim-options") +require("lazy").setup("plugins") diff --git a/home/private_dot_config/nvim/lua/plugins/ai-config.lua b/home/private_dot_config/nvim/lua/plugins/ai-config.lua new file mode 100644 index 0000000..ac641dc --- /dev/null +++ b/home/private_dot_config/nvim/lua/plugins/ai-config.lua @@ -0,0 +1,28 @@ +return { + "yetone/avante.nvim", + opts = { + provider = "copilot", + }, + dependencies = { + { + "zbirenbaum/copilot.lua", + config = function() + require("copilot").setup({ + copilot_node_command = vim.fn.expand("$HOME") .. "/.nvm/versions/node/v22.14.0/bin/node", + suggestion = { enabled = false }, + panel = { enabled = false }, + }) + end, + }, + { + "MeanderingProgrammer/render-markdown.nvim", + opts = { + file_types = { "markdown", "Avante" }, + }, + ft = { "markdown", "Avante" }, + }, + }, + config = function() + vim.keymap.set({ "n", "v" }, "a", "", { desc = "+ai" }) + end, +} diff --git a/home/private_dot_config/nvim/lua/plugins/catppuccin.lua b/home/private_dot_config/nvim/lua/plugins/catppuccin.lua new file mode 100644 index 0000000..249efad --- /dev/null +++ b/home/private_dot_config/nvim/lua/plugins/catppuccin.lua @@ -0,0 +1,9 @@ +return { + "catppuccin/nvim", + lazy = false, + name = "catppuccin", + priority = 1000, + config = function() + vim.cmd.colorscheme("catppuccin") + end, +} diff --git a/home/private_dot_config/nvim/lua/plugins/completions.lua b/home/private_dot_config/nvim/lua/plugins/completions.lua new file mode 100644 index 0000000..0e5cbc0 --- /dev/null +++ b/home/private_dot_config/nvim/lua/plugins/completions.lua @@ -0,0 +1,38 @@ +return { + { + "hrsh7th/cmp-nvim-lsp", + }, + { + "zbirenbaum/copilot-cmp", + config = function() + require("copilot_cmp").setup() + end, + }, + { + "hrsh7th/nvim-cmp", + config = function() + local cmp = require("cmp") + + cmp.setup({ + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), + }), + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + }, { + { name = "buffer" }, + }, { + { name = "copilot" }, + }), + }) + end, + }, +} diff --git a/home/private_dot_config/nvim/lua/plugins/lsp-config.lua b/home/private_dot_config/nvim/lua/plugins/lsp-config.lua new file mode 100644 index 0000000..016598b --- /dev/null +++ b/home/private_dot_config/nvim/lua/plugins/lsp-config.lua @@ -0,0 +1,33 @@ +return { + { + "williamboman/mason.nvim", + config = function() + require("mason").setup() + end, + }, + { + "williamboman/mason-lspconfig.nvim", + config = function() + require("mason-lspconfig").setup({ + ensure_installed = { "lua_ls" }, + }) + end, + }, + { + "neovim/nvim-lspconfig", + config = function() + local capabilities = require("cmp_nvim_lsp").default_capabilities() + local lspconfig = require("lspconfig") + + -- lua + lspconfig.lua_ls.setup({ + capabilities = capabilities, + }) + + vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) + vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) + vim.keymap.set({ "n", "v" }, "c", "", { desc = "+code" }) + vim.keymap.set({ "n", "v" }, "ca", vim.lsp.buf.code_action, { desc = "action" }) + end, + }, +} diff --git a/home/private_dot_config/nvim/lua/plugins/lualine.lua b/home/private_dot_config/nvim/lua/plugins/lualine.lua new file mode 100644 index 0000000..5f54a0b --- /dev/null +++ b/home/private_dot_config/nvim/lua/plugins/lualine.lua @@ -0,0 +1,6 @@ +return { + "nvim-lualine/lualine.nvim", + config = function() + require("lualine").setup() + end, +} diff --git a/home/private_dot_config/nvim/lua/plugins/neo-tree.lua b/home/private_dot_config/nvim/lua/plugins/neo-tree.lua new file mode 100644 index 0000000..29d0ba6 --- /dev/null +++ b/home/private_dot_config/nvim/lua/plugins/neo-tree.lua @@ -0,0 +1,12 @@ +return { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", + }, + config = function() + vim.keymap.set("n", "e", ":Neotree toggle", { desc = "toggle file tree" }) + end, +} diff --git a/home/private_dot_config/nvim/lua/plugins/none-ls.lua b/home/private_dot_config/nvim/lua/plugins/none-ls.lua new file mode 100644 index 0000000..403da6e --- /dev/null +++ b/home/private_dot_config/nvim/lua/plugins/none-ls.lua @@ -0,0 +1,14 @@ +return { + "nvimtools/none-ls.nvim", + config = function() + local null_ls = require("null-ls") + + null_ls.setup({ + sources = { + null_ls.builtins.formatting.stylua, + }, + }) + + vim.keymap.set("n", "cf", vim.lsp.buf.format, { desc = "format" }) + end, +} diff --git a/home/private_dot_config/nvim/lua/plugins/telescope.lua b/home/private_dot_config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..b8af826 --- /dev/null +++ b/home/private_dot_config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,39 @@ +return { + { + "nvim-telescope/telescope.nvim", + tag = "0.1.8", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + local builtin = require("telescope.builtin") + vim.keymap.set("n", "f", builtin.find_files, { desc = "find files" }) + vim.keymap.set("n", "b", builtin.buffers, { desc = "find buffers" }) + vim.keymap.set("n", "/", builtin.live_grep, { desc = "live grep" }) + vim.keymap.set("n", "j", builtin.jumplist, { desc = "jumplist" }) + + local actions = require("telescope.actions") + require("telescope").setup({ + defaults = { + mappings = { + i = { + [""] = actions.close, + }, + }, + }, + }) + end, + }, + + { + "nvim-telescope/telescope-ui-select.nvim", + config = function() + require("telescope").setup({ + extensions = { + ["ui-select"] = { + require("telescope.themes").get_dropdown({}), + }, + }, + }) + require("telescope").load_extension("ui-select") + end, + }, +} diff --git a/home/private_dot_config/nvim/lua/plugins/testing-config.lua b/home/private_dot_config/nvim/lua/plugins/testing-config.lua new file mode 100644 index 0000000..f634f60 --- /dev/null +++ b/home/private_dot_config/nvim/lua/plugins/testing-config.lua @@ -0,0 +1,56 @@ +return { + { + "nvim-neotest/neotest", + dependencies = { + "nvim-neotest/nvim-nio", + "nvim-lua/plenary.nvim", + "antoinemadec/FixCursorHold.nvim", + "nvim-treesitter/nvim-treesitter", + }, + config = function() + require("neotest").setup({ + adapters = { + require("neotest-python"), + require("rustaceanvim.neotest"), + }, + }) + + vim.keymap.set({ "n", "v" }, "t", "", { desc = "+testing" }) + vim.keymap.set({ "n", "v" }, "tt", function() + require("neotest").run.run(vim.fn.expand("%")) + end, { desc = "run file" }) + vim.keymap.set({ "n", "v" }, "tT", function() + require("neotest").run.run(vim.uv.cwd()) + end, { desc = "run all test files" }) + vim.keymap.set({ "n", "v" }, "tr", function() + require("neotest").run.run() + end, { desc = "run nearest" }) + vim.keymap.set({ "n", "v" }, "tl", function() + require("neotest").run.run_last() + end, { desc = "run last" }) + vim.keymap.set({ "n", "v" }, "ts", function() + require("neotest").summary.toggle() + end, { desc = "toggle summary" }) + vim.keymap.set({ "n", "v" }, "to", function() + require("neotest").output.open({ enter = true, auto_close = true }) + end, { desc = "show output" }) + vim.keymap.set({ "n", "v" }, "to", function() + require("neotest").output_panel.toggle() + end, { desc = "toggle output panel" }) + vim.keymap.set({ "n", "v" }, "ts", function() + require("neotest").run.stop() + end, { desc = "stop" }) + vim.keymap.set({ "n", "v" }, "tw", function() + require("neotest").watch.toggle(vim.fn.expand("%")) + end, { desc = "toggle watch" }) + end, + }, + { + "nvim-neotest/neotest-python", + }, + { + "mrcjkb/rustaceanvim", + version = "^5", + lazy = false, + }, +} diff --git a/home/private_dot_config/nvim/lua/plugins/treesitter.lua b/home/private_dot_config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..d4a8e05 --- /dev/null +++ b/home/private_dot_config/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,15 @@ +return { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function() + local configs = require("nvim-treesitter.configs") + + configs.setup({ + ensure_installed = { "lua", "vim", "query", "javascript", "html", "python", "rust" }, + sync_install = false, + auto_install = true, + highlight = { enable = true }, + indent = { enable = true }, + }) + end, +} diff --git a/home/private_dot_config/nvim/lua/plugins/which-key.lua b/home/private_dot_config/nvim/lua/plugins/which-key.lua new file mode 100644 index 0000000..6316a7b --- /dev/null +++ b/home/private_dot_config/nvim/lua/plugins/which-key.lua @@ -0,0 +1,14 @@ +return { + "folke/which-key.nvim", + event = "VeryLazy", + opts = {}, + keys = { + { + "?", + function() + require("which-key").show({ global = false }) + end, + desc = "buffer local keymaps (which-key)", + }, + }, +} diff --git a/home/private_dot_config/nvim/lua/vim-options.lua b/home/private_dot_config/nvim/lua/vim-options.lua new file mode 100644 index 0000000..a01e9b9 --- /dev/null +++ b/home/private_dot_config/nvim/lua/vim-options.lua @@ -0,0 +1,9 @@ +vim.g.mapleader = " " +vim.g.maplocalleader = "\\" + +vim.o.cursorline = true +vim.o.expandtab = true +vim.o.number = true +vim.o.shiftwidth = 2 +vim.o.softtabstop = 2 +vim.o.tabstop = 2 diff --git a/home/run_once_01install-packages.sh.tmpl b/home/run_once_01install-packages.sh.tmpl index 9001e38..e6c3932 100644 --- a/home/run_once_01install-packages.sh.tmpl +++ b/home/run_once_01install-packages.sh.tmpl @@ -10,7 +10,6 @@ sudo apt install \ libssl-dev \ lynx \ ripgrep \ - tmux \ tree \ wget \ zsh \ @@ -30,6 +29,8 @@ brew install \ helix \ jj \ kitty \ + neovim \ + nvm \ ripgrep \ sqlite \ tree \ @@ -42,6 +43,11 @@ brew install \ zlib \ zsh +export NVM_DIR="$HOME/.nvm" +[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" +nvm install 22 +nvm use 22 + {{ else if eq .hosttype "wsl" -}} sudo apt update sudo apt install \ @@ -50,13 +56,11 @@ sudo apt install \ libssl-dev \ pkg-config \ ripgrep \ - tmux \ tree \ wget \ yazi \ -y -{{ end }} -{{ if eq .hosttype "work" -}} +{{ else if eq .hosttype "work" -}} {{ join .chezmoi.sourceDir "encrypted_work_packages.age" | include | decrypt -}} {{ end }}