Sfoglia il codice sorgente

Add `:DiffOrig`, change tmux pane cutting

`:DiffOrig` is a useful for seeing changes for an as-yet-unsaved file
(taken from example vimrc). Tmux has to give up <C-\>, as we want it for
neovim's `:terminal`.
Weiyi Lou 10 anni fa
parent
commit
70721be638
3 ha cambiato i file con 10 aggiunte e 4 eliminazioni
  1. 2 2
      README.md
  2. 2 2
      tmux/tmux.conf
  3. 6 0
      vim/settings/version_control.vim

+ 2 - 2
README.md

@@ -84,8 +84,8 @@ Enjoy the amount of time wasted on tweaking a setup :D
  - `Prefix + vi motion` moves around panes.
  - `PrefixHold + vi motion` moves around windows.
  - `Alt/Meta + number` moves to window number (1-10).
- - `Ctrl-minus` cuts a pane horizontally (think `-`),
- - `Ctrl-\` cuts a pane vertically (think `|`).
+ - `Prefix + -` cuts a pane horizontally,
+ - `Prefix + \` cuts a pane vertically (think `|`).
  - `Prefix + s` starts synchronized panes.
  - `PrefixHold + s` swaps between sessions.
  - Mouse support works to select/resize panes/windows.

+ 2 - 2
tmux/tmux.conf

@@ -82,8 +82,8 @@ bind-key l select-pane -R
 
 # Pane Creation/Destruction.
 unbind-key % # Remove default binding for horizontal split since we’re replacing it.
-bind-key -n C-\ split-window -h
-bind-key -n C-_ split-window -v
+bind-key \ split-window -h
+bind-key - split-window -v
 bind-key C-x kill-pane
 
 # Pane Sychronisation.

+ 6 - 0
vim/settings/version_control.vim

@@ -20,3 +20,9 @@ nnoremap <silent> <Leader>gap :Git add -p<CR>
 nnoremap <silent> <Leader>gs :Gstatus<CR>
 nnoremap <silent> <Leader>gd :Gdiff<CR>
 nnoremap <silent> <Leader>gb :Gblame<CR>
+
+" Get what's changed in an as-yet-unsaved file
+if !exists(':DiffOrig')
+  command DiffOrig vert new | set buftype=nofile | read ++edit # | 0d_
+      \ | diffthis | wincmd p | diffthis
+endif