Created
December 19, 2015 11:51
-
-
Save letmein/ce087de78c01565b2011 to your computer and use it in GitHub Desktop.
neovim config
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
let $NVIM_TUI_ENABLE_TRUE_COLOR=1 | |
let $NVIM_TUI_ENABLE_CURSOR_SHAPE=1 | |
filetype plugin on | |
filetype indent on | |
syntax on | |
"set hlsearch | |
set tabstop=2 | |
set expandtab | |
set list | |
set listchars=tab:>. | |
set sw=2 | |
set background=dark | |
set number | |
set nowrap | |
set ruler | |
set noswapfile | |
set cursorline | |
colorscheme my | |
autocmd VimEnter * AirlineTheme lucius | |
autocmd BufNewFile,BufReadPost *.coffee setlocal sw=2 tabstop=2 expandtab | |
autocmd BufNewFile,BufReadPost *.slim setlocal sw=2 tabstop=2 expandtab | |
highlight ExtraWhitespace guibg=#660000 | |
match ExtraWhitespace /\s\+$/ | |
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/ | |
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/ | |
autocmd InsertLeave * match ExtraWhitespace /\s\+$/ | |
autocmd BufWinLeave * call clearmatches() | |
autocmd BufWinEnter *.rb,*.coffee,*.slim let w:m2=matchadd('ErrorMsg', '\%>100v.\+', -1) | |
" ------------------------------------------------------------------- | |
" PLUGINS | |
" ------------------------------------------------------------------- | |
call plug#begin('~/.vim/plugged') | |
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } | |
Plug 'tpope/vim-fugitive' | |
Plug 'junegunn/vim-easy-align' | |
Plug 'nathanaelkane/vim-indent-guides' | |
Plug 'https://github.com/rking/ag.vim' | |
Plug 'https://github.com/kchmck/vim-coffee-script' | |
Plug 'https://github.com/digitaltoad/vim-jade' | |
Plug 'https://github.com/slim-template/vim-slim' | |
Plug 'bling/vim-airline' | |
Plug 'git://github.com/kana/vim-textobj-user.git' | |
Plug 'git://github.com/nelstrom/vim-textobj-rubyblock.git' | |
Plug 'https://github.com/Shougo/unite.vim' | |
Plug 'https://github.com/yuku-t/unite-git' | |
call plug#end() | |
" ------------------------------------------------------------------- | |
" KEY MAPPINGS | |
" ------------------------------------------------------------------- | |
" Toggle NerdTree | |
nnoremap <silent> <S-Tab> :NERDTreeToggle<CR> | |
" Open the buffer list | |
nnoremap <Leader>b :Unite -vertical buffer<CR> | |
" Search files | |
nnoremap <Leader>f :Unite -start-insert -vertical git_cached<CR> | |
" Turn off the search highlighting on enter | |
" still buggy in nvim, thus disabled | |
" nmap <CR> :noh<CR><CR> | |
" Start interactive EasyAlign in visual mode (e.g. vip<Enter>) | |
vmap <Enter> <Plug>(EasyAlign) | |
" Show diff between 2 splits | |
nnoremap <silent> <Leader>d :call DiffToggle()<CR> | |
" The ! overwrites any existing definition by this name. | |
function! DiffToggle() | |
if &diff | |
windo diffoff | |
else | |
windo diffthis | |
endif | |
:endfunction | |
" Insert the current filename with full path | |
inoremap \fn <C-R>=expand("%:p")<CR> | |
" Search the selected text with Ag | |
vnoremap // y :Ag <C-R>"<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment