Skip to content

Instantly share code, notes, and snippets.

@defHLT
Created March 31, 2017 08:48
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 defHLT/77c6bf6cadf30272953826bbcc13a102 to your computer and use it in GitHub Desktop.
Save defHLT/77c6bf6cadf30272953826bbcc13a102 to your computer and use it in GitHub Desktop.
" Plugins
call plug#begin('~/.config/nvim/plugged')
" Autocomplete
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
let g:deoplete#enable_at_startup = 1
" JS
Plug 'carlitux/deoplete-ternjs', { 'do': 'npm install -g tern' }
Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx'
let g:jsx_ext_required = 0
Plug 'wakatime/vim-wakatime'
Plug 'scrooloose/nerdtree'
Plug 'mhinz/vim-startify'
Plug 'chemzqm/vim-jsx-improve'
call plug#end()
syntax enable
filetype plugin on
filetype indent on
" Statusline
if has('statusline')
function! SetStatusLineStyle()
if &stl == '' || &stl =~ 'synID'
let &stl="%f %([%R%M]%)%{'!'[&ff=='".&ff."']}%{'$'[!&list]}%{'~'[&pm=='']}%=#%n %l/%L,%c%V "
else
let &stl="%F %y%([%R%M]%)%{'!'[&ff=='".&ff."']}%{'$'[!&list]} (%{synIDattr(synID(line('.'),col('.'),0),'name')})%=#%n %l/%L,%c%V "
endif
endfunc
" switch between the normal and vim-debug modes in
" the status line
map _ds :call SetStatusLineStyle()<CR>
call SetStatusLineStyle()
endif
call SetStatusLineStyle()
" Line numbers
set numberwidth=3
set relativenumber
set number
highlight LineNr ctermfg=darkgrey " guifg=red
set undofile
" mappings
imap jj <ESC>
nmap ; :
"
" Indentation
set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab
" Toggle spell checking
set nospell
nmap <leader>s :set spell!<CR>
" Searching, Substituting
set incsearch " Show search matches as you type
set ignorecase " Ignore case when searching
set smartcase " don't ugnore case for CAPITAL LETTERS
set hlsearch " Highlight search results
highlight Search ctermfg=black ctermbg=darkyellow
set noshowmatch " Don't jump to bracket - it can be annoying
" Tell vim to remember certain things when we exit
" set viminfo='10,\"100,:20,%,n~/.viminfo
set shada='50,<1000,s100,:1024,n~/nvim/shada,h
" restore cursor position
function! SetCursorPosition()
"if &filetype !~ 'svn\|commit\c'
if line("'\"") > 0 && line("'\"") <= line("$") |
execute 'normal! g`"zvzz' |
endif
"end
endfunction
autocmd BufReadPost * call SetCursorPosition()
set nolist
nmap <leader>l :set list!<CR>
" Use the same symbols as TextMate for tabstops and EOLs
set listchars=tab:▸\ ,eol:¬
set listchars+=precedes:<,extends:>
"<TAB>
highlight SpecialKey ctermfg=darkgray
"<CR>
highlight NonText ctermfg=darkgray
nmap <leader><space> :nohlsearch<CR>
nmap <leader>w :set wrap!<CR>
nmap <leader>d "_d
set cursorline
highlight CursorLineNr ctermfg=yellow cterm=bold
highlight CursorLine gui=none cterm=none term=none
" Fix vim's terrible regexp scheme
nnoremap / /\v
vnoremap / /\v
vnoremap ? ?\v
nnoremap ? ?\v
set gdefault "s///g by default
" Set the working directory to wherever the open file lives
set autochdir
nmap <leader>n :NERDTreeToggle<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment