diff --git a/.config/nvim/.github/ISSUE_TEMPLATE/bug_report.md b/.config/nvim/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 2ad4d31d..00000000 --- a/.config/nvim/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - ---- - - - -## Describe the bug - - -## To Reproduce - -1. ... - -## Desktop - -- OS: -- Terminal: - -## Neovim Version - - -``` -``` diff --git a/.config/nvim/README.md b/.config/nvim/README.md index 7f54ce88..3a442c51 100644 --- a/.config/nvim/README.md +++ b/.config/nvim/README.md @@ -6,36 +6,43 @@ https://github.com/kdheepak/kickstart.nvim/assets/1813121/f3ff9a2b-c31f-44df-a4f A starting point for Neovim that is: -* Small -* Single-file (with examples of moving to multi-file) -* Documented -* Modular +- Small +- Single-file (with examples of moving to multi-file) +- Documented +- Modular -This repo is meant to be used by **YOU** to begin your Neovim journey; remove the things you don't use and add what you miss. +This repo is meant to be used by **YOU** to begin your Neovim journey; remove the things you don't +use and add what you miss. -Kickstart.nvim targets *only* the latest ['stable'](https://github.com/neovim/neovim/releases/tag/stable) and latest ['nightly'](https://github.com/neovim/neovim/releases/tag/nightly) of Neovim. If you are experiencing issues, please make sure you have the latest versions. +Kickstart.nvim targets _only_ the latest +['stable'](https://github.com/neovim/neovim/releases/tag/stable) and latest +['nightly'](https://github.com/neovim/neovim/releases/tag/nightly) of Neovim. If you are +experiencing issues, please make sure you have the latest versions. Distribution Alternatives: -- [LazyVim](https://www.lazyvim.org/): A delightful distribution maintained by @folke (the author of lazy.nvim, the package manager used here) + +- [LazyVim](https://www.lazyvim.org/): A delightful distribution maintained by @folke (the author of + lazy.nvim, the package manager used here) ### Installation -> **NOTE** -> [Backup](#FAQ) your previous configuration (if any exists) +> **NOTE** [Backup](#FAQ) your previous configuration (if any exists) Requirements: -* Make sure to review the readmes of the plugins if you are experiencing errors. In particular: - * [ripgrep](https://github.com/BurntSushi/ripgrep#installation) is required for multiple [telescope](https://github.com/nvim-telescope/telescope.nvim#suggested-dependencies) pickers. -* See [Windows Installation](#Windows-Installation) if you have trouble with `telescope-fzf-native` + +- Make sure to review the readmes of the plugins if you are experiencing errors. In particular: + - [ripgrep](https://github.com/BurntSushi/ripgrep#installation) is required for multiple + [telescope](https://github.com/nvim-telescope/telescope.nvim#suggested-dependencies) pickers. +- See [Windows Installation](#Windows-Installation) if you have trouble with `telescope-fzf-native` Neovim's configurations are located under the following paths, depending on your OS: -| OS | PATH | -| :- | :--- | -| Linux | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` | -| MacOS | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` | -| Windows (cmd)| `%userprofile%\AppData\Local\nvim\` | -| Windows (powershell)| `$env:USERPROFILE\AppData\Local\nvim\` | +| OS | PATH | +| :------------------- | :---------------------------------------- | +| Linux | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` | +| MacOS | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` | +| Windows (cmd) | `%userprofile%\AppData\Local\nvim\` | +| Windows (powershell) | `$env:USERPROFILE\AppData\Local\nvim\` | Clone kickstart.nvim: @@ -44,18 +51,16 @@ Clone kickstart.nvim: git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim ``` - ``` # on Windows (cmd) -git clone https://github.com/nvim-lua/kickstart.nvim.git %userprofile%\AppData\Local\nvim\ +git clone https://github.com/nvim-lua/kickstart.nvim.git %userprofile%\AppData\Local\nvim\ ``` ``` # on Windows (powershell) -git clone https://github.com/nvim-lua/kickstart.nvim.git $env:USERPROFILE\AppData\Local\nvim\ +git clone https://github.com/nvim-lua/kickstart.nvim.git $env:USERPROFILE\AppData\Local\nvim\ ``` - ### Post Installation Start Neovim @@ -64,7 +69,10 @@ Start Neovim nvim ``` -The `Lazy` plugin manager will start automatically on the first run and install the configured plugins - as can be seen in the introduction video. After the installation is complete you can press `q` to close the `Lazy` UI and **you are ready to go**! Next time you run nvim `Lazy` will no longer show up. +The `Lazy` plugin manager will start automatically on the first run and install the configured +plugins - as can be seen in the introduction video. After the installation is complete you can press +`q` to close the `Lazy` UI and **you are ready to go**! Next time you run nvim `Lazy` will no longer +show up. If you would prefer to hide this step and run the plugin sync from the command line, you can use: @@ -74,21 +82,27 @@ nvim --headless "+Lazy! sync" +qa ### Recommended Steps -[Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repo (so that you have your own copy that you can modify) and then installing you can install to your machine using the methods above. +[Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repo (so that you have +your own copy that you can modify) and then installing you can install to your machine using the +methods above. > **NOTE** -> Your fork's url will be something like this: `https://github.com//kickstart.nvim.git` +> Your fork's url will be something like this: +> `https://github.com//kickstart.nvim.git` ### Configuration And Extension -* Inside of your copy, feel free to modify any file you like! It's your copy! -* Feel free to change any of the default options in `init.lua` to better suit your needs. -* For adding plugins, there are 3 primary options: - * Add new configuration in `lua/custom/plugins/*` files, which will be auto sourced using `lazy.nvim` (uncomment the line importing the `custom/plugins` directory in the `init.lua` file to enable this) - * Modify `init.lua` with additional plugins. - * Include the `lua/kickstart/plugins/*` files in your configuration. +- Inside of your copy, feel free to modify any file you like! It's your copy! +- Feel free to change any of the default options in `init.lua` to better suit your needs. +- For adding plugins, there are 3 primary options: + - Add new configuration in `lua/custom/plugins/*` files, which will be auto sourced using + `lazy.nvim` (uncomment the line importing the `custom/plugins` directory in the `init.lua` file + to enable this) + - Modify `init.lua` with additional plugins. + - Include the `lua/kickstart/plugins/*` files in your configuration. -You can also merge updates/changes from the repo back into your fork, to keep up-to-date with any changes for the default configuration. +You can also merge updates/changes from the repo back into your fork, to keep up-to-date with any +changes for the default configuration. #### Example: Adding an autopairs plugin @@ -114,8 +128,9 @@ return { } ``` - -This will automatically install [windwp/nvim-autopairs](https://github.com/windwp/nvim-autopairs) and enable it on startup. For more information, see documentation for [lazy.nvim](https://github.com/folke/lazy.nvim). +This will automatically install [windwp/nvim-autopairs](https://github.com/windwp/nvim-autopairs) +and enable it on startup. For more information, see documentation for +[lazy.nvim](https://github.com/folke/lazy.nvim). #### Example: Adding a file tree plugin @@ -139,51 +154,68 @@ return { } ``` -This will install the tree plugin and add the command `:Neotree` for you. You can explore the documentation at [neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim) for more information. +This will install the tree plugin and add the command `:Neotree` for you. You can explore the +documentation at [neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim) for more +information. ### Contribution -Pull-requests are welcome. The goal of this repo is not to create a Neovim configuration framework, but to offer a starting template that shows, by example, available features in Neovim. Some things that will not be included: +Pull-requests are welcome. The goal of this repo is not to create a Neovim configuration framework, +but to offer a starting template that shows, by example, available features in Neovim. Some things +that will not be included: -* Custom language server configuration (null-ls templates) -* Theming beyond a default colorscheme necessary for LSP highlight groups +- Custom language server configuration (null-ls templates) +- Theming beyond a default colorscheme necessary for LSP highlight groups -Each PR, especially those which increase the line count, should have a description as to why the PR is necessary. +Each PR, especially those which increase the line count, should have a description as to why the PR +is necessary. ### FAQ -* What should I do if I already have a pre-existing neovim configuration? - * You should back it up, then delete all files associated with it. - * This includes your existing init.lua and the neovim files in `~/.local` which can be deleted with `rm -rf ~/.local/share/nvim/` - * You may also want to look at the [migration guide for lazy.nvim](https://github.com/folke/lazy.nvim#-migration-guide) -* Can I keep my existing configuration in parallel to kickstart? - * Yes! You can use [NVIM_APPNAME](https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME)`=nvim-NAME` to maintain multiple configurations. For example you can install the kickstart configuration in `~/.config/nvim-kickstart` and create a script `~/bin/nvim-kickstart`: +- What should I do if I already have a pre-existing neovim configuration? + - You should back it up, then delete all files associated with it. + - This includes your existing init.lua and the neovim files in `~/.local` which can be deleted + with `rm -rf ~/.local/share/nvim/` + - You may also want to look at the + [migration guide for lazy.nvim](https://github.com/folke/lazy.nvim#-migration-guide) +- Can I keep my existing configuration in parallel to kickstart? + - Yes! You can use + [NVIM_APPNAME](https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME)`=nvim-NAME` to maintain + multiple configurations. For example you can install the kickstart configuration in + `~/.config/nvim-kickstart` and create a script `~/bin/nvim-kickstart`: ``` #!/bin/sh exec env NVIM_APPNAME=nvim-kickstart nvim "$@" ``` - When you run Neovim with `nvim-kickstart` it will use the alternative config directory and the matching local directory: `~/.local/share/nvim-kickstart`. You can apply this approach to any Neovim distribution that you would like to try out. -* What if I want to "uninstall" this configuration: - * See [lazy.nvim uninstall](https://github.com/folke/lazy.nvim#-uninstalling) information -* Are there any cool videos about this plugin? - * Current iteration of kickstart (coming soon) - * Here is one about the previous iteration of kickstart: [video introduction to Kickstart.nvim](https://youtu.be/stqUbv-5u2s). Note the install via init.lua no longer works as specified. Please follow the install instructions in this file instead as they're up to date. -* Why is the kickstart `init.lua` a single file? Wouldn't it make sense to split it into multiple files? - * The main purpose of kickstart is to serve as a teaching tool and a reference - configuration that someone can easily `git clone` as a basis for their own. - As you progress in learning Neovim and Lua, you might consider splitting `init.lua` - into smaller parts. A fork of kickstart that does this while maintaining the exact - same functionality is available here: - * [kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim) - * Discussions on this topic can be found here: - * [Restructure the configuration](https://github.com/nvim-lua/kickstart.nvim/issues/218) - * [Reorganize init.lua into a multi-file setup](https://github.com/nvim-lua/kickstart.nvim/pull/473) + When you run Neovim with `nvim-kickstart` it will use the alternative config directory and the + matching local directory: `~/.local/share/nvim-kickstart`. You can apply this approach to any + Neovim distribution that you would like to try out. +- What if I want to "uninstall" this configuration: + - See [lazy.nvim uninstall](https://github.com/folke/lazy.nvim#-uninstalling) information +- Are there any cool videos about this plugin? + - Current iteration of kickstart (coming soon) + - Here is one about the previous iteration of kickstart: + [video introduction to Kickstart.nvim](https://youtu.be/stqUbv-5u2s). Note the install via + init.lua no longer works as specified. Please follow the install instructions in this file + instead as they're up to date. +- Why is the kickstart `init.lua` a single file? Wouldn't it make sense to split it into multiple + files? + - The main purpose of kickstart is to serve as a teaching tool and a reference configuration that + someone can easily `git clone` as a basis for their own. As you progress in learning Neovim and + Lua, you might consider splitting `init.lua` into smaller parts. A fork of kickstart that does + this while maintaining the exact same functionality is available here: + - [kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim) + - Discussions on this topic can be found here: + - [Restructure the configuration](https://github.com/nvim-lua/kickstart.nvim/issues/218) + - [Reorganize init.lua into a multi-file setup](https://github.com/nvim-lua/kickstart.nvim/pull/473) ### Windows Installation -Installation may require installing build tools, and updating the run command for `telescope-fzf-native` +Installation may require installing build tools, and updating the run command for +`telescope-fzf-native` -See `telescope-fzf-native` documentation for [more details](https://github.com/nvim-telescope/telescope-fzf-native.nvim#installation) +See `telescope-fzf-native` documentation for +[more details](https://github.com/nvim-telescope/telescope-fzf-native.nvim#installation) This requires: @@ -192,4 +224,3 @@ This requires: ```lua {'nvim-telescope/telescope-fzf-native.nvim', build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' } ``` - diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index ab9598d9..c2f35c91 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,43 +1,3 @@ ---[[ - -===================================================================== -==================== READ THIS BEFORE CONTINUING ==================== -===================================================================== - -Kickstart.nvim is *not* a distribution. - -Kickstart.nvim is a template for your own configuration. - The goal is that you can read every line of code, top-to-bottom, understand - what your configuration is doing, and modify it to suit your needs. - - Once you've done that, you should start exploring, configuring and tinkering to - explore Neovim! - - If you don't know anything about Lua, I recommend taking some time to read through - a guide. One possible example: - - https://learnxinyminutes.com/docs/lua/ - - - And then you can explore or search through `:help lua-guide` - - https://neovim.io/doc/user/lua-guide.html - - -Kickstart Guide: - -I have left several `:help X` comments throughout the init.lua -You should run that command and read that help section for more information. - -In addition, I have some `NOTE:` items throughout the file. -These are for you, the reader to help understand what is happening. Feel free to delete -them once you know what you're doing, but they should serve as a guide for when you -are first encountering a few different constructs in your nvim config. - -I hope you enjoy your Neovim journey, -- TJ - -P.S. You can delete this when you're done too. It's your config now :) ---]] - -- Set as the leader key -- See `:help mapleader` -- NOTE: Must happen before plugins are required (otherwise wrong leader will be used) @@ -161,6 +121,7 @@ require('lazy').setup({ { -- Add indentation guides even on blank lines 'lukas-reineke/indent-blankline.nvim', + tag = 'v3.3.9', -- Enable `lukas-reineke/indent-blankline.nvim` -- See `:help ibl` main = 'ibl', @@ -200,39 +161,11 @@ require('lazy').setup({ build = ':TSUpdate', }, - -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart - -- These are some example plugins that I've included in the kickstart repository. - -- Uncomment any of the lines below to enable them. - -- require 'kickstart.plugins.autoformat', - -- require 'kickstart.plugins.debug', - - -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` - -- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping - -- up-to-date with whatever is in the kickstart repo. - -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- - -- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins + -- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins { import = 'custom.plugins' }, - -- { import = 'custom.lib' }, }, {}) --- [[ Basic Keymaps ]] - --- Keymaps for better default experience --- See `:help vim.keymap.set()` -vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) - --- Remap for dealing with word wrap -vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) -vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) - --- Diagnostic keymaps -vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' }) -vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' }) -vim.keymap.set('n', 'tE', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) -vim.keymap.set('n', 'tQ', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) - -- [[ Highlight on yank ]] -- See `:help vim.highlight.on_yank()` local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) @@ -256,6 +189,5 @@ require('which-key').register { ['w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, } - -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et diff --git a/.config/nvim/lua/custom/plugins/lsp.lua b/.config/nvim/lua/custom/plugins/lsp.lua index 0bc3df83..ac103489 100644 --- a/.config/nvim/lua/custom/plugins/lsp.lua +++ b/.config/nvim/lua/custom/plugins/lsp.lua @@ -1,3 +1,4 @@ +vim.keymap.set("n", "lr", ":LspRestart", { desc = "[R]estart [L]SP" }) -- [[ Configure LSP ]] -- This function gets run when an LSP connects to a particular buffer. local on_attach = function(_, bufnr) @@ -199,6 +200,7 @@ cmp.setup { { name = 'luasnip' }, }, } + return { 'akinsho/flutter-tools.nvim', lazy = false, diff --git a/.config/nvim/lua/custom/plugins/remap.lua b/.config/nvim/lua/custom/plugins/remap.lua index 8788dbb0..e4b8cdd5 100644 --- a/.config/nvim/lua/custom/plugins/remap.lua +++ b/.config/nvim/lua/custom/plugins/remap.lua @@ -1,3 +1,17 @@ +-- Keymaps for better default experience +-- See `:help vim.keymap.set()` +vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) + +-- Remap for dealing with word wrap +vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) +vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) + +-- Diagnostic keymaps +vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' }) +vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' }) +vim.keymap.set('n', 'tE', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) +vim.keymap.set('n', 'tQ', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) + vim.keymap.set("n", "gq", "c", { desc = "Close pane" }) vim.keymap.set("n", "gQ", ":qa!", { desc = "Close nvim" }) diff --git a/.config/wezterm/wezterm.lua b/.config/wezterm/wezterm.lua index 55de095c..13a3cab3 100644 --- a/.config/wezterm/wezterm.lua +++ b/.config/wezterm/wezterm.lua @@ -1,5 +1,11 @@ +-- +-- +-- See https://wezfurlong.org/wezterm/config/files.html +-- +-- -- Pull in the wezterm API local wezterm = require 'wezterm' +local act = wezterm.action -- This table will hold the configuration. local config = {} @@ -10,22 +16,22 @@ if wezterm.config_builder then config = wezterm.config_builder({}) end -function unichr(ord) +--[[ function unichr(ord) if ord == nil then return nil end if ord < 32 then return string.format('\\x%02x', ord) end if ord < 126 then return string.char(ord) end if ord < 65539 then return string.format("\\u%04x", ord) end if ord < 1114111 then return string.format("\\u%08x", ord) end -end +end ]] -- This is where you actually apply your config choices config.font = wezterm.font_with_fallback({ - "MesloLGS NF", + { family = "MesloLGS Nerd Font", weight = "Medium", harfbuzz_features = { 'zero' } }, - "FiraCode Nerd Font Mono", + { family = "FiraCode Nerd Font", weight = "Medium", harfbuzz_features = { 'zero' } }, -- , BuiltIn - "JetBrains Mono", + -- "JetBrains Mono", -- , BuiltIn -- Assumed to have Emoji Presentation @@ -39,109 +45,124 @@ config.font = wezterm.font_with_fallback({ -- config.color_scheme = 'AdventureTime' -- config.font = wezterm.font("Menlo") config.font_size = 14.0 - config.window_background_opacity = 0.85 config.macos_window_background_blur = 20 config.enable_tab_bar = false - +config.mouse_bindings = { + -- Disable the 'Down' event of Cmd-Click to avoid weird program behaviors + { + event = { Down = { streak = 1, button = 'Left' } }, + mods = 'CMD', + action = act.Nop, + }, + -- Cmd-click will open the link under the mouse cursor + { + event = { Up = { streak = 1, button = 'Left' } }, + mods = 'CMD', + action = act.OpenLinkAtMouseCursor, + }, +} config.keys = { ---------------------------------------------------------------------------------- --- tmux ---------------------------------------------------------------------------------- -- move between tmux panes: Cmd+Shift+(HJKL) or Cmd+Shift+(Left Down Up Right) Arrow - { key = "h", mods = "CMD|SHIFT", action = wezterm.action { SendString = "\x02\x1b[D" } }, - { key = "j", mods = "CMD|SHIFT", action = wezterm.action { SendString = "\x02\x1b[B" } }, - { key = "k", mods = "CMD|SHIFT", action = wezterm.action { SendString = "\x02\x1b[A" } }, - { key = "l", mods = "CMD|SHIFT", action = wezterm.action { SendString = "\x02\x1b[C" } }, - { key = "LeftArrow", mods = "CMD|SHIFT", action = wezterm.action { SendString = "\x02\x1b[D" } }, - { key = "DownArrow", mods = "CMD|SHIFT", action = wezterm.action { SendString = "\x02\x1b[B" } }, - { key = "UpArrow", mods = "CMD|SHIFT", action = wezterm.action { SendString = "\x02\x1b[A" } }, - { key = "RightArrow", mods = "CMD|SHIFT", action = wezterm.action { SendString = "\x02\x1b[C" } }, + { key = "h", mods = "CMD|SHIFT", action = act { SendString = "\x02\x1b[D" } }, + { key = "j", mods = "CMD|SHIFT", action = act { SendString = "\x02\x1b[B" } }, + { key = "k", mods = "CMD|SHIFT", action = act { SendString = "\x02\x1b[A" } }, + { key = "l", mods = "CMD|SHIFT", action = act { SendString = "\x02\x1b[C" } }, + { key = "LeftArrow", mods = "CMD|SHIFT", action = act { SendString = "\x02\x1b[D" } }, + { key = "DownArrow", mods = "CMD|SHIFT", action = act { SendString = "\x02\x1b[B" } }, + { key = "UpArrow", mods = "CMD|SHIFT", action = act { SendString = "\x02\x1b[A" } }, + { key = "RightArrow", mods = "CMD|SHIFT", action = act { SendString = "\x02\x1b[C" } }, -- Select window 0-9 - { key = "1", mods = "CMD", action = wezterm.action { SendString = "\x021" } }, - { key = "2", mods = "CMD", action = wezterm.action { SendString = "\x022" } }, - { key = "3", mods = "CMD", action = wezterm.action { SendString = "\x023" } }, - { key = "4", mods = "CMD", action = wezterm.action { SendString = "\x024" } }, - { key = "5", mods = "CMD", action = wezterm.action { SendString = "\x025" } }, - { key = "6", mods = "CMD", action = wezterm.action { SendString = "\x026" } }, - { key = "7", mods = "CMD", action = wezterm.action { SendString = "\x027" } }, - { key = "8", mods = "CMD", action = wezterm.action { SendString = "\x028" } }, - { key = "9", mods = "CMD", action = wezterm.action { SendString = "\x029" } }, - { key = "0", mods = "CMD", action = wezterm.action { SendString = "\x020" } }, + { key = "1", mods = "CMD", action = act { SendString = "\x021" } }, + { key = "2", mods = "CMD", action = act { SendString = "\x022" } }, + { key = "3", mods = "CMD", action = act { SendString = "\x023" } }, + { key = "4", mods = "CMD", action = act { SendString = "\x024" } }, + { key = "5", mods = "CMD", action = act { SendString = "\x025" } }, + { key = "6", mods = "CMD", action = act { SendString = "\x026" } }, + { key = "7", mods = "CMD", action = act { SendString = "\x027" } }, + { key = "8", mods = "CMD", action = act { SendString = "\x028" } }, + { key = "9", mods = "CMD", action = act { SendString = "\x029" } }, + { key = "0", mods = "CMD", action = act { SendString = "\x020" } }, -- Previous/Next tmux window: Cmd+Shift+{/} - { key = "[", mods = "CMD|SHIFT", action = wezterm.action { SendString = "\x02p" } }, - { key = "]", mods = "CMD|SHIFT", action = wezterm.action { SendString = "\x02n" } }, + { key = "[", mods = "CMD|SHIFT", action = act { SendString = "\x02p" } }, + { key = "]", mods = "CMD|SHIFT", action = act { SendString = "\x02n" } }, -- Zoom - Cmd+Z - { key = "z", mods = "CMD", action = wezterm.action { SendString = "\x02z" } }, + { key = "z", mods = "CMD", action = act { SendString = "\x02z" } }, -- Kill the current pane/last window - Cmd+W - { key = "w", mods = "CMD", action = wezterm.action { SendString = "\x02x" } }, + { key = "w", mods = "CMD", action = act { SendString = "\x02x" } }, -- Detach - Cmd+Shift+W - { key = "w", mods = "CMD|SHIFT", action = wezterm.action { SendString = "\x02d" } }, + { key = "w", mods = "CMD|SHIFT", action = act { SendString = "\x02d" } }, -- Split pane horizontally - Cmd+D - { key = "d", mods = "CMD", action = wezterm.action { SendString = "\x02|" } }, + { key = "d", mods = "CMD", action = act { SendString = "\x02|" } }, -- Split pane vertically - Cmd+Shift+D - { key = "d", mods = "CMD|SHIFT", action = wezterm.action { SendString = "\x02_" } }, + { key = "d", mods = "CMD|SHIFT", action = act { SendString = "\x02_" } }, -- Create new window - Cmd+T - { key = "t", mods = "CMD", action = wezterm.action { SendString = "\x02c" } }, + { key = "t", mods = "CMD", action = act { SendString = "\x02c" } }, ---------------------------------------------------------------------------------- --- vim ---------------------------------------------------------------------------------- -- move between vim panes: Cmd+(HJKL) or Cmd+(Left Down Up Right) Arrow - { key = "h", mods = "CMD", action = wezterm.action { SendString = "\x17h" } }, - { key = "j", mods = "CMD", action = wezterm.action { SendString = "\x17j" } }, - { key = "k", mods = "CMD", action = wezterm.action { SendString = "\x17k" } }, - { key = "l", mods = "CMD", action = wezterm.action { SendString = "\x17l" } }, - { key = "LeftArrow", mods = "CMD", action = wezterm.action { SendString = "\x17h" } }, - { key = "DownArrow", mods = "CMD", action = wezterm.action { SendString = "\x17j" } }, - { key = "UpArrow", mods = "CMD", action = wezterm.action { SendString = "\x17k" } }, - { key = "RightArrow", mods = "CMD", action = wezterm.action { SendString = "\x17l" } }, + { key = "h", mods = "CMD", action = act { SendString = "\x17h" } }, + { key = "j", mods = "CMD", action = act { SendString = "\x17j" } }, + { key = "k", mods = "CMD", action = act { SendString = "\x17k" } }, + { key = "l", mods = "CMD", action = act { SendString = "\x17l" } }, + { key = "LeftArrow", mods = "CMD", action = act { SendString = "\x17h" } }, + { key = "DownArrow", mods = "CMD", action = act { SendString = "\x17j" } }, + { key = "UpArrow", mods = "CMD", action = act { SendString = "\x17k" } }, + { key = "RightArrow", mods = "CMD", action = act { SendString = "\x17l" } }, -- Select all in nvim: Cmd+A - { key = "a", mods = "CMD", action = wezterm.action { SendString = "\x1bggVG" } }, + { key = "a", mods = "CMD", action = act { SendString = "\x1bggVG" } }, -- save in nvim: Cmd+S - { key = "s", mods = "CMD", action = wezterm.action { SendString = "\x1b\x1b:w\n" } }, + { key = "s", mods = "CMD", action = act { SendString = "\x1b\x1b:w\n" } }, -- save all in nvim: Cmd+Shift+S - { key = "s", mods = "CMD|SHIFT", action = wezterm.action { SendString = "\x1b\x1b:wa\n" } }, + { key = "s", mods = "CMD|SHIFT", action = act { SendString = "\x1b\x1b:wa\n" } }, -- save and cloe pane: Cmd+Opt+S - { key = "s", mods = "CMD|OPT", action = wezterm.action { SendString = "\x1b\x1bZZ" } }, + { key = "s", mods = "CMD|OPT", action = act { SendString = "\x1b\x1bZZ" } }, -- open file picker in neovim: Cmd+P - { key = "p", mods = "CMD", action = wezterm.action { SendString = "\x1b\x1b sf\n" } }, + { key = "p", mods = "CMD", action = act { SendString = "\x1b\x1b sf\n" } }, -- Cmd+Shift+P - Select tmux session - { key = "p", mods = "CMD|SHIFT", action = wezterm.action { SendString = "\x02s" } }, + { key = "p", mods = "CMD|SHIFT", action = act { SendString = "\x02s" } }, -- bar bar - { key = ",", mods = "OPT", action = wezterm.action { SendString = '≤', } }, - { key = ".", mods = "OPT", action = wezterm.action { SendString = '≥', } }, + { key = ",", mods = "OPT", action = act { SendString = '≤', } }, + { key = ".", mods = "OPT", action = act { SendString = '≥', } }, -- Re-order to previous/next - { key = ",", mods = "SHIFT|OPT", action = wezterm.action { SendString = '¯', } }, - { key = ".", mods = "SHIFT|OPT", action = wezterm.action { SendString = '˘', } }, + { key = ",", mods = "SHIFT|OPT", action = act { SendString = '¯', } }, + { key = ".", mods = "SHIFT|OPT", action = act { SendString = '˘', } }, -- Goto buffer in position... - { key = "1", mods = "OPT", action = wezterm.action { SendString = '¡', } }, - { key = "2", mods = "OPT", action = wezterm.action { SendString = '™', } }, - { key = "3", mods = "OPT", action = wezterm.action { SendString = '£', } }, - { key = "4", mods = "OPT", action = wezterm.action { SendString = '¢', } }, - { key = "5", mods = "OPT", action = wezterm.action { SendString = '∞', } }, - { key = "6", mods = "OPT", action = wezterm.action { SendString = '§', } }, - { key = "7", mods = "OPT", action = wezterm.action { SendString = '¶', } }, - { key = "8", mods = "OPT", action = wezterm.action { SendString = '•', } }, - { key = "9", mods = "OPT", action = wezterm.action { SendString = 'ª', } }, - { key = "0", mods = "OPT", action = wezterm.action { SendString = 'º', } }, + { key = "1", mods = "OPT", action = act { SendString = '¡', } }, + { key = "2", mods = "OPT", action = act { SendString = '™', } }, + { key = "3", mods = "OPT", action = act { SendString = '£', } }, + { key = "4", mods = "OPT", action = act { SendString = '¢', } }, + { key = "5", mods = "OPT", action = act { SendString = '∞', } }, + { key = "6", mods = "OPT", action = act { SendString = '§', } }, + { key = "7", mods = "OPT", action = act { SendString = '¶', } }, + { key = "8", mods = "OPT", action = act { SendString = '•', } }, + { key = "9", mods = "OPT", action = act { SendString = 'ª', } }, + { key = "0", mods = "OPT", action = act { SendString = 'º', } }, -- Pin/unpin buffer - { key = "p", mods = "OPT", action = wezterm.action { SendString = 'π', } }, + { key = "p", mods = "OPT", action = act { SendString = 'π', } }, -- Close buffer - { key = "c", mods = "OPT", action = wezterm.action { SendString = 'ç', } }, + { key = "c", mods = "OPT", action = act { SendString = 'ç', } }, -- Close all but current - { key = "c", mods = "SHIFT|OPT", action = wezterm.action { SendString = 'Ç', } }, + { key = "c", mods = "SHIFT|OPT", action = act { SendString = 'Ç', } }, ---------------------------------------------------------------------------------- --- term ---------------------------------------------------------------------------------- -- Delete entire row - Cmd+Backspace - { key = "Backspace", mods = "CMD", action = wezterm.action { SendString = "\x15" } }, + { key = "Backspace", mods = "CMD", action = act { SendString = "\x15" } }, -- Delete entire word - Opt+Backspace - { key = "Backspace", mods = "OPT", action = wezterm.action { SendString = "\x17" } }, + { key = "Backspace", mods = "OPT", action = act { SendString = "\x17" } }, } +-- config.bidi_enabled = true +-- config.bidi_direction = "AutoLeftToRight" + -- and finally, return the configuration to wezterm return config diff --git a/aliases.sh b/aliases.sh index 5934cffe..f114b297 100755 --- a/aliases.sh +++ b/aliases.sh @@ -88,8 +88,9 @@ else fi # home +alias home="h_" alias h="home" -alias hi="home install" +alias hi="source \$DOTFILES/install.sh" alias rh="rhome" alias rt="home rt" alias hst="home status" @@ -99,7 +100,7 @@ alias hp="home push" alias hl="home pull" alias hlog="home git log" alias hiv="home install; vim ." -alias hv="pushd \$(wd path df); v; popd" +alias hv="vi \$(wd path df)" alias spider="ssh root@spider.casraf.dev" # docker diff --git a/install.sh b/install.sh index 6d71b2f4..1f363d44 100755 --- a/install.sh +++ b/install.sh @@ -1,9 +1,9 @@ #!/usr/bin/env zsh +[[ $(which echo_cyan) ]] && echo_cyan "Setting up..." || echo "Setting up..." source $DOTFILES/scripts/home/_common.sh source $DOTFILES/scripts/man.sh ZPLUG=0 -shift while [[ $# -gt 0 ]]; do case $1 in -z | --zplug) @@ -17,8 +17,8 @@ cwd="$(pwd)" pushd $DOTFILES echo_cyan "Setting defaults..." -write_default "PMPrintingExpandedStateForPrint" "-bool TRUE" -write_default "NSScrollViewRubberbanding" "-bool FALSE" +is_mac && write_default "PMPrintingExpandedStateForPrint" "-bool TRUE" +is_mac && write_default "NSScrollViewRubberbanding" "-bool FALSE" git config --global core.excludesfile ~/.config/.gitignore # Manfile