chabou / hyper-pane

Extension for Hyper.app to enhance pane navigation.
MIT License
191 stars 13 forks source link

Can not overwrite defaults #9

Closed caillou closed 7 years ago

caillou commented 7 years ago

Thanks for you brilliant effort with this plugin.

I use Hyper v1.3.1 and the latest hyper-pane.

I can not seem to be able to overwrite the defaults given the following config:

  module.exports = {
    config: {
      fontSize: 12,
      fontFamily: 'Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',
      cursorColor: 'rgba(248,28,229,0.8)',
      cursorShape: 'BLOCK',
      cursorBlink: false,
      foregroundColor: '#fff',
      backgroundColor: '#000',
      borderColor: '#333',
      css: '',
      termCSS: '',
      showHamburgerMenu: '',
      showWindowControls: '',
      padding: '12px 14px',
      colors: {
        black: '#000000',
        red: '#ff0000',
        green: '#33ff00',
        yellow: '#ffff00',
        blue: '#0066ff',
        magenta: '#cc00ff',
        cyan: '#00ffff',
        white: '#d0d0d0',
        lightBlack: '#808080',
        lightRed: '#ff0000',
        lightGreen: '#33ff00',
        lightYellow: '#ffff00',
        lightBlue: '#0066ff',
        lightMagenta: '#cc00ff',
        lightCyan: '#00ffff',
        lightWhite: '#ffffff'
      },
      shell: '',
      shellArgs: ['--login'],
      env: {},
      bell: false,
      copyOnSelect: false
    },
    paneNavigation: {
      hotkeys: {
        navigation: {
          up: 'meta+alt+up',
          down: 'meta+alt+down',
          left: 'meta+alt+left',
          right: 'meta+alt+right'
        },
      },
      showIndicators: false,
    },
    plugins: [
      'hyper-pane', // Enhance pane navigation
      'hyperlayout', // Layout presets
      'hypercwd', // Opens new tabs with the same directory as the current tab
      'hyperlinks', // automatically links URLs
      'hyperterm-safepaste', // Makes pasting into hyperterm safe
    ],
    localPlugins: [],
  };
chabou commented 7 years ago

Thank you for your feedback. I will try to reproduce it soon.

chabou commented 7 years ago

Ok, your config file is malformed. paneNavigation should be a children of config.

module.exports = {
  config: {
    fontSize: 12,
    fontFamily: 'Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',
    cursorColor: 'rgba(248,28,229,0.8)',
    cursorShape: 'BLOCK',
    cursorBlink: false,
    foregroundColor: '#fff',
    backgroundColor: '#000',
    borderColor: '#333',
    css: '',
    termCSS: '',
    showHamburgerMenu: '',
    showWindowControls: '',
    padding: '12px 14px',
    colors: {
      black: '#000000',
      red: '#ff0000',
      green: '#33ff00',
      yellow: '#ffff00',
      blue: '#0066ff',
      magenta: '#cc00ff',
      cyan: '#00ffff',
      white: '#d0d0d0',
      lightBlack: '#808080',
      lightRed: '#ff0000',
      lightGreen: '#33ff00',
      lightYellow: '#ffff00',
      lightBlue: '#0066ff',
      lightMagenta: '#cc00ff',
      lightCyan: '#00ffff',
      lightWhite: '#ffffff'
    },
    shell: '',
    shellArgs: ['--login'],
    env: {},
    bell: false,
    copyOnSelect: false,
    paneNavigation: {
      hotkeys: {
        navigation: {
          up: 'meta+alt+up',
          down: 'meta+alt+down',
          left: 'meta+alt+left',
          right: 'meta+alt+right'
        },
      },
      showIndicators: false
    },
  },

  plugins: [
    'hyper-pane', // Enhance pane navigation
    'hyperlayout', // Layout presets
    'hypercwd', // Opens new tabs with the same directory as the current tab
    'hyperlinks', // automatically links URLs
    'hyperterm-safepaste', // Makes pasting into hyperterm safe
  ],
  localPlugins: [],
};

Be careful, meta+alt+left and meta+alt+right is used by Hyper to navigate between tabs. Both will be triggered. It is not possible yet to override Hyper shortcuts, but @ppot is working on it (https://github.com/zeit/hyper/pull/1509). But if you use only one tab, it's ok.