Skip to content

Instantly share code, notes, and snippets.

@vbogretsov
Last active August 26, 2018 08:25
Show Gist options
  • Select an option

  • Save vbogretsov/38078e64cb706db1f4bc2c2eb195eba6 to your computer and use it in GitHub Desktop.

Select an option

Save vbogretsov/38078e64cb706db1f4bc2c2eb195eba6 to your computer and use it in GitHub Desktop.
" ========================== Plugin manager ==================================
call plug#begin('~/.config/nvim/plugged')
" Plug 'itchyny/lightline.vim'
"Plug 'tpope/vim-fugitive'
Plug 'altercation/vim-colors-solarized'
"Plug 'hdima/python-syntax'
"Plug 'irrationalistic/vim-tasks'
"Plug 'Shougo/defx.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'jiangmiao/auto-pairs'
Plug 'tpope/vim-surround'
call plug#end()
" ========================== Basic configuration =============================
set number
set completeopt-=preview
set nofoldenable
set scrolloff=15
set visualbell
set ruler
"set noruler
"set noshowcmd
set hidden
set noshowmode
set showtabline=0
set cursorline
set tabstop=4
set shiftwidth=4
set expandtab
set fillchars+=vert:│
set nobackup
set noswapfile
" ========================== 80 chars rule ===================================
set colorcolumn=80
"hi ColorColumn ctermbg=8 ctermfg=8
hi ColorColumn ctermbg=2
" ========================== Scroll performace ===============================
set lazyredraw
set ttyfast
" ========================== Color scheme ====================================
set background=dark
colorscheme solarized
hi NonText term=NONE cterm=NONE ctermfg=Black
hi EndOfBuffer ctermfg=8
" ========================== Split Line =====================================
hi VertSplit ctermbg=NONE ctermfg=Black
" ========================== Line Number Column ==============================
hi CursorLineNR ctermbg=Black ctermfg=White
hi clear LineNr
" ========================== Sign Column =====================================
set signcolumn="yes"
autocmd BufEnter * sign define dummy
autocmd BufEnter * execute 'sign place 1 line=1 name=dummy buffer=' . bufnr('')
hi clear SignColumn
" ========================== Not printable chars =============================
set listchars=tab:▸\ ,trail:·,space:·
set list
" ========================== Search options ==================================
set path+=**
set wildmenu
set smartcase
set ignorecase
set showmatch
set wildmode=full
" ========================== Cursort style ===================================
set guicursor=
" ========================== Netrw configurations ============================
let g:netrw_banner=0
let g:netrw_preview=1
let g:netrw_liststyle=3
let g:netrw_browse_split=0
"let g:netrw_altv = 1
let g:netrw_winsize=20
autocmd FileType netrw set nolist
set fillchars-=vert:\
" ========================== LightLine configuration =========================
let g:lightline = {
\ 'colorscheme': 'solarized',
\ 'active': {
\ 'left': [ [ 'bufnum', 'mode', 'paste' ],
\ [ 'filename', 'modified' ] ]
\ },
\ 'component_function': {
\ 'filename': 'LightLineFilename'
\ },
\ 'subseparator': { 'left': '│', 'right': '│' },
\ }
function! LightLineFilename()
return expand('%')
endfunction
" ========================== Clipboard integration ===========================
function! ClipboardYank()
call system('pbcopy', @@)
endfunction
function! ClipboardPaste()
let @@ = system('pbpaste')
endfunction
vnoremap <silent> y y:call ClipboardYank()<cr>
vnoremap <silent> d d:call ClipboardYank()<cr>
nnoremap <silent> p p:call ClipboardPaste()<cr>
vnoremap <silent> p p:call ClipboardPaste()<cr>
" ========================== Python syntax options ===========================
let g:python_highlight_all=1
let g:pymode_options_colorcolumn=0
" ========================== Commands ========================================
command -nargs=? Help help <args> | only
" ========================== Key bindings ====================================
" list buffers
nnoremap <Leader>b :ls<CR>:b<Space>
nnoremap <Leader>e :e<Space>
nnoremap <Leader>f :find<Space>
nnoremap <Esc> :noh<CR>
" ========================== Status line =====================================
let g:stnormal = ' NORMAL'
let g:stinsert = ' INSERT'
let g:stvisual = ' VISUAL'
let g:stvline = ' V-LINE'
let g:streplace = ' REPLACE'
let g:stcommand = ' COMMAND'
let g:stunknown = ' UNKNOWN'
function StatusLineMode()
let value = mode()
if value == 'n'
execute 'hi StMode ctermbg=4 ctermfg=8'
return g:stnormal
elseif value == 'v'
execute 'hi StMode ctermbg=5 ctermfg=8'
return g:stvisual
elseif value == 'V'
execute 'hi StMode ctermbg=5 ctermfg=8'
return g:stvline
elseif value == 'R'
execute 'hi StMode ctermbg=4 ctermfg=8'
return g:streplace
elseif value == 'i'
execute 'hi StMode ctermbg=2 ctermfg=8'
return g:stinsert
elseif value == 'c'
execute 'hi StMode ctermbg=3 ctermfg=8'
return g:stcommand
else
return g:stunknown
endif
endfunction
function StatusLineFileType()
let value = &filetype
if value == ''
return 'noft'
else
return value
endif
endfunction
set statusline=
set statusline+=\%#StMode#\%{StatusLineMode()}
set statusline+=\ %#StDefault#
set statusline+=\%#StFile#\ %f
set statusline+=\ %#StDefault#
set statusline+=\ \%m\ %r\ %h
set statusline+=%=
set statusline+=l:\ %-4.4l,\ c:\ %-3.3v
set statusline+=\ [\ %{&fileformat}\ ]
set statusline+=\ [\ %{StatusLineFileType()}\ ]
set statusline+=\ [%n]
hi StatusLine ctermbg=11 ctermfg=Black
hi StFile ctermbg=10 ctermfg=Black
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment