From 5767c3fea29f74b180342d8898c06a9719797459 Mon Sep 17 00:00:00 2001 From: Adam Lamers Date: Sun, 12 Nov 2023 17:40:18 -0500 Subject: [PATCH] new plugins --- vimrc | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 60 insertions(+), 8 deletions(-) diff --git a/vimrc b/vimrc index aec79ad..3ff329c 100644 --- a/vimrc +++ b/vimrc @@ -1,23 +1,25 @@ " General settings +set belloff=all set nocompatible -filetype off set hidden set backspace=eol,start,indent set nu set ignorecase +set laststatus=2 + +filetype off filetype plugin indent on "Space as leader -nmap nnoremap let mapleader="\" let g:mapleader="\" "Buffer navigation -nnoremap [b :bp -nnoremap ]b :bn -nnoremap c :bd -nnoremap C :bd! +nnoremap [b :bprev +nnoremap ]b :bnext +nnoremap c :bprev\|bdelete # +nnoremap C :bdelete! nnoremap f :echo expand('%:p') " Window navigation @@ -78,12 +80,22 @@ Plug 'neoclide/vim-jsx-improve' Plug 'leafgarland/typescript-vim' Plug 'peitalin/vim-jsx-typescript' Plug 'ojroques/vim-oscyank', {'branch': 'main'} +Plug 'ap/vim-buftabline' +Plug 'adamlamers/terminal-drawer.vim' call plug#end() "Colorscheme colorscheme gruvbox-material "Coc Config + +" Use to trigger completion +if has('nvim') + inoremap coc#refresh() +else + inoremap coc#refresh() +endif + function! ShowDocumentation() if CocAction('hasProvider', 'hover') call CocActionAsync('doHover') @@ -92,6 +104,11 @@ function! ShowDocumentation() endif endfunction +function! CheckBackspace() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' +endfunction + nmap d (coc-definition) nmap rn (coc-rename) nmap gd (coc-definition) @@ -99,10 +116,28 @@ nmap gy (coc-type-definition) nmap gi (coc-implementation) nmap gr (coc-references) imap (coc-snippets-expand) + +" Suggestion navigation inoremap coc#refresh() -inoremap coc#pum#visible() ? coc#pum#confirm() : +inoremap coc#pum#visible() ? coc#_select_confirm() : "\" +inoremap coc#pum#visible() ? coc#_select_confirm() : "\" nnoremap K :call ShowDocumentation() +" Popup scrolling +nnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" +nnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" +inoremap coc#float#has_scroll() ? "\=coc#float#scroll(1)\" : "\" +inoremap coc#float#has_scroll() ? "\=coc#float#scroll(0)\" : "\" +vnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" +vnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" + +" Symbol renaming +nmap rn (coc-rename) + +" Formatting selected code +xmap = (coc-format-selected) +nmap = (coc-format-selected) + let g:coc_disable_transparent_cursor=1 "SimpylFold Config @@ -110,11 +145,12 @@ let g:SimpylFold_docstring_preview=1 "NERDTree keybinds nmap g :NERDTreeFind -nmap e :NERDTreeFocus +nmap e :NERDTreeToggle let NERDTreeIgnore = ['__pycache__', '\.pyc$', '\.egg-info$', 'node_modules'] "CtrlP config nmap :CtrlPBuffer +nmap :CtrlP let g:ctrlp_working_path_mode= 0 let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git\|\.egg-info|\.pyc' @@ -128,3 +164,19 @@ set wildignore+=*/node_modules/*,*/__pycache__/*,*.pyc,*.egg-info "OSCYank settings autocmd TextYankPost * if v:event.operator is 'y' && v:event.regname is 'a' | execute 'OSCYankReg a' | endif +nnoremap yf :call OSCYank(expand('%:p')) + +"Lightline settings +let g:lightline = { + \ 'colorscheme': 'wombat', + \ 'active': { + \ 'left': [ [ 'mode', 'paste' ], + \ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ] + \ }, + \ 'component_function': { + \ 'gitbranch': 'FugitiveHead' + \ }, + \ } + +" Terminal drawer options +let g:terminal_drawer_start_nobuflisted = 1