Skip to content

Instantly share code, notes, and snippets.

@craigjmidwinter
Last active August 15, 2019 19:45
Show Gist options
  • Save craigjmidwinter/69ec04539dcf5b1487715f6eae6a68c8 to your computer and use it in GitHub Desktop.
Save craigjmidwinter/69ec04539dcf5b1487715f6eae6a68c8 to your computer and use it in GitHub Desktop.
Actually, this is my ~/.config/nvim/init.vim which gets sourced in my .vimrc
if empty(glob('~/.config/nvim/autoload/pathogen.vim'))
silent !curl -LSso ~/.config/nvim/autoload/pathogen.vim --create-dirs
\ https://tpo.pe/pathogen.vim
endif
if empty(glob('~/.config/nvim/autoload/plug.vim'))
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
if &shell =~# 'fish$'
set shell=sh
endif
call plug#begin('~/.config/nvim/plugged')
Plug 'scrooloose/nerdcommenter'
Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx'
Plug 'rking/ag.vim'
Plug 'ap/vim-css-color'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'w0rp/ale'
Plug 'kien/ctrlp.vim'
Plug 'ternjs/tern_for_vim', { 'do' : 'npm install'}
Plug 'https://gitlab.com/rj-white/vim-colors-paramountblue'
Plug 'airblade/vim-gitgutter'
Plug 'editorconfig/editorconfig-vim'
Plug 'tpope/vim-fugitive'
Plug 'neoclide/coc.nvim', {'tag': '*', 'do': './install.sh'}
Plug 'SirVer/ultisnips'
Plug 'letientai299/vim-react-snippets', { 'branch': 'es6' }
Plug 'dag/vim-fish'
Plug 'vim-scripts/fountain.vim'
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'cakebaker/scss-syntax.vim'
call plug#end()
execute pathogen#infect()
let mapleader="\\"
map <C-n> :e.<CR>
" Make J and K nav go by visual line
nnoremap <expr> j v:count ? (v:count > 5 ? "m'" . v:count : '') . 'j' : 'gj'
nnoremap <expr> k v:count ? (v:count > 5 ? "m'" . v:count : '') . 'k' : 'gk'
set hidden
set hlsearch "" Highlight all search results
set smartcase "" Enable smart-case search
set ignorecase "" Always case-insensitive
set incsearch "" Searches for strings incrementally
set softtabstop=4 shiftwidth=4 tabstop=4 expandtab "" use 4 spaces
set t_Co=256
set background=dark
:colorscheme paramountblue
" automatically leave insert mode after 'updatetime' milliseconds of inaction
set updatetime=5000
au CursorHoldI * stopinsert
"""
""" Line Numbers
"""
:set number relativenumber
:augroup numbertoggle
: autocmd!
: autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
: autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
:augroup END
"""
""" Fish
"""
syntax enable
filetype plugin indent on
" Set up :make to use fish for syntax checking.
autocmd FileType fish compiler fish
" Set this to have long lines wrap inside comments.
autocmd FileType fish setlocal textwidth=79
" Enable folding of block structures in fish.
autocmd FileType fish setlocal foldmethod=expr
"""
""" Airline
"""
let g:airline_theme='lucius'
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#syntastic#enabled = 1
set laststatus=2
"""
""" Ale Linting
"""
let g:ale_sign_error = '●' " Less aggressive than the default '>>'
let g:ale_sign_warning = '.'
let g:ale_lint_on_enter = 0 "
let g:ale_fixers = {'javascript':['prettier','eslint'],'scss':['prettier'] }
let g:ale_fix_on_save = 1
let g:ale_lint_on_text_changed = 'normal'
let g:ale_lint_on_insert_leave = 1
"""
""" CtrlP
"""
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git\|dist'
nmap <Leader>b :CtrlPBuffer<CR>
"""
""" AG search
"""
let g:ag_prg="/usr/bin/ag --vimgrep --ignore={'*.har'}"
"""
""" Keys for Buffer nav
"""
:nnoremap <Tab> :bnext<CR>
:nnoremap <S-Tab> :bprevious<CR>
:nnoremap <C-X> :bdelete<CR>
filetype plugin on
"""
""" COC completion
"""
autocmd FileType json syntax match Comment +\/\/.\+$+
"""
""" File formats
"""
au BufRead,BufNewFile *.fountain set filetype=fountain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment