{"id":30068557,"url":"https://github.com/izeau/iterm.nvim","last_synced_at":"2025-10-16T16:14:55.598Z","repository":{"id":181885993,"uuid":"667615511","full_name":"izeau/iterm.nvim","owner":"izeau","description":"Set various iTerm2 properties using proprietary escape sequences.","archived":false,"fork":false,"pushed_at":"2023-07-17T23:33:49.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-12-13T10:20:47.468Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/izeau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-17T23:30:12.000Z","updated_at":"2023-07-19T01:54:23.000Z","dependencies_parsed_at":"2023-07-18T00:49:56.693Z","dependency_job_id":null,"html_url":"https://github.com/izeau/iterm.nvim","commit_stats":null,"previous_names":["izeau/iterm.nvim"],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/izeau/iterm.nvim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izeau%2Fiterm.nvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izeau%2Fiterm.nvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izeau%2Fiterm.nvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izeau%2Fiterm.nvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/izeau","download_url":"https://codeload.github.com/izeau/iterm.nvim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izeau%2Fiterm.nvim/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269410045,"owners_count":24412147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-08T02:00:09.200Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-08T10:45:28.797Z","updated_at":"2025-10-16T16:14:50.556Z","avatar_url":"https://github.com/izeau.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# iterm.nvim\n\nSet various iTerm2 properties using proprietary escape sequences.\n\n## Install\n\nUsing [vim-plug](https://github.com/junegunn/vim-plug):\n\n```viml\nPlug \"izeau/iterm.nvim\"\n```\n\nUsing [Packer](https://github.com/wbthomason/packer.nvim):\n\n```lua\nuse { \"izeau/iterm.nvim\" }\n```\n\nUsing [lazy.nvim](https://github.com/folke/lazy.nvim):\n\n```lua\n-- plugins/iterm.lua\nreturn {\n  { \"izeau/iterm.nvim\", version = false },\n}\n```\n\n## Options\n\nDefaults values:\n\n```lua\n{\n  -- properties set when setup() is called, use false to disable\n  profile = \"Neovim\",\n  tab_color = false,\n  badge = false,\n  background_image = false,\n\n  -- properties set when exiting nvim, if auto_reset is true\n  auto_reset = true,\n  reset_profile = \"\",\n  reset_tab_color = false,\n  reset_badge = false,\n  reset_background_image = false,\n}\n```\n\n## API\n\n### Set profile\n\n```lua\nrequire(\"iterm\").set_profile(\"Neovim\")            -- named profile\nrequire(\"iterm\").set_profile(\"\")                  -- default profile\n```\n\n### Set badge\n\n```lua\nrequire(\"iterm\").set_badge(\"nvim@\\\\(hostname)\")   -- interpolated\nrequire(\"iterm\").set_badge(\"\")                    -- clear the badge\n```\n\n### Set tab color\n\n```lua\nrequire(\"iterm\").set_tab_color({ 52, 152, 219 })  -- RGB tuple\nrequire(\"iterm\").set_tab_color(\"#3498db\")         -- hex string\nrequire(\"iterm\").set_tab_color(nil)               -- reset the tab color\n```\n\n### Set background image\n\nMake sure your theme does not set a background color. Path is normalized, and\nrelative paths are resolved using the current working directory.\n\n```lua\nrequire(\"iterm\").set_background_image(\"~/bg.png\") -- path is expanded\nrequire(\"iterm\").set_background_image(\"\")         -- remove background\n```\n\n### Request attention\n\n#### Flash the current pane\n\n```lua\nrequire(\"iterm\").flash()\n```\n\n#### Bounce the dock icon\n\nOnly works when iTerm is not focused.\n\n```lua\nrequire(\"iterm\").bounce_once()                    -- bounce once\nrequire(\"iterm\").bounce_start()                   -- start bouncing\nrequire(\"iterm\").bounce_stop()                    -- stop bouncing\n```\n\n#### :fireworks:\n\n```lua\nrequire(\"iterm\").fireworks()\n```\n\n## Why would you use this?\n\nI personally use it to automatically switch to a different profile when using\nNeovim, because iTerm’s built-in automatic profile switching was randomly\nfailing. My _Neovim_ profile defines a few shortcuts using the _Command_ key,\nsuch as `⌘s` to save no matter the mode you’re currently in. In order to do\nthis, you have to define a key mapping in your profile (iTerm2 Preferences \u003e\nProfiles \u003e Neovim \u003e Keys \u003e Key Mappings) to bind `⌘s` to the _Send Escape\nSequence_ action, and send the `Esc+[25~s` characters to the current session.\n`Esc+[25~` is the escape sequence for the `F13` key, which you can then use in\nyour Neovim config:\n\n```lua\nvim.keymap.set({ \"n\", \"i\", \"v\" }, \"\u003cf13\u003es\", \"\u003ccmd\u003ewrite\u003ccr\u003e\")\n```\n\nYou can also use it to flash your terminal whenever you enter or exit the insert\nmode, if you kind of like that burning sensation on your retina:\n\n```lua\nvim.api.nvim_create_autocmd({ \"InsertEnter\", \"InsertLeave\" }, {\n  callback = function() require(\"iterm\").flash() end,\n})\n```\n\nYou may hook into [nvim-notify](https://github.com/rcarriga/nvim-notify)’s\nnotification system to bounce the Dock icon whenever you receive a notification\nand iTerm is not focused:\n\n```lua\nrequire(\"nvim-notify\").setup({\n  on_open = function() require(\"iterm\").bounce_start() end,\n})\n```\n\nOr perhaps you want to change your terminal tab color when editing a readonly\nfile?\n\n```lua\nvim.api.nvim_create_autocmd(\"BufEnter\", {\n  callback = function(event)\n    if vim.bo[event.buf].readonly then\n      require(\"iterm\").set_tab_color(\"#c0392b\")\n    end\n  end\n})\n\nvim.api.nvim_create_autocmd(\"BufLeave\", {\n  callback = function() require(\"iterm\").set_tab_color(nil) end\n})\n```\n\nFinally, if you have a tendency to lose your cursor and the `cursorline` /\n`cursorcolumn` options are not enough for you, you can setup a hotkey to setup\nan explosion:\n\n```lua\nvim.keymap.set(\"n\", \"\u003cf1\u003e\", function() require(\"iterm\").fireworks() end)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fizeau%2Fiterm.nvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fizeau%2Fiterm.nvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fizeau%2Fiterm.nvim/lists"}