Last active
April 17, 2022 15:44
-
-
Save GavinSalcedo/2ca1f3f7b5d6a8c0d45aa9442c24e1c9 to your computer and use it in GitHub Desktop.
init.vim - ver. 2
This file contains 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
:set number | |
:set relativenumber | |
:set autoindent | |
:set tabstop=4 | |
:set shiftwidth=4 | |
:set smarttab | |
:set softtabstop=4 | |
:set mouse=a | |
call plug#begin("~/.vim/plugged") | |
" Theme | |
Plug 'dracula/vim' | |
Plug 'pangloss/vim-javascript' " JavaScript support | |
Plug 'leafgarland/typescript-vim' " TypeScript syntax | |
Plug 'maxmellon/vim-jsx-pretty' " JS and JSX syntax | |
Plug 'jparise/vim-graphql' " GraphQL syntax | |
" Autocomplete plugin | |
Plug 'neoclide/coc.nvim', {'branch': 'release'} | |
" CoC extensions | |
let g:coc_global_extensions = ['coc-tsserver', 'coc-css', 'coc-cssmodules', 'coc-dash-complete', 'coc-dot-complete', 'coc-eslint', 'coc-fzf-preview', 'coc-git', 'coc-graphql', 'coc-highlight', 'coc-html', 'coc-html-css-support', 'coc-json', 'coc-ltex', 'coc-prettier'] | |
" File Search | |
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } | |
Plug 'junegunn/fzf.vim' | |
" Git Plug | |
Plug 'tpope/vim-fugitive' | |
" Git Nerd Tree | |
" Plug 'Xuyuanp/git-nerdtree' | |
Plug 'preservim/nerdtree' | | |
\ Plug 'Xuyuanp/nerdtree-git-plugin' | |
"Snippets | |
Plug 'SirVer/ultisnips' | |
Plug 'mlaursen/vim-react-snippets' | |
" Auto Pairs | |
Plug 'jiangmiao/auto-pairs' | |
" CSS Colors | |
Plug 'ap/vim-css-color' | |
" Prettier | |
Plug 'prettier/vim-prettier', { 'do': 'yarn install --frozen-lockfile --production' } | |
let g:prettier#autoformat = 0 | |
autocmd BufWritePre *.js,*.jsx,*.mjs,*.ts,*.tsx,*.css,*.less,*.scss,*.json,*.graphql,*.md,*.vue PrettierAsync | |
call plug#end() | |
" Remap keys for applying codeAction to the current line. | |
nmap <leader>ac <Plug>(coc-codeaction) | |
" Apply AutoFix to problem on the current line. | |
nmap <leader>qf <Plug>(coc-fix-current) | |
" GoTo code navigation. | |
nmap <silent> gd <Plug>(coc-definition) | |
nmap <silent> gy <Plug>(coc-type-definition) | |
nmap <silent> gi <Plug>(coc-implementation) | |
nmap <silent> gr <Plug>(coc-references) | |
" Theme | |
syntax enable | |
colorscheme dracula | |
let g:NERDTreeShowHidden = 1 | |
let g:NERDTreeMinimalUI = 1 | |
let g:NERDTreeIgnore = [] | |
let g:NERDTreeStatusline = '' | |
let g:NERDTreeGitStatusIndicatorMapCustom = { | |
\ 'Modified' :'✹', | |
\ 'Staged' :'✚', | |
\ 'Untracked' :'✭', | |
\ 'Renamed' :'➜', | |
\ 'Unmerged' :'═', | |
\ 'Deleted' :'✖', | |
\ 'Dirty' :'✗', | |
\ 'Ignored' :'☒', | |
\ 'Clean' :'✔︎', | |
\ 'Unknown' :'?', | |
\ } | |
" 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 <C-f> :NERDTreeFocus<CR> | |
nnoremap <C-n> :NERDTree<CR> | |
nnoremap <C-t> :NERDTreeToggle<CR> | |
nnoremap <C-p> :FZF<CR> | |
let g:fzf_action = { | |
\ 'ctrl-t': 'tab split', | |
\ 'ctrl-s': 'split', | |
\ 'ctrl-v': 'vsplit' | |
\} | |
" Tabs toggles | |
nnoremap <C-[> :tabn <CR> | |
nnoremap <C-]> :tabp <CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment