Reconciled differences btwn win and linux vimrcs
This commit is contained in:
parent
1a80cf1c15
commit
d4593cea51
2 changed files with 128 additions and 50 deletions
172
vim/.vimrc
172
vim/.vimrc
|
|
@ -29,17 +29,17 @@
|
|||
" Plug 'kovisoft/paredit'
|
||||
Plug 'sainnhe/vim-color-forest-night'
|
||||
Plug 'justinmk/vim-sneak'
|
||||
Plug 'christoomey/vim-tmux-navigator'
|
||||
Plug 'ap/vim-css-color'
|
||||
Plug 'dylanaraps/wal.vim'
|
||||
Plug 'sjl/tslime.vim'
|
||||
" TODO setup
|
||||
Plug 'roxma/vim-tmux-clipboard'
|
||||
" TODO setup
|
||||
Plug 'melonmanchan/vim-tmux-resizer'
|
||||
" Plug 'roman/golden-ratio'
|
||||
Plug 'axvr/zepl.vim'
|
||||
Plug 'kovisoft/slimv'
|
||||
|
||||
Plug 'tpope/vim-vinegar'
|
||||
Plug 'preservim/nerdtree'
|
||||
Plug 'vimwiki/vimwiki'
|
||||
Plug 'simnalamburt/vim-mundo'
|
||||
Plug 'tpope/vim-dadbod'
|
||||
Plug 'junegunn/gv.vim'
|
||||
Plug 'rbong/vim-flog'
|
||||
Plug 'tpope/vim-unimpaired'
|
||||
|
||||
" Todo:
|
||||
" GV
|
||||
" Gundo (or undotree?)
|
||||
|
|
@ -60,7 +60,6 @@
|
|||
"}}}
|
||||
|
||||
" appearance {{{
|
||||
|
||||
colorscheme zenburn
|
||||
" colorscheme wal
|
||||
syntax on " Enable syntax
|
||||
|
|
@ -78,9 +77,16 @@
|
|||
hi CursorLineNr cterm=bold
|
||||
|
||||
" Lightline
|
||||
let g:lightline = { 'colorscheme': 'sceaduhelm', }
|
||||
let g:lightline = { 'colorscheme': 'sceaduhelm' }
|
||||
set fillchars+=vert:│
|
||||
|
||||
command! LightlineReload call LightlineReload()
|
||||
|
||||
function! LightlineReload()
|
||||
call lightline#init()
|
||||
call lightline#colorscheme()
|
||||
call lightline#update()
|
||||
endfunction
|
||||
" }}}
|
||||
|
||||
" Movement {{{
|
||||
|
|
@ -107,12 +113,12 @@
|
|||
set updatetime=100 " Make updates happen faster (gitgutter)
|
||||
set splitright " Make split to right by default
|
||||
set winheight=30 " Soft minimum window height (active)
|
||||
set winminheight=10 " Hard minimum window height (inactive)
|
||||
set winwidth=80 " Window width for current window
|
||||
"set winminheight=10 " Hard minimum window height (inactive)
|
||||
set winwidth=85 " Window width for current window
|
||||
set winminwidth=30 " Hard minimum for window width
|
||||
set timeoutlen=1000
|
||||
set ttimeoutlen=0
|
||||
|
||||
set t_vb= " No visual bell ever
|
||||
let g:sneak#use_ic_scs=1
|
||||
set virtualedit=block
|
||||
"}}}
|
||||
|
||||
" searching {{{
|
||||
|
|
@ -125,10 +131,6 @@
|
|||
" Nnoremap <tab> %
|
||||
" Vnoremap <tab> %
|
||||
" Remap tab to jump by window
|
||||
nnoremap <tab> :tabn<CR>
|
||||
vnoremap <tab> :tabn<CR>
|
||||
nnoremap <S-tab> :tabp<CR>
|
||||
vnoremap <S-tab> :tabp<CR>
|
||||
|
||||
"}}}
|
||||
|
||||
|
|
@ -151,10 +153,10 @@
|
|||
"}}}
|
||||
|
||||
" long line handling {{{
|
||||
set textwidth=79
|
||||
set fo=t
|
||||
" set textwidth=79
|
||||
" set fo=t
|
||||
" set colorcolumn=85
|
||||
"
|
||||
|
||||
"}}}
|
||||
|
||||
" leaders {{{
|
||||
|
|
@ -198,7 +200,7 @@
|
|||
nnoremap k gk
|
||||
|
||||
"}}}
|
||||
"
|
||||
|
||||
" slimv{{{
|
||||
let g:slimv_repl_split=2
|
||||
let g:slimv_repl_split_size=10
|
||||
|
|
@ -208,7 +210,7 @@
|
|||
" split pane navigation {{{
|
||||
" Map vertical split to \ w, switch to it, open explorer, prompt for filename
|
||||
" TODO: make new window prompt use fzf
|
||||
nnoremap <leader>w <C-w>v<C-w>l:e <C-S-d><BS><BS>open
|
||||
" nnoremap <leader>w <C-w>v<C-w>l:e <C-S-d><BS><BS>open
|
||||
" Switch panes wit ctrl + h/j/k/l
|
||||
nnoremap <C-h> <C-w>h
|
||||
nnoremap <C-j> <C-w>j
|
||||
|
|
@ -216,11 +218,16 @@
|
|||
nnoremap <C-l> <C-w>l
|
||||
nnoremap <C-c> :close <cr>
|
||||
nnoremap <C-n> :bn <cr>
|
||||
nnoremap <C-x> :bd <cr>
|
||||
" Map resize pane
|
||||
" Term mode
|
||||
tnoremap <C-h> <C-w>h
|
||||
tnoremap <C-j> <C-w>j
|
||||
tnoremap <C-k> <C-w>k
|
||||
tnoremap <C-l> <C-w>l
|
||||
tnoremap <C-c> :close <cr>
|
||||
tnoremap <C-n> :bn <cr>
|
||||
tnoremap <Esc> <C-\><C-n>
|
||||
|
||||
" TODO: remap pane resize to something else (leader?)
|
||||
map + :vertical resize +5<CR>
|
||||
map - :vertical resize -5<CR>
|
||||
" quick-scope
|
||||
" Trigger a highlight in the appropriate direction when pressing these keys:
|
||||
let g:qs_highlight_on_keys = ['f', 'F', 't', 'T']
|
||||
|
|
@ -231,10 +238,7 @@
|
|||
autocmd ColorScheme * highlight QuickScopeSecondary guifg='#5fffff' gui=underline ctermfg=81 cterm=underline
|
||||
augroup END
|
||||
|
||||
"}}}
|
||||
|
||||
" launch love game, check youtube love2d roguelike+rpg day 1 if broken {{{
|
||||
" map ,t :! /Applications/love.app/Contents/MacOS/love . <CR>
|
||||
nnoremap <c-s> gt
|
||||
|
||||
"}}}
|
||||
|
||||
|
|
@ -298,7 +302,7 @@
|
|||
nmap ga <Plug>(EasyAlign)
|
||||
|
||||
"}}}
|
||||
"
|
||||
|
||||
" git commands {{{
|
||||
" TODO: map fugitive commands
|
||||
" TODO: check out gv etc
|
||||
|
|
@ -312,23 +316,93 @@
|
|||
set diffopt=vertical
|
||||
"}}}
|
||||
|
||||
" plugin modification {{{
|
||||
"
|
||||
" fold search {{{
|
||||
|
||||
" command to fold everything except what you searched for
|
||||
command! -nargs=* Fs
|
||||
\ if <q-args> != '' |
|
||||
\ exe "normal /".<q-args>."\<CR>" |
|
||||
\ endif |
|
||||
\ if @/ != '' |
|
||||
\ setlocal
|
||||
\ foldexpr=FoldRegex(v:lnum,@/,2)
|
||||
\ foldmethod=expr
|
||||
\ foldlevel=0 |
|
||||
\ endif
|
||||
|
||||
function! FoldRegex(lnum,pat,context)
|
||||
" get start/end positions for context lines
|
||||
let startline=a:lnum-a:context
|
||||
while startline < 1
|
||||
let startline+=1
|
||||
endwhile
|
||||
let endline=a:lnum+a:context
|
||||
while endline > line('$')
|
||||
let endline-=1
|
||||
endwhile
|
||||
|
||||
let returnval = 2
|
||||
|
||||
let pos=getpos('.')
|
||||
|
||||
" search from current line to get matches ON the line
|
||||
call cursor(a:lnum, 1)
|
||||
let matchline=search(a:pat,'cW',endline)
|
||||
if matchline==a:lnum
|
||||
let returnval = 0
|
||||
elseif matchline > 0
|
||||
" if current line didn't match, there could have been a match within
|
||||
" trailing context lines
|
||||
let returnval = 1
|
||||
else
|
||||
" if no match at current line, search leading context lines for a match
|
||||
call cursor(startline, 1)
|
||||
let matchline=search(a:pat,'cW',a:lnum)
|
||||
if matchline > 0
|
||||
let returnval = 1
|
||||
endif
|
||||
endif
|
||||
|
||||
call setpos('.',pos)
|
||||
|
||||
return returnval
|
||||
endfun
|
||||
|
||||
" }}}
|
||||
|
||||
" copy matches {{{
|
||||
|
||||
function! CopyMatches(reg)
|
||||
let hits = []
|
||||
%s//\=len(add(hits, submatch(0))) ? submatch(0) : ''/gne
|
||||
let reg = empty(a:reg) ? '+' : a:reg
|
||||
execute 'let @'.reg.' = join(hits, "\n") . "\n"'
|
||||
endfunction
|
||||
command! -register CopyMatches call CopyMatches(<q-reg>)
|
||||
|
||||
" }}}
|
||||
|
||||
" vimrc {{{
|
||||
" source $MYVIMRC reloads the saved $MYVIMRC
|
||||
:nmap <Leader>s :source $MYVIMRC
|
||||
|
||||
" opens $MYVIMRC for editing, or use :tabedit $MYVIMRC
|
||||
:nmap <Leader>v :e $MYVIMRC
|
||||
"}}}
|
||||
|
||||
" gvim {{{
|
||||
set guioptions=Ace
|
||||
|
||||
"}}}
|
||||
|
||||
" tmux {{{
|
||||
" tslime
|
||||
let g:tslime_ensure_trailing_newlines = 1
|
||||
let g:tslime_ensure_trailing_newlines = 1
|
||||
let g:tslime_normal_mapping = '<leader>t'
|
||||
let g:tslime_visual_mapping = '<leader>t'
|
||||
let g:tslime_vars_mapping = '<leader>T'
|
||||
|
||||
" zepl {{{
|
||||
augroup zepl
|
||||
autocmd!
|
||||
autocmd FileType python let b:repl_config = { 'cmd': 'python3' }
|
||||
autocmd FileType javascript let b:repl_config = { 'cmd': 'python3' }
|
||||
autocmd FileType clojure let b:repl_config = { 'cmd': 'clj' }
|
||||
autocmd FileType scheme let b:repl_config = { 'cmd': 'rlwrap csi' }
|
||||
autocmd FileType lisp let b:repl_config = { 'cmd': 'sbcl' }
|
||||
autocmd FileType julia let b:repl_config = { 'cmd': 'julia' }
|
||||
" autocmd FileType cs let b:repl_config = { 'cmd': '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat"' }
|
||||
autocmd FileType cs let b:repl_config = { 'cmd': 'cmd' }
|
||||
augroup END
|
||||
"}}}
|
||||
|
||||
" TODO: rebind c-n
|
||||
|
|
|
|||
|
|
@ -174,6 +174,7 @@
|
|||
nnoremap <leader>d k :r !date <cr>
|
||||
|
||||
nnoremap <leader>k :vert new ~/.vim/bindings.md <cr>
|
||||
tnoremap <leader><esc> <C-\><C-n>
|
||||
|
||||
"}}}
|
||||
|
||||
|
|
@ -313,7 +314,8 @@
|
|||
nmap ghn <Plug>(GitGutterNextHunk)
|
||||
nmap ghp <Plug>(GitGutterPrevHunk)
|
||||
nmap ghf <Plug>(GitGutterFold)
|
||||
|
||||
" Controls fugitive diff split direction
|
||||
set diffopt=vertical
|
||||
"}}}
|
||||
|
||||
" fold search {{{
|
||||
|
|
@ -412,6 +414,8 @@ command! -register CopyMatches call CopyMatches(<q-reg>)
|
|||
augroup END
|
||||
"}}}
|
||||
|
||||
" TODO: rebind c-n
|
||||
" TODO: change ,k to ,n and add notes to version control
|
||||
|
||||
" folding options, this must be last in file
|
||||
" vim:foldmethod=marker:foldlevel=0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue