From 24e74cde321bdcb38de502cecf4ba29201bca9a7 Mon Sep 17 00:00:00 2001 From: sloane <1699281+sloanelybutsurely@users.noreply.github.com> Date: Thu, 18 Jul 2024 12:00:39 -0400 Subject: [PATCH] neovim config, install jj --- .config/mise/config.toml | 10 ++- .config/nvim/init.lua | 3 + .config/nvim/lazy-lock.json | 21 ++++++ .config/nvim/lua/config/base.lua | 6 ++ .config/nvim/lua/config/lazy.lua | 32 ++++++++ .config/nvim/lua/config/mappings.lua | 93 ++++++++++++++++++++++++ .config/nvim/lua/plugins/colorscheme.lua | 10 +++ .config/nvim/lua/plugins/core.lua | 35 +++++++++ .config/nvim/lua/plugins/lsp.lua | 9 +++ .config/nvim/lua/plugins/treesitter.lua | 3 + .config/nvim/lua/plugins/ui.lua | 18 +++++ .jjconfig.toml | 1 + 12 files changed, 239 insertions(+), 2 deletions(-) create mode 100644 .config/nvim/init.lua create mode 100644 .config/nvim/lazy-lock.json create mode 100644 .config/nvim/lua/config/base.lua create mode 100644 .config/nvim/lua/config/lazy.lua create mode 100644 .config/nvim/lua/config/mappings.lua create mode 100644 .config/nvim/lua/plugins/colorscheme.lua create mode 100644 .config/nvim/lua/plugins/core.lua create mode 100644 .config/nvim/lua/plugins/lsp.lua create mode 100644 .config/nvim/lua/plugins/treesitter.lua create mode 100644 .config/nvim/lua/plugins/ui.lua create mode 120000 .jjconfig.toml diff --git a/.config/mise/config.toml b/.config/mise/config.toml index 1293faa..d15e3b7 100644 --- a/.config/mise/config.toml +++ b/.config/mise/config.toml @@ -1,4 +1,10 @@ [tools] usage = "latest" -erlang = "26.2.2" -elixir = "1.16" +erlang = "27.0" +elixir = "1.17.1-otp-27" +rust = "latest" +"cargo:cargo-binstall" = "latest" +"cargo:jj-cli" = "latest" + +[settings] +experimental = true diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua new file mode 100644 index 0000000..f05ba21 --- /dev/null +++ b/.config/nvim/init.lua @@ -0,0 +1,3 @@ +require("config.base") +require("config.lazy") +require("config.mappings") diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..56d6e4d --- /dev/null +++ b/.config/nvim/lazy-lock.json @@ -0,0 +1,21 @@ +{ + "lazy.nvim": { "branch": "main", "commit": "c92c6b5fd2b3a13c8999ab8379e43a79c9406e59" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, + "mini.icons": { "branch": "main", "commit": "c291191e2a2a99f8aeea5e4d6406af54d11c9608" }, + "nerdtree": { "branch": "master", "commit": "fbb71fcd90602e3ec77f40b864b5f9b437c496c5" }, + "nvim-lspconfig": { "branch": "master", "commit": "df9c116cbcf0aa7e58f2b36b0296fa687e87f36f" }, + "nvim-treesitter": { "branch": "master", "commit": "874b99065b4b00b84b0ca5fa63490c93728a45ab" }, + "nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" }, + "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, + "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, + "vim-abolish": { "branch": "master", "commit": "dcbfe065297d31823561ba787f51056c147aa682" }, + "vim-commentary": { "branch": "master", "commit": "c4b8f52cbb7142ec239494e5a2c4a512f92c4d07" }, + "vim-dispatch": { "branch": "master", "commit": "4c695bc052cad2ae6b980aebbe48d046466e27ae" }, + "vim-helix": { "branch": "main", "commit": "0d6bab9626cf74dedc16997e9f8d8c356939e76d" }, + "vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" }, + "vim-sensible": { "branch": "master", "commit": "0ce2d843d6f588bb0c8c7eec6449171615dc56d9" }, + "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, + "vim-tmux-navigator": { "branch": "master", "commit": "5b3c701686fb4e6629c100ed32e827edf8dad01e" }, + "which-key.nvim": { "branch": "main", "commit": "72aba5565ea1a03b1d4df5ede793dae29d874ea0" } +} diff --git a/.config/nvim/lua/config/base.lua b/.config/nvim/lua/config/base.lua new file mode 100644 index 0000000..b717599 --- /dev/null +++ b/.config/nvim/lua/config/base.lua @@ -0,0 +1,6 @@ +vim.opt.number = true +vim.opt.relativenumber = true + +vim.opt.tabstop = 2 +vim.opt.shiftwidth = 2 +vim.opt.expandtab = true diff --git a/.config/nvim/lua/config/lazy.lua b/.config/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..c3c7f1a --- /dev/null +++ b/.config/nvim/lua/config/lazy.lua @@ -0,0 +1,32 @@ +-- 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) + +-- Make sure to setup `mapleader` and `maplocalleader` before +-- loading lazy.nvim so that mappings are correct. +-- This is also a good place to setup other settings (vim.opt) +vim.g.mapleader = " " +vim.g.maplocalleader = "\\" + +-- Setup lazy.nvim +require("lazy").setup({ + spec = { + -- import your plugins + { import = "plugins" }, + }, + -- automatically check for plugin updates + checker = { enabled = true }, +}) diff --git a/.config/nvim/lua/config/mappings.lua b/.config/nvim/lua/config/mappings.lua new file mode 100644 index 0000000..dc4e982 --- /dev/null +++ b/.config/nvim/lua/config/mappings.lua @@ -0,0 +1,93 @@ +local wk = require('which-key') +local map = vim.keymap.set + +wk.setup({ + replace = { + key = { + { '', 'SPC' }, + { '', 'RET' }, + { '', 'TAB' }, + }, + }, +}) + +vim.opt.timeoutlen = 500 +vim.g.mapleader = " " + +-- Handy to remap semi-colon to colon +map({ 'n', 'v' }, ';', ':') +map({ 'n', 'v' }, 'q;', 'q:') + +-- System clipboard via -> y | p +map({ 'n', 'v' }, 'y', '"+y') +map( 'n', 'Y', '"+Y') +map({ 'n', 'v' }, 'p', '"+p') +map({ 'n', 'v' }, 'P', '"+P') + +-- Common short-hands +map('n', 'w', 'w') +map('n', 'q', 'q') +map('n', 'o', 'only') +map('n', '', 'nohlsearch') + +wk.add({ + { '', 'NERDTreeToggle', desc = 'Toggle NERDTree' }, + { '', 'Telescope find_files theme=dropdown', desc = 'Find file in current directory' }, + { '/', 'Telescope live_grep', desc = 'Search current directory' }, + + + -- File + { 'fl', 'NERDTreeFind', desc = 'Show in NERDTree' }, + +}) + +-- wk.register({ +-- [''] = { 'Telescope find_files theme=dropdown', 'File file in project' }, +-- ['/'] = { 'Telescope live_grep', 'Search project' }, +-- [''] = { 'NERDTreeToggle', 'Toggle NERDTree' }, + +-- f = { +-- name = 'file', +-- e = { 'Telescope find_files cwd=~/.config/nvim', 'Find file in .config/nvim' }, +-- E = { 'e ~/.config/nvim', 'Browse .config/nvim' }, +-- f = { 'Telescope find_files cwd=~/ hidden=true no_ignore=true no_ignore_parent=true follow=true theme=dropdown', 'Find file' }, +-- F = { 'Telescope find_files theme=dropdown', 'File file from here' }, +-- l = { 'NERDTreeFind', 'Locate file' }, +-- r = { 'Telescope oldfiles', 'Recent files' }, +-- }, + +-- e = { +-- name = 'editor', +-- p = { +-- name = 'packer', +-- s = { 'PackerSync', 'Packer Sync' }, +-- c = { 'PackerCompile', 'Packer Compile' }, +-- l = { 'PackerClean', 'Packer Clean' }, +-- } +-- }, + +-- g = { +-- name = 'git', +-- s = { 'Git', 'Status' }, +-- p = { 'Git push -u origin head', 'Push' }, +-- P = { 'Git push -u origin head --force-with-lease', 'Push (force with lease)' }, +-- f = { +-- name = 'fetch', +-- o = { 'Git fetch origin', 'origin' }, +-- u = { 'Git fetch upstream', 'upstream' }, +-- }, +-- r = { +-- name = 'rebase', +-- o = { 'Git rebase origin/main', 'origin/main' }, +-- O = { 'Git rebase --interactive origin/main', '-i origin/main' }, +-- u = { 'Git rebase upstream/main', 'upstream/main' }, +-- U = { 'Git rebase --interactive upstream/main', '-i upstream/main' }, +-- } +-- }, + +-- i = { +-- name = 'insert', +-- e = { 'Telescope emoji theme=dropdown', 'emoji' }, +-- }, + +-- }, { prefix = '' }) diff --git a/.config/nvim/lua/plugins/colorscheme.lua b/.config/nvim/lua/plugins/colorscheme.lua new file mode 100644 index 0000000..35397c8 --- /dev/null +++ b/.config/nvim/lua/plugins/colorscheme.lua @@ -0,0 +1,10 @@ +return { + { + 'foxoman/vim-helix', + lazy = false, + priority = 1000, + config = function () + vim.cmd([[colorscheme helix-boo]]) + end, + }, +} diff --git a/.config/nvim/lua/plugins/core.lua b/.config/nvim/lua/plugins/core.lua new file mode 100644 index 0000000..4369621 --- /dev/null +++ b/.config/nvim/lua/plugins/core.lua @@ -0,0 +1,35 @@ +return { + { 'tpope/vim-sensible' }, + { 'tpope/vim-surround' }, + { 'tpope/vim-commentary' }, + { 'tpope/vim-repeat' }, + { 'tpope/vim-dispatch' }, + { 'tpope/vim-abolish' }, + + { + 'christoomey/vim-tmux-navigator', + cmd = { + 'TmuxNavigateLeft', + 'TmuxNavigateDown', + 'TmuxNavigateUp', + 'TmuxNavigateRight', + 'TmuxNavigatePrevious', + }, + keys = { + { '', 'TmuxNavigateLeft' }, + { '', 'TmuxNavigateDown' }, + { '', 'TmuxNavigateUp' }, + { '', 'TmuxNavigateRight' }, + { '', 'TmuxNavigatePrevious' }, + }, + }, + + { + 'folke/which-key.nvim', + lazy = true, + dependencies = { + 'echasnovski/mini.icons', + 'nvim-tree/nvim-web-devicons', + }, + }, +} diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua new file mode 100644 index 0000000..4a86be3 --- /dev/null +++ b/.config/nvim/lua/plugins/lsp.lua @@ -0,0 +1,9 @@ +return { + { + 'williamboman/mason.nvim', + dependencies = { + 'williamboman/mason-lspconfig.nvim', + 'neovim/nvim-lspconfig', + } + }, +} diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..f6cffbb --- /dev/null +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,3 @@ +return { + { 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate' }, +} diff --git a/.config/nvim/lua/plugins/ui.lua b/.config/nvim/lua/plugins/ui.lua new file mode 100644 index 0000000..e0c3d93 --- /dev/null +++ b/.config/nvim/lua/plugins/ui.lua @@ -0,0 +1,18 @@ +return { + { + 'preservim/nerdtree', + cmd = { + 'NERDTree', + 'NERDTreeToggle', + 'NERDTreeFind', + 'NERDTreeFocus' + } + }, + + { + 'nvim-telescope/telescope.nvim', + tag = '0.1.8', + dependencies = { 'nvim-lua/plenary.nvim' }, + cmd = { 'Telescope' }, + }, +} diff --git a/.jjconfig.toml b/.jjconfig.toml new file mode 120000 index 0000000..095f701 --- /dev/null +++ b/.jjconfig.toml @@ -0,0 +1 @@ +/nix/store/rpzzkvjfhnqj9qi93xd05glh3vw5d2zs-home-manager-files/.jjconfig.toml \ No newline at end of file