Skip to content

Instantly share code, notes, and snippets.

@DavidBindloss
Created April 23, 2018 04:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DavidBindloss/d617d5299fac008272d27bf1d0f4c7a9 to your computer and use it in GitHub Desktop.
Save DavidBindloss/d617d5299fac008272d27bf1d0f4c7a9 to your computer and use it in GitHub Desktop.
vimrc
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