-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprivate_dot_vimrc
More file actions
37 lines (32 loc) · 1.43 KB
/
Copy pathprivate_dot_vimrc
File metadata and controls
37 lines (32 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
" Enable relative line numbers
set relativenumber
set number
" Install vim-plug if not already installed
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
" Plugins
call plug#begin()
Plug 'tpope/vim-commentary'
call plug#end()
" VSCode-style comment toggle with Ctrl+/
" Note: In most terminals, Ctrl+/ is sent as Ctrl+_
nnoremap <C-_> :Commentary<CR>
vnoremap <C-_> :Commentary<CR>
inoremap <C-_> <Esc>:Commentary<CR>a
" Open a herdr scrollback dump at the bottom
"
" herdr's F5 writes the pane scrollback to /tmp/herdr-scrollback-*.txt and runs
" `${EDITOR:-vi} <file>` with no `+<line>`, so it opens on line 1 rather than at
" the output that was on screen. Zellij opened near the bottom; this restores
" that. The Neovim config carries the same autocmd, with the full reasoning.
" A dump is a grid, as wide as the pane was, so give the text every column back:
" with `number` and `wrap` on, each full-width row folds onto a second display
" line and the buffer reads as garbage.
augroup herdr_scrollback
autocmd!
autocmd BufWinEnter *herdr-scrollback-* setlocal nowrap nonumber norelativenumber nospell signcolumn=no
autocmd BufWinEnter *herdr-scrollback-* normal! G
augroup END