How can I create a shortcut to resize panes in a tmux window?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
4
down vote

favorite
1












I am having lots of issues with tmux in mac.

Another problem I have is that I can not bind a key in my tmux.conf to be able to resize my panes.

What I need is the CTRL-b: resize-pane -U 10 I currently do to increase the size of the pane upwards in 10 cells (or downwards or left or right) to be done by a key shortcut and not to actually have to type this over and over (which I currently do unfortunately).

But I can not find a way to configure this since in mac it seems that CTRL and other keys work diffently than linux.

Can anyone please help out? I have been trying too long to figure this out and for my first Mac I am really starting to dislike them.....










share|improve this question



























    up vote
    4
    down vote

    favorite
    1












    I am having lots of issues with tmux in mac.

    Another problem I have is that I can not bind a key in my tmux.conf to be able to resize my panes.

    What I need is the CTRL-b: resize-pane -U 10 I currently do to increase the size of the pane upwards in 10 cells (or downwards or left or right) to be done by a key shortcut and not to actually have to type this over and over (which I currently do unfortunately).

    But I can not find a way to configure this since in mac it seems that CTRL and other keys work diffently than linux.

    Can anyone please help out? I have been trying too long to figure this out and for my first Mac I am really starting to dislike them.....










    share|improve this question

























      up vote
      4
      down vote

      favorite
      1









      up vote
      4
      down vote

      favorite
      1






      1





      I am having lots of issues with tmux in mac.

      Another problem I have is that I can not bind a key in my tmux.conf to be able to resize my panes.

      What I need is the CTRL-b: resize-pane -U 10 I currently do to increase the size of the pane upwards in 10 cells (or downwards or left or right) to be done by a key shortcut and not to actually have to type this over and over (which I currently do unfortunately).

      But I can not find a way to configure this since in mac it seems that CTRL and other keys work diffently than linux.

      Can anyone please help out? I have been trying too long to figure this out and for my first Mac I am really starting to dislike them.....










      share|improve this question















      I am having lots of issues with tmux in mac.

      Another problem I have is that I can not bind a key in my tmux.conf to be able to resize my panes.

      What I need is the CTRL-b: resize-pane -U 10 I currently do to increase the size of the pane upwards in 10 cells (or downwards or left or right) to be done by a key shortcut and not to actually have to type this over and over (which I currently do unfortunately).

      But I can not find a way to configure this since in mac it seems that CTRL and other keys work diffently than linux.

      Can anyone please help out? I have been trying too long to figure this out and for my first Mac I am really starting to dislike them.....







      linux command-line ssh osx tmux






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 13 '17 at 12:37









      Community♦

      1




      1










      asked Jul 4 '13 at 18:07









      Jim

      2,806123257




      2,806123257




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted










          In ~/.tmux.conf:



          bind e resize-pane -U 10


          Then, tmux source-file ~/.tmux.conf. (another useful shortcut: use the same principle).






          share|improve this answer


















          • 1




            1) So bind e resize-pane -U 10 is one line in tmux that binds the key e with the resize? Should I have pressed the ctrl-b before e? 2) I am not sure what you mean with tmux source-file ~/.tmux.conf. Doesn't tmux read the home directory's conf file?
            – Jim
            Jul 4 '13 at 19:43










          • @Jim: Yes, you hit the prefix key first. Then e. Yes, tmux does that, but it is faster to have it as a shortcut as well, so you don't have to restart tmux every time you make an improvement/extension in/to the init file.
            – Emanuel Berg
            Jul 4 '13 at 19:44











          • So tmux source-file ~/.tmux.conf is another line in tmux.conf?
            – Jim
            Jul 4 '13 at 19:46










          • @Jim: No, that would be something you type. In the init file, it could look like this: bind u source-file ~/.tmux.conf if you want this for u.
            – Emanuel Berg
            Jul 4 '13 at 19:50






          • 1




            why are you using bind and not bind-key?
            – Charlie Parker
            Jan 28 '16 at 22:04

















          up vote
          1
          down vote













          Below are my keybindings that let me resize a pane.



          It uses Alt + direction, where the keys for the directions are known from Vim:




          k
          h l
          j


          # Resize the current pane using Alt + direction
          bind -n M-k resize-pane -U 5
          bind -n M-j resize-pane -D 5
          bind -n M-h resize-pane -L 5
          bind -n M-l resize-pane -R 5





          share|improve this answer






















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f81782%2fhow-can-i-create-a-shortcut-to-resize-panes-in-a-tmux-window%23new-answer', 'question_page');

            );

            Post as a guest






























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            3
            down vote



            accepted










            In ~/.tmux.conf:



            bind e resize-pane -U 10


            Then, tmux source-file ~/.tmux.conf. (another useful shortcut: use the same principle).






            share|improve this answer


















            • 1




              1) So bind e resize-pane -U 10 is one line in tmux that binds the key e with the resize? Should I have pressed the ctrl-b before e? 2) I am not sure what you mean with tmux source-file ~/.tmux.conf. Doesn't tmux read the home directory's conf file?
              – Jim
              Jul 4 '13 at 19:43










            • @Jim: Yes, you hit the prefix key first. Then e. Yes, tmux does that, but it is faster to have it as a shortcut as well, so you don't have to restart tmux every time you make an improvement/extension in/to the init file.
              – Emanuel Berg
              Jul 4 '13 at 19:44











            • So tmux source-file ~/.tmux.conf is another line in tmux.conf?
              – Jim
              Jul 4 '13 at 19:46










            • @Jim: No, that would be something you type. In the init file, it could look like this: bind u source-file ~/.tmux.conf if you want this for u.
              – Emanuel Berg
              Jul 4 '13 at 19:50






            • 1




              why are you using bind and not bind-key?
              – Charlie Parker
              Jan 28 '16 at 22:04














            up vote
            3
            down vote



            accepted










            In ~/.tmux.conf:



            bind e resize-pane -U 10


            Then, tmux source-file ~/.tmux.conf. (another useful shortcut: use the same principle).






            share|improve this answer


















            • 1




              1) So bind e resize-pane -U 10 is one line in tmux that binds the key e with the resize? Should I have pressed the ctrl-b before e? 2) I am not sure what you mean with tmux source-file ~/.tmux.conf. Doesn't tmux read the home directory's conf file?
              – Jim
              Jul 4 '13 at 19:43










            • @Jim: Yes, you hit the prefix key first. Then e. Yes, tmux does that, but it is faster to have it as a shortcut as well, so you don't have to restart tmux every time you make an improvement/extension in/to the init file.
              – Emanuel Berg
              Jul 4 '13 at 19:44











            • So tmux source-file ~/.tmux.conf is another line in tmux.conf?
              – Jim
              Jul 4 '13 at 19:46










            • @Jim: No, that would be something you type. In the init file, it could look like this: bind u source-file ~/.tmux.conf if you want this for u.
              – Emanuel Berg
              Jul 4 '13 at 19:50






            • 1




              why are you using bind and not bind-key?
              – Charlie Parker
              Jan 28 '16 at 22:04












            up vote
            3
            down vote



            accepted







            up vote
            3
            down vote



            accepted






            In ~/.tmux.conf:



            bind e resize-pane -U 10


            Then, tmux source-file ~/.tmux.conf. (another useful shortcut: use the same principle).






            share|improve this answer














            In ~/.tmux.conf:



            bind e resize-pane -U 10


            Then, tmux source-file ~/.tmux.conf. (another useful shortcut: use the same principle).







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 2 mins ago









            Mateen Ulhaq

            1897




            1897










            answered Jul 4 '13 at 19:40









            Emanuel Berg

            3,60452852




            3,60452852







            • 1




              1) So bind e resize-pane -U 10 is one line in tmux that binds the key e with the resize? Should I have pressed the ctrl-b before e? 2) I am not sure what you mean with tmux source-file ~/.tmux.conf. Doesn't tmux read the home directory's conf file?
              – Jim
              Jul 4 '13 at 19:43










            • @Jim: Yes, you hit the prefix key first. Then e. Yes, tmux does that, but it is faster to have it as a shortcut as well, so you don't have to restart tmux every time you make an improvement/extension in/to the init file.
              – Emanuel Berg
              Jul 4 '13 at 19:44











            • So tmux source-file ~/.tmux.conf is another line in tmux.conf?
              – Jim
              Jul 4 '13 at 19:46










            • @Jim: No, that would be something you type. In the init file, it could look like this: bind u source-file ~/.tmux.conf if you want this for u.
              – Emanuel Berg
              Jul 4 '13 at 19:50






            • 1




              why are you using bind and not bind-key?
              – Charlie Parker
              Jan 28 '16 at 22:04












            • 1




              1) So bind e resize-pane -U 10 is one line in tmux that binds the key e with the resize? Should I have pressed the ctrl-b before e? 2) I am not sure what you mean with tmux source-file ~/.tmux.conf. Doesn't tmux read the home directory's conf file?
              – Jim
              Jul 4 '13 at 19:43










            • @Jim: Yes, you hit the prefix key first. Then e. Yes, tmux does that, but it is faster to have it as a shortcut as well, so you don't have to restart tmux every time you make an improvement/extension in/to the init file.
              – Emanuel Berg
              Jul 4 '13 at 19:44











            • So tmux source-file ~/.tmux.conf is another line in tmux.conf?
              – Jim
              Jul 4 '13 at 19:46










            • @Jim: No, that would be something you type. In the init file, it could look like this: bind u source-file ~/.tmux.conf if you want this for u.
              – Emanuel Berg
              Jul 4 '13 at 19:50






            • 1




              why are you using bind and not bind-key?
              – Charlie Parker
              Jan 28 '16 at 22:04







            1




            1




            1) So bind e resize-pane -U 10 is one line in tmux that binds the key e with the resize? Should I have pressed the ctrl-b before e? 2) I am not sure what you mean with tmux source-file ~/.tmux.conf. Doesn't tmux read the home directory's conf file?
            – Jim
            Jul 4 '13 at 19:43




            1) So bind e resize-pane -U 10 is one line in tmux that binds the key e with the resize? Should I have pressed the ctrl-b before e? 2) I am not sure what you mean with tmux source-file ~/.tmux.conf. Doesn't tmux read the home directory's conf file?
            – Jim
            Jul 4 '13 at 19:43












            @Jim: Yes, you hit the prefix key first. Then e. Yes, tmux does that, but it is faster to have it as a shortcut as well, so you don't have to restart tmux every time you make an improvement/extension in/to the init file.
            – Emanuel Berg
            Jul 4 '13 at 19:44





            @Jim: Yes, you hit the prefix key first. Then e. Yes, tmux does that, but it is faster to have it as a shortcut as well, so you don't have to restart tmux every time you make an improvement/extension in/to the init file.
            – Emanuel Berg
            Jul 4 '13 at 19:44













            So tmux source-file ~/.tmux.conf is another line in tmux.conf?
            – Jim
            Jul 4 '13 at 19:46




            So tmux source-file ~/.tmux.conf is another line in tmux.conf?
            – Jim
            Jul 4 '13 at 19:46












            @Jim: No, that would be something you type. In the init file, it could look like this: bind u source-file ~/.tmux.conf if you want this for u.
            – Emanuel Berg
            Jul 4 '13 at 19:50




            @Jim: No, that would be something you type. In the init file, it could look like this: bind u source-file ~/.tmux.conf if you want this for u.
            – Emanuel Berg
            Jul 4 '13 at 19:50




            1




            1




            why are you using bind and not bind-key?
            – Charlie Parker
            Jan 28 '16 at 22:04




            why are you using bind and not bind-key?
            – Charlie Parker
            Jan 28 '16 at 22:04












            up vote
            1
            down vote













            Below are my keybindings that let me resize a pane.



            It uses Alt + direction, where the keys for the directions are known from Vim:




            k
            h l
            j


            # Resize the current pane using Alt + direction
            bind -n M-k resize-pane -U 5
            bind -n M-j resize-pane -D 5
            bind -n M-h resize-pane -L 5
            bind -n M-l resize-pane -R 5





            share|improve this answer


























              up vote
              1
              down vote













              Below are my keybindings that let me resize a pane.



              It uses Alt + direction, where the keys for the directions are known from Vim:




              k
              h l
              j


              # Resize the current pane using Alt + direction
              bind -n M-k resize-pane -U 5
              bind -n M-j resize-pane -D 5
              bind -n M-h resize-pane -L 5
              bind -n M-l resize-pane -R 5





              share|improve this answer
























                up vote
                1
                down vote










                up vote
                1
                down vote









                Below are my keybindings that let me resize a pane.



                It uses Alt + direction, where the keys for the directions are known from Vim:




                k
                h l
                j


                # Resize the current pane using Alt + direction
                bind -n M-k resize-pane -U 5
                bind -n M-j resize-pane -D 5
                bind -n M-h resize-pane -L 5
                bind -n M-l resize-pane -R 5





                share|improve this answer














                Below are my keybindings that let me resize a pane.



                It uses Alt + direction, where the keys for the directions are known from Vim:




                k
                h l
                j


                # Resize the current pane using Alt + direction
                bind -n M-k resize-pane -U 5
                bind -n M-j resize-pane -D 5
                bind -n M-h resize-pane -L 5
                bind -n M-l resize-pane -R 5






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 17 '17 at 7:10

























                answered Nov 15 '17 at 13:56









                Matthias Braun

                1,72211120




                1,72211120



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f81782%2fhow-can-i-create-a-shortcut-to-resize-panes-in-a-tmux-window%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay