Skip to content

Instantly share code, notes, and snippets.

@slavniyteo
Last active February 6, 2018 11:06
Show Gist options
  • Save slavniyteo/595f96fa47c111637dbeb83409a50171 to your computer and use it in GitHub Desktop.
Save slavniyteo/595f96fa47c111637dbeb83409a50171 to your computer and use it in GitHub Desktop.
Configure ubuntu to be handy

Use keynav to navigate on screen without mouse

  1. Go to official site and download, download and install
  2. Add config file to your ~/.keynavrc:
ctrl+semicolon start, cursorzoom 20 20

shift+h cut-left
shift+j cut-down
shift+k cut-up
shift+l cut-right
shift+u cut-left,cut-up
shift+i cut-right,cut-up
shift+n cut-left,cut-down
shift+m cut-right,cut-down

h move-left
j move-down
k move-up
l move-right
u move-left,move-up
i move-right,move-up
n move-left,move-down
m move-right,move-down

ctrl+h move-left 200
ctrl+j move-down 200
ctrl+k move-up 200
ctrl+l move-right 200
ctrl+u move-left 200,move-up 200
ctrl+i move-right 200,move-up 200
ctrl+n move-left 200,move-down 200
ctrl+m move-right 200,move-down 200

1 warp,click 1,end
2 warp,click 2,end
3 warp,click 3,end

space warp,click 1,end
ctrl+space warp,click 2,end
shift+space warp,click 3,end

Use tmux

Install tmux; look at wiki for details.

Configure tmux:

  • set border color to red (to see what pane is active right now);
  • navigate with h-j-k-l between panes

See .tmux.conf:

set -g default-terminal "screen-256color"
set -g pane-active-border-fg red
set -g pane-active-border-bg red

bind-key -r C-h resize-pane -L 5
bind-key -r C-j resize-pane -D 5
bind-key -r C-k resize-pane -U 5
bind-key -r C-l resize-pane -R 5

bind-key -r M-h resize-pane -L
bind-key -r M-j resize-pane -D
bind-key -r M-k resize-pane -U
bind-key -r M-l resize-pane -R

bind-key -r h select-pane -L
bind-key -r j select-pane -D
bind-key -r k select-pane -U
bind-key -r l select-pane -R

bind-key -r L last-window

bind-key -r % split-window -h -c '#{pane_current_path}'
bind-key -r '"' split-window -v -c '#{pane_current_path}'
bind-key -r C new-window -c '#{pane_current_path}'

bind-key -r -n C-] copy-mode
bind-key -t emacs-copy -n C-k halfpage-up
bind-key -t emacs-copy -n C-j halfpage-down
bind-key -t emacs-copy -n k scroll-up
bind-key -t emacs-copy -n j scroll-down

Use tilda with tmux as fast and handy dropdown terminal

  1. Install tilda
  2. Configure tilda to use tmux as default shell.
  3. Start tilda with different tmux sessions for each monitor.
  4. Use F1, F2, ... to show/hide fullscreen terminals.

Write your own scripts

With macroses library you can write you own scripts.

The reasons to do it:

  • automate your routines;
  • write examples of using unusial soft (like local gists);
  • it is a good way to learn new languages in use: write simple and useful scripts every day/week with new language.

Use vim

Just use it. Vim is awesome

Use trans: google translator CLI

Here.

Write some macroses like:

# ru
#!/bin/sh

trans -v -pager 'less -r -S' :ru "$*"

and

# en
#!/bin/sh

trans -v -pager '-less -r -S' -p :en "$*"

Use virtual desktops

I use 3x3 or 4x4. Configure shortcuts to move between them with Ctrl+Alt+h/j/k/l to make it faster. Then open every new program at separate desktop and move between desctops instead Alt+Tab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment