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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
set number
set tabstop=4
set softtabstop=4
set shiftwidth=4
set clipboard^=unnamed,unnamedplus
set path+=**
set nohlsearch
set list
set listchars=tab:\|\ ,trail:.
set exrc
set secure
xnoremap "+y y:call system("wl-copy", @")<cr>
nnoremap "+p :let @"=substitute(system("wl-paste --no-newline"), '<C-v><C-m>', '', 'g')<cr>p
nnoremap "*p :let @"=substitute(system("wl-paste --no-newline --primary"), '<C-v><C-m>', '', 'g')<cr>p
nnoremap <leader>cd :cd %:p:h<CR>:pwd<CR>
let g:netrw_banner = 0
let g:netrw_liststyle = 3
let g:netrw_browse_split = 4
let g:netrw_altv = 1
let g:netrw_winsize = 15
augroup fileExplore
" If you pass in a file with vim, use v(ertical)explore. Otherwise,
" fullscreen explore.
autocmd!
au VimEnter * if eval("@%") == "" | :Explore | elseif eval("@%") != "" | :Vexplore| endif
" By default, load into the editor (not explorer) if a file is passed.
au VimEnter * :wincmd l
augroup END
" dynamic line numbers
" insert: absolute numbers; normal: relative numbers
:augroup numbertoggle
: autocmd!
: autocmd BufEnter,FocusGained,InsertLeave,WinEnter * if &nu && mode() != "i" | set rnu | endif
: autocmd BufLeave,FocusLost,InsertEnter,WinLeave * if &nu | set nornu | endif
:augroup END
syntax on
cnoremap sudow w !sudo tee % >/dev/null
" vim-plug
call plug#begin('~/.vim/plugged')
Plug 'ap/vim-css-color'
Plug 'junegunn/vim-easy-align'
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-vinegar'
Plug 'junegunn/goyo.vim'
Plug 'xuhdev/vim-latex-live-preview', { 'for': 'tex' }
call plug#end()
function! s:goyo_enter()
if executable('tmux') && strlen($TMUX)
silent !tmux set status off
silent !tmux list-panes -F '\#F' | grep -q Z || tmux resize-pane -Z
endif
set noshowmode
set noshowcmd
set scrolloff=999
set linebreak
set wrap
set spell spelllang=en_us
Limelight
" ...
endfunction
|