Work on the vim config, and a fix for kitty single-instance

This commit is contained in:
Daniel Flanagan 2020-11-09 22:57:12 -06:00
parent be9c1ff7a3
commit 5043f53ef1
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
2 changed files with 31 additions and 27 deletions

View file

@ -2,7 +2,7 @@ font_family Iosevka
repaint_delay 5 repaint_delay 5
input_delay 1 input_delay 1
sync_to_monitor no sync_to_monitor yes
disable_ligatures always disable_ligatures always
# font_features Iosevka Fixed SS07 Medium -liga -dlig -calt # font_features Iosevka Fixed SS07 Medium -liga -dlig -calt

View file

@ -12,27 +12,26 @@ endif
let g:indent_guide_auto_colors = 1 let g:indent_guide_auto_colors = 1
let g:indent_guides_enable_on_vim_startup = 1 let g:indent_guides_enable_on_vim_startup = 1
let g:jsonnet_fmt_on_save = 0 let g:jsonnet_fmt_on_save = 0
let g:fzf_preview_window = ['down:40%:hidden', 'ctrl-/']
call plug#begin($vimdir.'/plugged') call plug#begin($vimdir.'/plugged')
Plug 'junegunn/vim-plug' " plugin manager should manage itself Plug 'junegunn/vim-plug' " plugin manager should manage itself
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } Plug 'sheerun/vim-polyglot' " handles language-specific configuration
Plug 'junegunn/fzf.vim' " helpers for using fzf in vim Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'editorconfig/editorconfig-vim' " loads project-specific editor settings Plug 'junegunn/fzf.vim' " helpers for using fzf in vim
Plug 'tpope/vim-sleuth' " try and detect indent method Plug 'editorconfig/editorconfig-vim' " loads project-specific editor settings
Plug 'nathanaelkane/vim-indent-guides' " indentation guides Plug 'tpope/vim-sleuth' " try and detect indent method
Plug 'bkad/CamelCaseMotion' " camel case and underscore word movements Plug 'vim-scripts/LargeFile' " gracefully handle very large files
Plug 'vim-scripts/LargeFile' " gracefully handle very large files Plug 'nathanaelkane/vim-indent-guides' " indentation guides
Plug 'tpope/vim-commentary' " toggle comments in code easily Plug 'christoomey/vim-tmux-navigator' " allow window navigation to play nicely with tmux
Plug 'tpope/vim-repeat' " better vim repeating for plugin-provided actions Plug 'tpope/vim-commentary' " toggle comments in code easily
Plug 'christoomey/vim-tmux-navigator' " allow window navigation to play nicely with tmux Plug 'tpope/vim-repeat' " better vim repeating for plugin-provided actions
Plug 'machakann/vim-sandwich' " quickly modify text surrounding objects Plug 'machakann/vim-sandwich' " quickly modify text surrounding objects
Plug 'michaeljsmith/vim-indent-object' " adds an indentation level text object Plug 'michaeljsmith/vim-indent-object' " adds an indentation level text object
Plug 'wellle/targets.vim' " adds some more handy text objects Plug 'bkad/CamelCaseMotion' " camel case and underscore word movements
Plug 'junegunn/goyo.vim' " better distraction-free editing Plug 'wellle/targets.vim' " adds some more handy text objects
Plug 'tpope/vim-obsession' " even better session handling
" language-specific plugins Plug 'dhruvasagar/vim-prosession' " even better session handling
Plug 'google/vim-jsonnet', {'for': ['jsonnet', 'libsonnet']}
Plug 'calviken/vim-gdscript3', {'for': ['gdscript']}
call plug#end() call plug#end()
filetype on filetype on
@ -67,17 +66,16 @@ set t_Co=256
syntax enable syntax enable
colorscheme base16-donokai colorscheme base16-donokai
call matchadd('ColorColumn', '\%81v', 100)
hi Search cterm=NONE ctermbg=blue ctermfg=black hi Search cterm=NONE ctermbg=blue ctermfg=black
hi LineNr ctermbg=none ctermfg=8 hi LineNr ctermbg=none ctermfg=8
hi CursorLineNr ctermbg=18 ctermfg=gray hi CursorLineNr ctermbg=18 ctermfg=gray
hi IndentGuidesEven ctermbg=18 hi IndentGuidesEven ctermbg=18
hi Normal ctermbg=NONE hi Normal ctermbg=NONE
hi ColorColumn ctermbg=7 ctermfg=0 hi ColorColumn ctermbg=15 ctermfg=0
hi TooLongColorColumn ctermbg=1 ctermfg=0
" jump to last opened position in file except in git commits call matchadd('ColorColumn', '\%81v', 100)
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") && index(['gitcommit'], &ft) | exe "normal! g'\"" | endif call matchadd('TooLongColorColumn', '\%121v', 200)
command! W write command! W write
@ -88,7 +86,6 @@ nnoremap <C-p> :GitFiles<CR>
nnoremap <C-o> :Files<CR> nnoremap <C-o> :Files<CR>
nnoremap <C-u> :GFiles?<CR> nnoremap <C-u> :GFiles?<CR>
nnoremap <C-b> :Buffers<CR> nnoremap <C-b> :Buffers<CR>
au FileType fzf tnoremap <Esc> <C-c><C-c>
nnoremap <C-h> :TmuxNavigateLeft<CR> nnoremap <C-h> :TmuxNavigateLeft<CR>
nnoremap <C-j> :TmuxNavigateDown<CR> nnoremap <C-j> :TmuxNavigateDown<CR>
@ -121,13 +118,20 @@ xnoremap < <gv
xnoremap > >gv xnoremap > >gv
let mapleader = "\<Space>" let mapleader = "\<Space>"
nnoremap <silent> <leader>r :source $vimdir/init.vim<CR>:echo 'Reloaded init.vim'<CR>
nnoremap <silent> <leader>w :bd<CR> nnoremap <silent> <leader>w :bd<CR>
nnoremap <leader>h :b#<CR> nnoremap <leader>h :b#<CR>
nnoremap <leader>k :bnext<CR> nnoremap <leader>k :bnext<CR>
nnoremap <leader>j :bprevious<CR> nnoremap <leader>j :bprevious<CR>
nnoremap <silent> <leader>/ :let @/ = ""<CR>:<BACKSPACE> nnoremap <leader>/ :let @/ = ""<CR>:<BACKSPACE>
nnoremap <leader>t :split<CR>:term<CR>:resize 24<CR>:startinsert<CR> nnoremap <leader>t :split<CR>:term<CR>:resize 24<CR>:startinsert<CR>
tnoremap <C-w> <C-\><C-n>:q!<CR> tnoremap <C-w> <C-\><C-n>:q!<CR>
au BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line("$") && &ft !~# 'commit'
\ | exe "normal! g'\""
\ | endif
au FileType fzf tnoremap <Esc> <C-c><C-c>
" TODO: learn about the wildmenu `q:` " TODO: learn about the wildmenu `q:`