Created
January 7, 2021 13:27
-
-
Save ergoproxy623/298b283df2f05c4d18fff34d45cb1c5b to your computer and use it in GitHub Desktop.
webdev-neovim-2020-init
This file contains hidden or 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
call plug#begin("~/.vim/plugged") | |
" Theme | |
Plug 'dracula/vim' | |
" Language Client | |
Plug 'neoclide/coc.nvim', {'branch': 'release'} | |
let g:coc_global_extensions = ['coc-emmet', 'coc-css', 'coc-html', 'coc-json', 'coc-prettier', 'coc-tsserver'] | |
" TypeScript Highlighting | |
Plug 'leafgarland/typescript-vim' | |
Plug 'peitalin/vim-jsx-typescript' | |
" File Explorer with Icons | |
Plug 'scrooloose/nerdtree' | |
Plug 'ryanoasis/vim-devicons' | |
" File Search | |
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } | |
Plug 'junegunn/fzf.vim' | |
call plug#end() | |
" Enable theming support | |
if (has("termguicolors")) | |
set termguicolors | |
endif | |
" Theme | |
syntax enable | |
colorscheme dracula | |
let g:NERDTreeShowHidden = 1 | |
let g:NERDTreeMinimalUI = 1 | |
let g:NERDTreeIgnore = [] | |
let g:NERDTreeStatusline = '' | |
" Automaticaly close nvim if NERDTree is only thing left open | |
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif | |
" Toggle | |
nnoremap <silent> <C-b> :NERDTreeToggle<CR> | |
nnoremap <C-p> :FZF<CR> | |
let g:fzf_action = { | |
\ 'ctrl-t': 'tab split', | |
\ 'ctrl-s': 'split', | |
\ 'ctrl-v': 'vsplit' | |
\} | |
" requires silversearcher-ag | |
" used to ignore gitignore files | |
let $FZF_DEFAULT_COMMAND = 'ag -g ""' | |
" open new split panes to right and below | |
set splitright | |
set splitbelow | |
" turn terminal to normal mode with escape | |
tnoremap <Esc> <C-\><C-n> | |
" use alt+hjkl to move between split/vsplit panels | |
tnoremap <A-h> <C-\><C-n><C-w>h | |
tnoremap <A-j> <C-\><C-n><C-w>j | |
tnoremap <A-k> <C-\><C-n><C-w>k | |
tnoremap <A-l> <C-\><C-n><C-w>l | |
nnoremap <A-h> <C-w>h | |
nnoremap <A-j> <C-w>j | |
nnoremap <A-k> <C-w>k | |
nnoremap <A-l> <C-w>l | |
" start terminal in insert mode | |
au BufEnter * if &buftype == 'terminal' | :startinsert | endif | |
" open terminal on ctrl+; | |
" uses zsh instead of bash | |
function! OpenTerminal() | |
split term://bash | |
resize 10 | |
endfunction | |
nnoremap <c-n> :call OpenTerminal()<CR> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment