Skip to content

Instantly share code, notes, and snippets.

@remynguyen96
Created November 12, 2020 15:10
Show Gist options
  • Select an option

  • Save remynguyen96/4ea0e3ad52c1086d73796808fb731c8a to your computer and use it in GitHub Desktop.

Select an option

Save remynguyen96/4ea0e3ad52c1086d73796808fb731c8a to your computer and use it in GitHub Desktop.
Initial neovim (~/.config/nvim/init.vim)
source $HOME/.config/nvim/vim-plug/plugins.vim
" Leader
let mapleader = " "
source $HOME/.config/nvim/theme.vim
source $HOME/.config/nvim/nerdtree_fzf.vim
source $HOME/.config/nvim/coc.vim
" Copy to clipboard
set clipboard=unnamed
" Use tab with text block
vmap <Tab> >gv
vmap <S-Tab> <gv
" Get off my lawn
nnoremap <Left> :echoe "Use h"<CR>
nnoremap <Right> :echoe "Use l"<CR>
nnoremap <Up> :echoe "Use k"<CR>
nnoremap <Down> :echoe "Use j"<CR>
nnoremap <leader>\ :vsplit<CR>
nnoremap <leader>/ :split<CR>
" Remove highlight
map <S-Tab>h :nohl<CR>
" j/k will move virtual lines (lines that wrap)
noremap <silent> <expr> j (v:count == 0 ? 'gj' : 'j')
noremap <silent> <expr> k (v:count == 0 ? 'gk' : 'k')
" Easymotion
" s{char}{char} to move to {char}{char} over windows
nmap <leader>F <Plug>(easymotion-overwin-f)
" Move to line over windows
nmap <leader>L <Plug>(easymotion-overwin-line)
" Search n-chars
map / <Plug>(easymotion-sn)
" Move to word
map <Leader>w <Plug>(easymotion-bd-w)
nmap <Leader>w <Plug>(easymotion-overwin-w)
" Multi select
let g:multi_cursor_next_key='<C-n>'
let g:multi_cursor_prev_key='<C-p>'
let g:multi_cursor_skip_key='<C-x>'
" When the type of shell script is /bin/sh, assume a POSIX-compatible
" shell for syntax highlighting purposes.
let g:is_posix = 1
" Go file config
au FileType go set noexpandtab
au FileType go set shiftwidth=4
au FileType go set softtabstop=4
au FileType go set tabstop=4
au BufRead,BufNewFile .eslintrc.json setlocal filetype=json
au BufRead,BufNewFile .babelrc setlocal filetype=json
au BufRead,BufNewFile .prettierrc setlocal filetype=json
au BufRead,BufNewFile .babelrc.js setlocal filetype=javascript
au BufRead,BufNewFile .sequelizerc setlocal filetype=javascript
au BufRead,BufNewFile *.hbs setlocal filetype=html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment