-
-
Save DavidBindloss/d617d5299fac008272d27bf1d0f4c7a9 to your computer and use it in GitHub Desktop.
vimrc
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
syntax on | |
let mapleader = "," | |
set autochdir | |
nnoremap gf :vertical wincmd f<CR> | |
nnoremap gb :ls<CR>:b<Space> | |
" map for replacing lines and yanking underneath | |
nnoremap <leader>rly <S-p>jddk | |
nnoremap <leader>ry o<ESC>kddj | |
set noexpandtab | |
set shiftwidth=2 | |
set tabstop=2 | |
set number relativenumber | |
" Status Line { | |
set laststatus=2 " always show statusbar | |
set statusline= | |
set statusline+=%-10.3n\ " buffer number | |
set statusline+=%f\ " filename | |
set statusline+=%h%m%r%w " status flags | |
set statusline+=\[%{strlen(&ft)?&ft:'none'}] " file type | |
set statusline+=%= " right align remainder | |
set statusline+=0x%-8B " character value | |
set statusline+=%-14(%l,%c%V%) " line, character | |
set statusline+=%<%P " file position | |
"} | |
set colorcolumn=80 | |
set wildmenu | |
set wildignore+=*.bmp,*.gif,*.ico,*.jpg,*.png | |
set wildignore+=*.pdf,*.psd | |
set wildignore+=node_modules/* | |
set wildmode=longest:list,full | |
augroup configgroup | |
au FileType make set noexpandtab | |
augroup END | |
" Add this to your vimrc to get a minimalist autocomplete pop | |
" Or use as a plugin : https://github.com/maxboisvert/vim-simple-complete | |
" Minimalist-TabComplete-Plugin | |
inoremap <expr> <Tab> TabComplete() | |
fun! TabComplete() | |
if getline('.')[col('.') - 2] =~ '\K' || pumvisible() | |
return "\<C-P>" | |
else | |
return "\<Tab>" | |
endif | |
endfun | |
" Minimalist-AutoCompletePop-Plugin | |
set completeopt=menu,menuone,noinsert | |
inoremap <expr> <CR> pumvisible() ? "\<C-Y>" : "\<CR>" | |
autocmd InsertCharPre * call AutoComplete() | |
fun! AutoComplete() | |
if v:char =~ '\K' | |
\ && getline('.')[col('.') - 4] !~ '\K' | |
\ && getline('.')[col('.') - 3] =~ '\K' | |
\ && getline('.')[col('.') - 2] =~ '\K' " last char | |
\ && getline('.')[col('.') - 1] !~ '\K' | |
call feedkeys("\<C-P>", 'n') | |
end | |
endfun |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment