Skip to content

Instantly share code, notes, and snippets.

@mrprofessor
Created July 24, 2019 20:58
Show Gist options
  • Save mrprofessor/f07a783e407bb43e6fc33e8679c93566 to your computer and use it in GitHub Desktop.
Save mrprofessor/f07a783e407bb43e6fc33e8679c93566 to your computer and use it in GitHub Desktop.
neovim dotfile with plug
"
" ███████████████████████████
" ███████▀▀▀░░░░░░░▀▀▀███████
" ████▀░░░░░░░░░░░░░░░░░▀████
" ███│░░░░░░░░░░░░░░░░░░░│███
" ██▌│░░░░░░░░░░░░░░░░░░░│▐██
" ██░└┐░░░░░░░░░░░░░░░░░┌┘░██
" ██░░└┐░░░░░░░░░░░░░░░┌┘░░██
" ██░░┌┘▄▄▄▄▄░░░░░▄▄▄▄▄└┐░░██
" ██▌░│██████▌░░░▐██████│░▐██
" ███░│▐███▀▀░░▄░░▀▀███▌│░███
" ██▀─┘░░░░░░░▐█▌░░░░░░░└─▀██
" ██▄░░░▄▄▄▓░░▀█▀░░▓▄▄▄░░░▄██
" ████▄─┘██▌░░░░░░░▐██└─▄████
" █████░░▐█─┬┬┬┬┬┬┬─█▌░░█████
" ████▌░░░▀┬┼┼┼┼┼┼┼┬▀░░░▐████
" █████▄░░░└┴┴┴┴┴┴┴┘░░░▄█████
" ███████▄░░░░░░░░░░░▄███████
" ██████████▄▄▄▄▄▄▄██████████
" ███████████████████████████
"
" You are about to experience a potent dosage of Vim. Watch your steps.
"
" ╔══════════════════════════════════════════╗
" ║ ⎋ HERE BE VIMPIRES ⎋ ║
" ╚══════════════════════════════════════════╝
" This config works for both vim and nvim.
set nocompatible " Disable compatibility to old-time vi
set showmatch " Show matching brackets.
set ignorecase " Do case insensitive matching
set mouse=v " middle-click paste with mouse
set hlsearch " highlight search results
set tabstop=2 " number of columns occupied by a tab character
set softtabstop=2 " see multiple spaces as tabstops so <BS> does the right thing
set expandtab " converts tabs to white space
set shiftwidth=2 " width for autoindents
set autoindent " indent a new line the same amount as the line just typed
set number " add line numbers
set wildmode=longest,list " get bash-like tab completions
set cc=80 " set an 80 column border for good coding style
set clipboard=unnamed " This makes yanking work with default Terminal
set shell=/bin/zsh " set default shell to zsh
set splitbelow " default horizontal split below
set splitright " default vertical split right
set cursorline
" set mouse=a " mouse support on
set guioptions= " remove both side scrollbars from macvim
set shell=git
" Ture color for neovim
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
" PEP 8(python 3)
au BufNewFile,BufRead *.py
\ set tabstop=4
\ softtabstop=4
\ shiftwidth=4
\ textwidth=79
\ expandtab
\ autoindent
\ fileformat=unix
" Font for macvim
set guifont=Operator\ Mono\ Medium\ Nerd\ Font\ Complete:h16
" To use fzf in Vim
set rtp+=/usr/local/opt/fzf
" toggle spelling
nnoremap <leader>s :set invspell<CR>
" set the runtime path to include Vundle and initialize
" set rtp+=~/.vim/bundle/Vundle.vim
" call vundle#begin('~/.vim/bundle')
" set rtp+=$HOME/.vim/bundle/Vundle.vim/
" call vundle#begin('$HOME/.vim/bundle/')
call plug#begin('~/AppData/Local/nvim/plugged')
" let Vundle manage Vundle, required
" Plug 'VundleVim/Vundle.vim'
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'
Plug 'zivyangll/git-blame.vim'
Plug 'w0rp/ale'
Plug 'tpope/vim-surround'
Plug 'mhinz/vim-startify'
Plug 'prettier/vim-prettier'
Plug 'mxw/vim-jsx'
Plug 'mattn/emmet-vim'
Plug 'pangloss/vim-javascript'
Plug 'leafgarland/typescript-vim'
Plug 'Quramy/tsuquyomi'
Plug 'kchmck/vim-coffee-script'
Plug 'scrooloose/nerdcommenter'
Plug 'JamshedVesuna/vim-markdown-preview'
Plug 'godlygeek/tabular'
Plug 'plasticboy/vim-markdown'
Plug 'cakebaker/scss-syntax.vim'
Plug 'gorodinskiy/vim-coloresque'
Plug 'vim-scripts/indentpython.vim'
Plug 'vim-syntastic/syntastic'
Plug 'nvie/vim-flake8'
Plug 'rizzatti/dash.vim'
Plug 'python-mode/python-mode', { 'for': 'python', 'branch': 'develop' }
" Colors
Plug 'NLKNguyen/papercolor-theme'
Plug 'joshdick/onedark.vim'
Plug 'ayu-theme/ayu-vim'
Plug 'sonph/onehalf', {'rtp': 'vim/'}
Plug 'morhetz/gruvbox'
Plug 'rakr/vim-one'
Plug 'dracula/vim'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'liuchengxu/space-vim-dark'
" Devicons
Plug 'ryanoasis/vim-devicons'
" Search and file browser
Plug 'mileszs/ack.vim'
Plug 'kien/ctrlp.vim'
Plug 'scrooloose/nerdtree'
Plug 'takac/vim-hardtime'
" Games
Plug 'johngrib/vim-game-snake'
" Auto completion
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
call plug#end()
" call vundle#end()
filetype plugin indent on " allows auto-indenting depending on file type
" Color scheme after vim-colorschemes are loaded
" Dark themes: onedark, ayu(dark)
" Light themes: peachpuff, PaperColor, ayu(light)
" set termguicolors
" Color onehalflight
"colo onehalfdark
" Color one
"colorscheme one
"set background=light
" Color papercolor
"set background=light
"colorscheme PaperColor
"let g:PaperColor_Theme_Options = {
"\ 'theme': {
"\ 'allow_italic': 1
"\ }
"\ }
" Color space-vim-dark
"colo space-vim-dark
"set termguicolors
"hi LineNr ctermbg=NONE guibg=NONE
"hi Comment cterm=italic
" Python specific
"hi pythonSelf ctermfg=68 guifg=#5f87d7 cterm=bold gui=bold
" Range: 233 (darkest) ~ 238 (lightest)
" Default: 235
"let g:space_vim_dark_background = 234
" /Favourites "
" Color onedark "
colo onedark
let g:onedark_terminal_italics=1
" Color gruvvox "
"let g:gruvbox_italic=1
"colo gruvbox
"set background=dark " Setting dark mode
"let g:gruvbox_contrast_dark='medium'
" Airline stuff
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#left_sep = ' '
let g:airline#extensions#tabline#left_alt_sep = '|'
"let g:airline_powerline_fonts = 1
"let g:airline_theme='gruvbox'
"let g:airline_theme='onedark'
"let g:airline_theme='papercolor'
" Git stuff
set diffopt+=vertical
" Vim hardtime
" let g:hardtime_default_on = 1
" Markdown
let g:vim_markdown_folding_disabled = 1
let vim_markdown_preview_browser='Google Chrome'
let vim_markdown_preview_hotkey='<C-m>'
" Ale fixers
" let g:ale_fixers = ['prettier', 'eslint']
" let g:ale_lint_on_save = 1
" let g:ale_linters = {
" \ 'javascript': ['prettier', 'eslint']
" \}
let g:ale_fixers = {
\ 'javascript': ['prettier', 'eslint']
\ }
" let g:ale_fix_on_save = 1
" Less aggressive than the default '>>'
" let g:ale_sign_error = '●'
nmap <leader>d <Plug>(ale_fix)
" Use deoplete.
let g:deoplete#enable_at_startup = 1
" Map keys
nmap <leader>l :nohl<CR>
nmap <leader>s :GitBlame<CR>
nmap <leader>n :NERDTreeToggle<CR>
nmap <leader>f :NERDTreeFind<CR>
nmap <F5> :10split term://zsh<CR>
" Ignore some folders and files for CtrlP indexing
let g:ctrlp_custom_ignore = {
\ 'dir': '\.git$\|\.yardoc\|node_modules\|log\|tmp$',
\ 'file': '\.so$\|\.dat$|\.DS_Store$'
\ }
"" Match tag always setup
let g:mta_filetypes = {
\ 'html' : 1,
\ 'xhtml' : 1,
\ 'xml' : 1,
\ 'jinja' : 1,
\ 'jsx' : 1
\}
"" Hybrid numbers
"augroup numbertoggle
"autocmd!
"autocmd BufEnter,FocusGained,InsertLeave,WinEnter * if &nu | set rnu | endif
"autocmd BufLeave,FocusLost,InsertEnter,WinLeave * if &nu | set nornu | endif
"augroup END
" Quicker window movement
nmap <C-j> <C-w>j
nmap <C-k> <C-w>k
nmap <C-h> <C-w>h
nmap <C-l> <C-w>l
" Quicker tab movement
nmap <S-l> gt
nmap <S-h> gT
nmap <silent> <leader>o :!open %<CR>
" Python syntax support!
let python_highlight_all=1
syntax on
let g:pymode_python = 'python3'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment