Skip to content

Instantly share code, notes, and snippets.

@bazay
Last active December 9, 2019 07:44
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 bazay/de146aa68c440f0fe7aa358685387247 to your computer and use it in GitHub Desktop.
Save bazay/de146aa68c440f0fe7aa358685387247 to your computer and use it in GitHub Desktop.
My config for nvim
" Call PlugInstall to install new plugins
call plug#begin('~/.config/nvim/bundle')
" Initialize plugin system
Plug 'daylerees/colour-schemes', { 'rtp': 'vim/' }
Plug 'arcticicestudio/nord-vim'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } " Deoplete – Code Completion Engine
Plug 'scrooloose/nerdcommenter' " Nerd Commenter - Vim plugin for intensely orgasmic commenting
Plug 'scrooloose/nerdTree' " Nerdtree – Tree File Explorer
Plug 'Xuyuanp/nerdtree-git-plugin' " Nerdtree Git Plugin - for above plugin
Plug 'mattn/emmet-vim' " Emmet – HTML Expansion
Plug 'tpope/vim-surround' " Vim Surround – Quoting/Parenthesizing
Plug 'ctrlpvim/ctrlp.vim' " CtrlP – Fuzzy File, Buffer and Tag Finder (using CTRL+p to search files in dir)
Plug 'easymotion/vim-easymotion' " Easy motion – Text Navigation
Plug 'bling/vim-airline' " Airline – Info Tabline
Plug 'vim-airline/vim-airline-themes' " Airline Themes - Themes for the above plugin
" Plug 'sudar/comments.vim' " Comments.vim - (Un)Comment code using (<C-x>)<C-c>
Plug 'vim-ruby/vim-ruby'
Plug 'vim-scripts/PA_ruby_ri'
Plug 'thoughtbot/vim-rspec' " Vim RSpec - Run rspec from vim
call plug#end()
syntax on
colorscheme peacocks-in-space
if $TERM == "xterm-256color"
set t_Co=256
endif
" Ruby docs
" Custom commands
command! EditConfig vert new /Users/baron/.config/nvim/init.vim
command! OpenConfig EditConfig
" map <Leader>c :command EditConfig
command! Reload source /Users/baron/.config/nvim/init.vim
" Nerdtree customization
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
nnoremap <silent> <Leader>v :NERDTreeFind<CR>
let g:NERDSpaceDelims = 1
let g:NERDCommentEmptyLines = 1
let g:NERDTrimTrailingWhitespace = 1
let NERDTreeShowHidden = 1
" RSpec.vim mappings
map <Leader>t :call RunCurrentSpecFile()<CR>
map <Leader>s :call RunNearestSpec()<CR>
map <Leader>l :call RunLastSpec()<CR>
map <Leader>a :call RunAllSpecs()<CR>
" Remap CTRL+j & CTRL+k to up and down
inoremap <expr> <C-j> pumvisible() ? "\<C-n>" : "\<C-j>"
inoremap <expr> <C-k> pumvisible() ? "\<C-p>" : "\<C-k>"
" Remap CTRL+n to open filetree side panel
nmap <C-n> :NERDTreeToggle<CR>
" Access HTML element builder (Emmet) via <C-a>
let g:user_emmet_expandabbr_key = '<C-a>,'
" Activate vim-easymotion
map <Leader> <Plug>(easymotion-prefix)
" Airline config
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_theme='luna'
let g:airline#extensions#tabline#left_sep = ' '
let g:airline#extensions#tabline#left_alt_sep = '|'
let g:airline#extensions#tabline#formatter = 'unique_tail'
" turn absolute line numbers on
set number
set nu
" turn relative line numbers on
set relativenumber
set rnu
set termguicolors
set mouse=
set ruler " Show the line and column number of the cursor
set formatoptions+=o " Continue comment marker on new lines
set textwidth=0 " Hardwrap long lines as you type them
set modeline " Enable modeline
" set esckeys " Cursor keys in insert mode
" set linespace=0 " Set line-spacing to minimum
set nojoinspaces " Prevents inserting two spaces after punctuation on Join (J)
" More natural splits
set splitbelow " Horizontal split below current
set splitright " Vertical split to right of current
set tabstop=2 shiftwidth=2 expandtab
if !&scrolloff
set scrolloff=3 " Show next 3 columns whilst scrolling
endif
if !&sidescrolloff
set sidescrolloff=5 " Show next 5 columns whilst side scrolling
endif
set display+=lastline
set nostartofline " Do not jump to first character with page commands
set noerrorbells " No annoying beeps
" set backspace=indent.eol.start " Makes backspace key more powerful
set showcmd " Show me what I'm typing
set showmode " Show current mode
set noswapfile " Don't use swapfile
set nobackup " Don't create annoying backup files
set encoding=utf-8 " Set default encoding to UTF-8
set autowrite " Automatically save before :next, :make, etc
set autoread " Automatically reread changed files without asking
set laststatus=2
" set fileformats=unix.dos.mac " Prefer Unix > Windows > OS 9 formats
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment