Skip to content

Instantly share code, notes, and snippets.

@blark
Last active October 7, 2017 19:02
Show Gist options
  • Save blark/c08e96065ec24e1921308f413d94a95d to your computer and use it in GitHub Desktop.
Save blark/c08e96065ec24e1921308f413d94a95d to your computer and use it in GitHub Desktop.
nvim configuration
" Notes to make this all work
" ---------------------------
"
" 1) vim-plug - follow the directions at https://github.com/junegunn/vim-plug
" 2) a powerline patched font, I recommend this one https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/Meslo/M-DZ/complete
" the OTF file will be fine, you don't need all the files in that dir, just choose one
" 3) a truecolour capable terminal like iTerm or Terminator ... or remove the
" settings $NVIM_TUI_ENABLE_TRUE_COLOR and set termguicolors below
" 4) to install all the plugins below once this file is in place run :PlugUpdate
:call plug#begin()
" github gist editor/viewer
Plug 'lambdalisue/vim-gista',
" requred for gista
Plug 'https://github.com/mattn/webapi-vim',
" multicolor parenthesis
Plug 'https://github.com/luochen1990/rainbow.git',
" tab completion
Plug 'https://github.com/ervandew/supertab.git',
" awesome status bar
Plug 'https://github.com/vim-airline/vim-airline.git',
" show indents
Plug 'https://github.com/Yggdroot/indentLine.git',
" show buffers on status line
Plug 'https://github.com/bling/vim-bufferline.git',
" extra themes for airline
Plug 'vim-airline/vim-airline-themes',
" color scheme
Plug 'morhetz/gruvbox',
" highlight and remove trailing whitespace
Plug 'https://github.com/ntpeters/vim-better-whitespace.git',
" file browser (use :NERDTree or ctrl-n)
Plug 'https://github.com/scrooloose/nerdtree.git',
" make airline even prettier
Plug 'ryanoasis/vim-devicons',
" markdown editing and display
Plug 'https://github.com/plasticboy/vim-markdown.git',
" python comletion
Plug 'https://github.com/davidhalter/jedi',
" more python stuff
Plug 'zchee/deoplete-jedi',
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
call plug#end()
filetype plugin indent on
set termguicolors
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
let $NVIM_TUI_ENABLE_CURSOR_SHAPE=1 " change cursor shape on insert
colo gruvbox
"""" Deoplete nvim
let g:deoplete#enable_at_startup = 1
let g:deoplete#sources#jedi#show_docstring = 1
"""" Color scheme config
let g:gruvbox_contrast_dark = 'hard'
let g:gruvbox_color_column = 'dark0'
let g:gruvbox_hls_cursor = 'red'
"""" Airline config (cool status bars)
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#tab_nr_type = 1 " show tab # not splits in tab
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#show_buffers = 0
let g:airline#extensions#bufferline#overwrite_variables=0
"let g:airline#extensions#tabline#buffer_nr_show = 1
"""" Bufferline (show buffers on airline) config
let g:bufferline_echo = 0 " no buffer display on the command line
let g:bufferline_active_buffer_left = ' '
let g:bufferline_active_buffer_right = ''
let g:bufferline_show_bufnr = 1
let g:bufferline_active_highlight = 'StatusLineNC'
let g:bufferline_inactive_highlight = 'airline_c'
"""" Indentline configuration
let g:indentLine_char = '⇥' " alt ┋ ┆ ┊ │  ⁝ ⁞ ⋮ ⇥
let g:indentLine_color_gui = 'gray'
let g:indentLine_concealcursor = 1
"let g:indentLine_leadingSpaceEnabled = 1
"let g:indentLine_setColors = 0
"let g:indentLine_conceallevel = 0
"""" Random stuff
let g:NERDTreeDirArrowExpandable = ''
let g:NERDTreeDirArrowCollapsible = ''
let g:vim_markdown_folding_disabled = 1
let g:SuperTabClosePreviewOnPopupClose = 1
let python_highlight_all = 1
let g:bufferline_rotate = 1
let g:bufferline_modified = ' ✻'
let mapleader = "\<Space>"
let g:rainbow_active = 1
set background=dark " Setting dark mode
syntax enable
set autoread " auto read files that have been changed
set laststatus=2
set nu
set colorcolumn=80
set tabstop=4 " number of visual spaces interpreted for each tab
set softtabstop=4 " number of spaces inserted when using tab
set expandtab " expand tabs to spaces
set shiftwidth=4 " When indenting with > / <
set smartindent
set autoindent
set smarttab
set cursorline
set scrolloff=10
set ignorecase " make search case insensitive
set smartcase " unless the search has captial letters
set enc=utf-8
set fillchars=vert:\│
"set foldcolumn=2 " see where folds are, takes up valuable terminal space
"set foldlevel=1
au bufwritepost .vimrc source $MYVIMRC
au BufWritePre * StripWhitespace " Automatically strip trailing whitespace
" Restore cursor position when reloading a file
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
"""" shortcuts
vmap <Leader>y "+y
nmap <Leader>p "+p
nmap <Leader>P "+P
map gb :bn<cr>
map gB :bp<cr>
map <C-n> :NERDTreeToggle<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment