Last active
July 3, 2021 18:28
-
-
Save davidclevenger/a350d3e89c1a1bd0c78b2a70e8c40e20 to your computer and use it in GitHub Desktop.
Vim config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" .vimrc - David Clevenger | |
" plugins (vim-plug) | |
call plug#begin('~/.vim/plugged') | |
Plug 'scrooloose/nerdtree' | |
Plug 'vim-airline/vim-airline' | |
Plug 'neoclide/coc.nvim' | |
Plug 'junegunn/fzf' | |
Plug 'morhetz/gruvbox' | |
call plug#end() | |
" general configuration | |
let mapleader = " " " `space` is the leader | |
set number | |
set splitright | |
" plugin configuration | |
map <leader>f :FZF<CR> | |
map <leader>t :NERDTree<CR> | |
let NERDTreeMapOpenInTab='<ENTER>' | |
let NERDTreeQuitOnOpen=1 | |
function! StartUp() | |
if 0 == argc() | |
NERDTree | |
end | |
endfunction | |
autocmd VimEnter * call StartUp() | |
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>" | |
" use <tab> for trigger completion and navigate to the next complete item | |
function! s:check_back_space() abort | |
let col = col('.') - 1 | |
return !col || getline('.')[col - 1] =~ '\s' | |
endfunction | |
inoremap <silent><expr> <Tab> | |
\ pumvisible() ? "\<C-n>" : | |
\ <SID>check_back_space() ? "\<Tab>" : | |
\ coc#refresh() | |
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>" | |
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment