{"id":198,"date":"2011-12-02T23:04:45","date_gmt":"2011-12-02T21:04:45","guid":{"rendered":"http:\/\/blog.garion.org\/?p=198"},"modified":"2014-08-03T17:10:21","modified_gmt":"2014-08-03T15:10:21","slug":"irssi-tricks-navigating-around","status":"publish","type":"post","link":"https:\/\/joost.vunderink.net\/blog\/2011\/12\/02\/irssi-tricks-navigating-around\/","title":{"rendered":"Irssi tricks: navigating around"},"content":{"rendered":"<p>Irssi has many ways to navigate between windows, and within a window.<\/p>\n<p>For this article, I am assuming that you do <em>not<\/em> use split windows. Also, whenever I mention the <strong>alt<\/strong> key, I mean <strong>alt<\/strong>, or <strong>meta<\/strong>, or <strong>option<\/strong>, or whatever works for you. There is a difference between them, but that&#8217;s beyond the scope of this post.<\/p>\n<p>If the <strong>alt<\/strong>\u00a0key does not work properly for you, you have two options:<\/p>\n<ol>\n<li>Configure your OS or terminal application to send\u00a0<strong>alt<\/strong>\u00a0to irssi instead of to the OS or application (for example, make sure that <strong>alt<\/strong> + <strong>f<\/strong> does not open the File menu, but is sent to irssi).<\/li>\n<li>Instead of pressing\u00a0<strong>alt<\/strong>\u00a0plus another key at the same time, you can press <strong>escape<\/strong>, followed by the other key. For example, pressing <strong>alt<\/strong> and <strong>a<\/strong> at the same time is equivalent to pressing <strong>escape<\/strong>, releasing, and then pressing <strong>a<\/strong>.<\/li>\n<\/ol>\n<h2>Navigating while typing<\/h2>\n<p>Let&#8217;s start by what you can do while typing. These keystrokes change only what happens on the input line (the line where you type stuff).<\/p>\n<ul>\n<li>arrow left\/right: move one character left or right.<\/li>\n<li>ctrl + arrow left\/right: move one word left or right.<\/li>\n<li>ctrl + a or Home: move to start of line.<\/li>\n<li>ctrl + e or End: move to end of line.<\/li>\n<li>ctrl + w: remove from cursor to the beginning of the word the cursor is on.<\/li>\n<li>ctrl + k: remove from cursor to end of line.<\/li>\n<li>ctrl + u: remove the entire line.<\/li>\n<li>arrow up\/down: previous\/next command you typed.<\/li>\n<\/ul>\n<h2>Navigating within a window<\/h2>\n<p>There are keystrokes and commands to navigate within a single window. The total amount of text inside a single window is called the <em>buffer<\/em>.<\/p>\n<p>These are the keys:<\/p>\n<ul>\n<li>page-down or alt + n: scroll down half a page.<\/li>\n<li>page-up or alt + p: scroll up half a page.<\/li>\n<\/ul>\n<p>And these are the commands:<\/p>\n<ul>\n<li>\/scrollback home: go to the first line of the buffer.<\/li>\n<li>\/scrollback end: go to the last line of the buffer.<\/li>\n<li>\/scrollback goto 13:05: scrolls back to 13:05.<\/li>\n<li>\/scrollback goto -100: scrolls back 100 lines.<\/li>\n<li>\/scrollback goto +50: scrolls forward 50 lines.<\/li>\n<\/ul>\n<p>You can use <strong>\/sb<\/strong> instead of <strong>\/scrollback<\/strong> to save time typing.<\/p>\n<h2>Navigating between windows<\/h2>\n<p>The most important thing to know about navigating between windows is that <strong>alt + a<\/strong> sends you to the window with the most recent, most important activity. Pressing it consecutively will first lead you through all windows that are pink in your activity bar, then all windows that are white, and then the rest. This is not entirely correct, but if you are able to correct me on this, you don&#8217;t need this article in the first place \ud83d\ude42<\/p>\n<p>Then there are <strong>alt<\/strong> + <strong>1<\/strong>, <strong>alt<\/strong> + <strong>2<\/strong> , and so on. These take you directly to the window with that number. By default, the top 2 lines of your (qwerty) keyboard are bound that way, all the way up to <strong>alt<\/strong> + <strong>o<\/strong>, which takes you to window 19.<\/p>\n<p>Going to the next or previous window can be done by pressing <strong>ctrl<\/strong> + <strong>p<\/strong> or <strong>ctrl<\/strong> + <strong>n<\/strong>, or via <strong>alt<\/strong> + <strong>arrow left<\/strong> or <strong>alt<\/strong> + <strong>arrow right<\/strong>.<\/p>\n<p>Some commands to make your life easier:<\/p>\n<ul>\n<li>\/window last: go to the window you were in before this one.<\/li>\n<li>\/window goto &lt;number&gt;: go to the window with that number.<\/li>\n<li>\/window goto &lt;nickname&gt;: go to the window with the query with &lt;nickname&gt;.<\/li>\n<li>\/window goto &lt;channel&gt;: go to the window with the given channel.<\/li>\n<\/ul>\n<p><span class=\"Apple-style-span\" style=\"color: #000000; font-size: 22px; line-height: 32px;\">Changing navigation<\/span><\/p>\n<p>Personally, I like my <strong>home<\/strong> and <strong>end<\/strong> keys not to go to the beginning and end of the text line, but to the beginning and end of the buffer. I have accomplished this by doing the following:<\/p>\n<ul>\n<li>\/bind end command \/sb end<\/li>\n<li>\/bind home command \/sb home<\/li>\n<\/ul>\n<p>Also, having <strong>alt<\/strong> + <strong>1<\/strong> through <strong>alt<\/strong> + <strong>0<\/strong> and <strong>alt<\/strong> + <strong>q<\/strong> through <strong>alt<\/strong> + <strong>p<\/strong> is great if you have &#8220;only&#8221; 20 windows, but if you have more, what then? I&#8217;ve added windows 21 to 40, like this:<\/p>\n<ul>\n<li>\/bind meta-a change_window 21<\/li>\n<li>\/bind meta-s change_window 22<\/li>\n<\/ul>\n<p>And so on. I had to re-bind <strong>alt + a<\/strong> of course, <strong>alt<\/strong> + <strong>[<\/strong>, which is to the right of the <strong>p<\/strong> on my keyboard:<\/p>\n<ul>\n<li>\/bind meta-[\u00a0active_window<\/li>\n<\/ul>\n<p>If you want to scroll up or down a different amount that half a page when pressing <strong>page-<\/strong><strong>up<\/strong> or <strong>page-down<\/strong>, change the setting\u00a0<strong>scroll_page_count<\/strong>.<\/p>\n<p>The command <strong>\/window goto<\/strong> is very useful. However, it&#8217;s way too much typing. So, since I never use <strong>\/w<\/strong> for <strong>\/who<\/strong>, I&#8217;ve changed <strong>\/w<\/strong> to <strong>\/window goto<\/strong>:<\/p>\n<ul>\n<li>\/alias w \/window goto<\/li>\n<\/ul>\n<p>Finally, I got rather annoyed by how <strong>ctrl<\/strong> + <strong>z<\/strong> puts irssi in the background. I never ever want to do that. So, I wanted to bind <strong>ctrl<\/strong> + <strong>z<\/strong> to a useful command. There is a command that takes you to the window you were in before this one, so I bound that:<\/p>\n<ul>\n<li>\/bind ^Z command window last<\/li>\n<\/ul>\n<p>This way, by pressing <strong>ctrl<\/strong> + <strong>z<\/strong>, I can keep toggling between two interesting windows.<\/p>\n<p>I hope this helps you to navigate around irssi easier and faster!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Irssi has many ways to navigate between windows, and within a window. For this article, I am assuming that you do not use split windows. Also, whenever I mention the alt key, I mean alt, or meta, or option, or &hellip; <a href=\"https:\/\/joost.vunderink.net\/blog\/2011\/12\/02\/irssi-tricks-navigating-around\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[75,76,217,91,96,95,94,90,97,93,89,92,73,77,74],"class_list":["post-198","post","type-post","status-publish","format-standard","hentry","category-irssi","tag-alias","tag-bind","tag-irssi","tag-irssi-alias","tag-irssi-keybinding","tag-irssi-keybindings","tag-irssi-navigating","tag-irssi-navigation","tag-irssi-previous-window","tag-irssi-scrollback","tag-irssi-tricks","tag-irssi-window","tag-navigation","tag-scrollback","tag-window"],"_links":{"self":[{"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/posts\/198"}],"collection":[{"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/comments?post=198"}],"version-history":[{"count":9,"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/posts\/198\/revisions"}],"predecessor-version":[{"id":350,"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/posts\/198\/revisions\/350"}],"wp:attachment":[{"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/media?parent=198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/categories?post=198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/tags?post=198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}