User Tools

Site Tools


learn

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
learn [2022/06/26 08:18] – created dblumelearn [2023/12/11 09:47] (current) – [CLI/UI Navigation (vim / tmux / i3)] document tmux Prefix,tab dblume
Line 2: Line 2:
  
 Things to learn through repetition. Things to learn through repetition.
 +
 +===== CLI/UI Navigation (vim / tmux / i3) =====
 +
 +Vim, tmux and i3 all have similar concepts. You can have multiple things on screen, each can be maximized, and you can also have collections of those things offscreen. This is an over simplification. We're not going to get into things like vim buffers, tmux sessions, and i3 containers. Let's keep it simple.
 +
 +^  Nomenclature  ^^^
 +^ Tool ^ Things on screen ^ Off screen ^
 +| vim  | windows          | tabs       |
 +| tmux | panes            | windows    |
 +| i3   | windows          | workspaces |
 +
 +If I'm in i3, I'm usually local to the machine and don't start tmux sessions. So for me it's either ssh+tmux+vim+entr, or i3+vim+entr.
 +
 +These are the everyday things I have to do in each:
 +
 +^  New Vim Window / tmux Pane / i3 Window  ^^^
 +^ Context ^ Key ^ Action ^
 +| vim  | C-w,n    | New empty window |
 +| vim  | C-w,s    | Duplicate window below |
 +| vim  | C-w,v    | Duplicate window on side |
 +| tmux | Prefix,s | New pane below |
 +| tmux | Prefix,v | New pane on side |
 +| i3   | Mod+d or Enter or g | Every app launches into a new window (find [[https://git.dlma.com/dotfiles.git/raw/HEAD/.config/i3/config|mod+g]]) |
 +
 +^  Close Window / Pane / Window  ^^^
 +^ Context ^ Key ^ Action ^
 +| vim  | C-w,q | Quit this window |
 +| vim  | C-w,o | Close other windows, leaving only this one. |
 +| tmux | exit or C-d | Terminate the shell to close pane |
 +| i3   | | Close the app its normal way |
 +
 +^  Resize Window / Pane / Window  ^^^
 +^ Context ^ Key ^ Action ^
 +| vim  | C-w,= | Make windows equal size |
 +| vim  | C-w,<>+- | <,> for width; +,- for height |
 +| tmux | Prefix,HJKL | Change dimension in that direction |
 +| i3   | Mod+r,hjkl | Enter resize mode (or drag bar with mouse) |
 +
 +^  Maximize Window / Pane / Window  ^^^
 +^ Context ^ Key ^ Action ^
 +| vim | Leader,o | Maximize only this window in new tab (find [[https://git.dlma.com/dotfiles.git/raw/HEAD/.vimrc|<leader>o]]) |
 +| tmux | Prefix,z | toggle maximize |
 +| i3 | Mod+f | maximize window |
 +
 +^  Navigate Window, Buffer / Pane / Window  ^^^
 +^ Context ^ Key ^ Action ^
 +| vim  | C-w,hjkl | Select that window |
 +| vim  | tab | Next buffer (in this window) (find [[https://git.dlma.com/dotfiles.git/raw/HEAD/.vimrc|<Tab>]]) |
 +| tmux | Prefix,hjkl | Select that pane |
 +| tmux | Prefix,tab | Next/prev pane, maximized (find [[https://git.dlma.com/dotfiles.git/raw/HEAD/.tmux.conf|Tab]]) |
 +| i3 | Mod+hjkl | select that window |
 +
 +^  Swap Window / Pane / Window  ^^^
 +^ Context ^ Key ^ Action ^
 +| vim  | C-w,HJKL | Move window in that direction |
 +| tmux | Prefix,{ or } | Swap panes |
 +| tmux | Prefix,space | Rotate splits |
 +| i3   | Mod+HJKL | Move window in that direction |
 +
 +^  New Tab / Window / Workspace  ^^^
 +^ Context ^ Key ^ Action ^
 +| vim  | Leader,t,n or :tabnew | New tab |
 +| tmux | Prefix,c | Create a new window |
 +| i3   | Ctrl+Mod+Shift+o | Move to first available workspace (find [[https://git.dlma.com/dotfiles.git/raw/HEAD/.config/i3/config|$mod+Shift+Ctrl+o]]) |
 +
 +
 +^  Navigate Tab / Window / Workspace  ^^^
 +^ Context ^ Key ^ Action ^
 +| vim  | gt or gT | Navigate prev or next tab |
 +| tmux | Prefix,p or n | Previous or next window |
 +| i3   | Ctrl+Mod+ <- or -> or h or l | Change workspaces |
 +
  
 ===== Git ===== ===== Git =====
  
-[[https://fle.github.io/git-tip-keep-your-branch-clean-with-fixup-and-autosquash.html|fixup and squash]]+See [[git]] for general notes. 
 + 
 +[[https://fle.github.io/git-tip-keep-your-branch-clean-with-fixup-and-autosquash.html|fixup and squash]] for appending fixes to commits you already made.
  
   * ''git commit --fixup <commit>'': automatically marks your commit as a fix of a previous commit   * ''git commit --fixup <commit>'': automatically marks your commit as a fix of a previous commit
   * ''git rebase -i --autosquash'': automatically organize merging of these fixup commits and associated normal commits   * ''git rebase -i --autosquash'': automatically organize merging of these fixup commits and associated normal commits
  
-^ Command ^ Notes ^ +[[https://git-scm.com/docs/git-stash|stash]] for stashing your local changes away. You can ''push'' and ''pop'' stashes.
-| ''git commit --fixup <commit>'' | automatically marks your commit as a fix of a previous commit | +
-| ''git rebase -i --autosquash'' | automatically organize merging of these fixup commits and associated normal commits | +
- +
-[[https://git-scm.com/docs/git-stash|stash]]+
  
 ===== Vim ===== ===== Vim =====
  
-Autocomplete+==== Autocomplete ====
  
-Navigation+^ Command ^ Notes ^ 
 +| ''c-p'', ''c-n'' | Autocomplete Previous or Next match, Also navigate completion menu. | 
 +| ''c-y'', ''c-e'' | Accept or cancel the autocompletion | 
 +| ''c-x,c-]'', ''c-x,c-o'' | Autocomplete from tags or from Omnicomplete. Close with ''c-w,c-z'' or '':pc''
 + 
 +=== Navigation === 
 + 
 +^ Command ^ Notes ^ 
 +| ''c-e'' | Scroll down (text goes up) | 
 +| ''zz'' | Scroll current line to center. | 
 +| ''c-y'' | Scroll up (text goes down) | 
 + 
 +^ Command ^ Notes ^ 
 +| ''%%[[%%'' | Go to previous "{" on first column. ('']]'' goes to next one.) | 
 +| ''[{'' | Go to enclosing "{"
 +| '']}'' | Go to enclosing "}"
 +| ''{'' | Go to previous blank line | 
 +| ''}'' | Go to next blank line | 
 +| ''[q'', '']q'' | Quickfix window navigation | 
 +| ''c-hjkl'' | quick Window navigation | 
 +| ''\o'' | Open window in new tab (for quick fullscreen) |
learn.1656256706.txt.gz · Last modified: 2023/04/12 20:44 (external edit)